Comment by theden
4 years ago
Usually I'll just search online and read man pages (and experiment different options and solutions) but here's a short list of my most used aliases and functions, I guess that's the closest thing I have to a cheatsheet
alias private='shopt -uo history'
alias unprivate='shopt -so history'
alias gl="git log --all --decorate --oneline --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
alias gitlog='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit --date=relative --branches'
alias sha256sum="shasum -a 256"
alias sha512sum="shasum -a 512"
alias flushDNSMac="sudo killall -HUP mDNSResponder"
alias myip="dig +short myip.opendns.com @resolver1.opendns.com"
alias m1="arch -arm64"
alias x86="arch -x86_64"
alias ibrew='arch -x86_64 /usr/local/bin/brew'
alias upgrade="ibrew upgrade && m1 brew upgrade && mas upgrade"
alias docker-clean='docker ps -aq | xargs -P $(nproc) -n1 docker rm -f ; docker rmi -f $(docker images --filter "dangling=true" -q --no-trunc)'
alias autoscalerstatus="kubectl describe -n kube-system configmap cluster-autoscaler-status"
alias evictedpods="kubectl get pods --all-namespaces --field-selector=status.phase=Failed"
2qr() {
qrencode "$1" -t ANSI256 -o -
}
curl_status() {
if [ -n "${1}" ]; then
curl -L -o /dev/null --silent --head --write-out '%{http_code}\n' "$1"
fi
}
webp_convert() {
local file="$1"
cwebp -q 100 "$file" -o "${file%.\*}.webp"
}
To minify everything (using https://github.com/tdewolff/minify)
find ./dist/ -type f \( \
-name "*.html" \
-o -name '*.js' \
-o -name '*.css' \
-o -name '*.svg' \
-o -name "*.xml" \
-o -name "*.json" \
-o -name "*.htm" \
\) \
-and ! -name "*.min\*" -print0 |
xargs -0 -n1 -P4 -I '{}' sh -c 'minify -o "{}" "{}"'
No comments yet
Contribute on Hacker News ↗