Skip to content

Instantly share code, notes, and snippets.

@alireza-ahmadi
Created August 13, 2018 18:38
Show Gist options
  • Save alireza-ahmadi/58e41b6418acb3d698c7968ade9588dc to your computer and use it in GitHub Desktop.
Save alireza-ahmadi/58e41b6418acb3d698c7968ade9588dc to your computer and use it in GitHub Desktop.
# Aliases
alias o="open ."
alias pi="ping blogfa.com"
alias gis="git status"
alias gad="git add"
alias gil="git log"
alias s="source"
alias sp="spotify"
alias google-chrome="open -a 'Google Chrome'"
alias y="yarn"
alias c="code ."
alias h="history"
alias hp="history | grep"
alias shadow="brew services start shadowsocks-libev && anybar green"
alias shadown="brew services stop shadowsocks-libev && anybar red"
unalias gm
# Functions
dl () {
if [ "$2" -eq 0 ]
then
axel -avn 5 "$1"
else
axel -avn 16 "$1"
fi
}
f () {
z $1 && open .
}
anybar () {
echo -n $1 | nc -4u -w0 localhost ${2:-1738};
}
mcd () {
mkdir -p -- "$1" && cd -P -- "$1"
}
curlt () {
curl -so /dev/null -w "\
namelookup: %{time_namelookup}s\n\
connect: %{time_connect}s\n\
appconnect: %{time_appconnect}s\n\
pretransfer: %{time_pretransfer}s\n\
redirect: %{time_redirect}s\n\
starttransfer: %{time_starttransfer}s\n\
-------------------------\n\
total: %{time_total}s\n" "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment