https://github.com/petitviolet/shell_commands
handmade shell commands
https://github.com/petitviolet/shell_commands
shell zsh
Last synced: 26 days ago
JSON representation
handmade shell commands
- Host: GitHub
- URL: https://github.com/petitviolet/shell_commands
- Owner: petitviolet
- Created: 2015-02-18T07:31:20.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-01-07T00:46:15.000Z (over 4 years ago)
- Last Synced: 2025-02-28T18:28:00.565Z (over 1 year ago)
- Topics: shell, zsh
- Language: Shell
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# handmade shell commands
## s3_image
### usage
```sh
export AWS_PROFILE=
export BUCKET_NAME=
export S3DIRECTORY=
s3_image [upload|url]
```
### show image url
use `s3_image url `.
```sh
$ BUCKET_NAME=MYBUCKET S3DIRECTORY=path/to/image s3_image url local/image/file.png
https:/MYBUCKET.s3.amazonaws.com/path/to/image/file.png
```
### upload image and get url
use `s3_image upload `.
```sh
$ BUCKET_NAME=petitviolet S3DIRECTORY=path/to/image AWS_PROFILE=s3 s3_image upload ~/tmp/scala.png
upload: ../../tmp/scala.png to s3://petitviolet/path/to/image/scala.png
https://petitviolet.s3.amazonaws.com/path/to/image/scala.png%
```
## loading
show loading indicator.
reference in Japanese.
[Zshで長い処理をしている間に読込中を表示する - Qiita](http://qiita.com/petitviolet/items/5cc1916eb3fdb8d54823)
```sh
loading 5
# loading
```

### using loading indicator in other function
```sh
other_function() {
# show loading indicator
## disable job control to suppress print process id
set +m
loading 100 &
set -m
local loading_pid=$!
# execute heavy command
do_something_heavy
# remove indicator
kill -INT $loading_pid &>/dev/null
}
```
## remark
Show presentation using [remark.js](https://github.com/gnab/remark) from markdown file.
```sh
remark /path/to/markdown/file.md
```
Open presentation on Google Chrome.
## git subcommands
### git update
fetch and rebase remote branch with stash local changes.
```shell-session
git update
```
### git browse
open current branch and directory on remote.
```shell-session
git browse
```
### git replace
replace strings with `sed`.
```shell-session
git replace hoge foo
```
# LICENSE
[MIT License](https://petitviolet.mit-license.org/)