Workspace management:
export WORKSPACE="$HOME/workspace"
alias ws='cd $WORKSPACE && ls'
History related commands: alias h="fc -li 1" # like `history` but with dates
# Which commands do I use the most?
alias histstats="history | awk '{CMD[\$2]++;count++;}END { for (a in CMD)print CMD[a] \" \" CMD[a]/count*100 \"% \" a;}' | grep -v './' | column -c3 -s ' ' -t | sort -nr | nl | head -n10"
Golang: alias gopath='cd $GOPATH/src && tree -dL 3'
Git: # --no-pager is underrated
alias glnp="git --no-pager log --oneline -n30"
Misc: # Have I been pwned?
# usage: `hibp email@example.com`
hibp() {
curl -fsS "https://haveibeenpwned.com/api/v2/breachedaccount/$1" | jq -r 'sort_by(.BreachDate)[] | [.Title,.Domain,.BreachDate,.PwnCount] | @tsv' | column -t -s$'\t'
}
# Weather
alias weather='curl wttr.in/$CITY'