handmade shell commands
s3_image
usage
export AWS_PROFILE=<your aws profile>
export BUCKET_NAME=<your bucket to upload>
export S3DIRECTORY=<your directory to upload>
s3_image [upload|url] <image path>
show image url
use s3_image url <path>
.
$ 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 <path>
.
$ 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
loading 5
# loading <seconds>
using loading indicator in other function
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 from markdown file.
remark /path/to/markdown/file.md
Open presentation on Google Chrome.
git subcommands
git update
fetch and rebase remote branch with stash local changes.
git update
git browse
open current branch and directory on remote.
git browse
git replace
replace strings with sed
.
git replace hoge foo