Skip to content

Instantly share code, notes, and snippets.

View KanshuYokoo's full-sized avatar

kkaannnssshh KanshuYokoo

View GitHub Profile
git log --graph --oneline --all --decorate=full
@KanshuYokoo
KanshuYokoo / gist:498b3dea88b8ec8d146cdc1345adea28
Created December 26, 2017 20:07
Git. Delete locale branches expect master
git branch |grep -v master |xargs git branch -D
@KanshuYokoo
KanshuYokoo / doseContains(yourStringContainsStrings: string, anotherString: string)
Created January 16, 2018 12:34
how to know if the string contains another string in JS.
RegExp(anotherString).test(yourStringContainsStrings)
@KanshuYokoo
KanshuYokoo / gist:c83d64ff1f5958097eb5b5126b81ac2a
Created March 6, 2018 04:12
unix time with milliseconds by bash
$ date +%s%3N
return with milliseconds
$ date +%s%3N
retrun with nano seconds
@KanshuYokoo
KanshuYokoo / gist:a15fc76aac73dd5c0c675d06d1daf67b
Created March 7, 2018 08:37
remove docker containers from image ID 043e31e75619.
$docker ps -a |grep 043e31e75619 |awk '{print $1}' |xargs docker rm
@KanshuYokoo
KanshuYokoo / gist:e19cf787b83b28f37776f88f8a329c31
Created March 8, 2018 10:15
current time in unix time by Javascript
seconds
Math.round((new Date()).getTime() / 1000);
milli second
Math.round((new Date()).getTime());
$git submodule foreach 'git stash'
@KanshuYokoo
KanshuYokoo / gist:61c7df6f4e755b28838b44bd6410ae3f
Created March 28, 2018 04:29
how to retrieve branch name by bash. for the use of bash prompt. very famous script.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
@KanshuYokoo
KanshuYokoo / commentoout.sh
Created March 31, 2018 08:22
How to comment out multiple line on bash script
#!/bin/sh
echo bla
echo bla bla
echo bla bla bla
echo Before Comment out
:<< COMMENT
echo this is a comment
echo comment
echo Hello
COMMENT
@KanshuYokoo
KanshuYokoo / gist:40c4e685dfbefc05e8bed39ee7ab68a7
Created May 2, 2018 14:37
delete all branch expect master
git branch |grep -v master |xargs git branch -D