Skip to content

Instantly share code, notes, and snippets.

@anthony2025
Created December 29, 2017 14:55
Show Gist options
  • Save anthony2025/af4f24095e8b3a63294656325a289a1e to your computer and use it in GitHub Desktop.
Save anthony2025/af4f24095e8b3a63294656325a289a1e to your computer and use it in GitHub Desktop.
function jarify() {
jar cmvf META-INF/MANIFEST.MF $1 $2
}
function mkcd() {
mkdir -p "$@" && cd $_
}
function dotfiles() {
cd ~;
npm ls -g --depth=0 > .npmg;
brew list > .brewlist;
brew cask list >> .brewlist;
git add `git ls-tree -r master --name-only`;
git commit --allow-empty-message -m '';
git push;
cd -;
}
function unquarantine() {
for attribute in com.apple.metadata:kMDItemDownloadedDate \
com.apple.metadata:kMDItemWhereFroms \
com.apple.quarantine; do
sudo xattr -r -d "$attribute" "$@"
done
}
function gput() {
git add -A
git commit -m $1
git push
}
alias resize="mogrify -path . -resize 1600x1600\> -format jpg *.jpg"
alias gci='git ci -v'
alias glog='git log --all --date-order --graph --date=short --format="%C(green)%H%Creset %C(yellow)%an%Creset %C(blue)%ad%Creset %C(red)%d%Creset%s"'
alias gdiag="git log --graph --decorate --pretty=oneline --abbrev-commit"
alias gsetremote="git remote add origin"
alias gchangeremote="git remote set-url origin"
alias gfiles="git ls-tree -r master --name-only"
# Usage: `mergepdf -o output.pdf input{1,2,3}.pdf`
alias mergepdf='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py'
alias mute="osascript -e 'set volume output muted true'"
alias unmute="osascript -e 'set volume output muted false'"
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash"
alias wifi="wifi-password"
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
alias externalip2="curl -s icanhazip.com"
alias externalip1="dig +short myip.opendns.com @resolver1.opendns.com"
alias externalip="dig +short myip.opendns.com @resolver1.opendns.com"
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
alias ..="cd .."
alias ...="cd ../.."
alias mv="mv -v"
alias rmf="rm -rf"
alias mkcd="mkcd"
alias ':q'="exit"
alias k="k -ah"
alias config="vim ~/.zshrc"
alias aliases="vim ~/.zsh_aliases"
alias variables="vim ~/.zsh_variables"
alias finder="open ."
alias text="open -a TextEdit"
# alias cheatsheet="tail -n +0 ~/.zsh_aliases"
alias cheatsheet="cat ~/.zsh_aliases"
alias mkdirs="mkdir -p"
alias update="zgen reset; zgen selfupdate; zgen update; brew update; brew upgrade -v; npm install npm@latest -g; npm update -g; dotfiles"
alias man1="tldr"
alias man2="cheat"
alias runnable="chmod +x"
alias std="standard --verbose | snazzy"
alias npmg="npm ls -g --depth=0"
alias ds="cd ~/Desktop"
alias yarny="yarn; yarn start"
alias shellcheck='docker run -v "$PWD:/mnt" koalaman/shellcheck'
alias awslogin="eval $(aws ecr get-login --no-include-email --region us-east-1)"
alias awslogin-prometheus="eval $(aws ecr get-login --no-include-email --region us-east-1 --profile prometheus)"
alias cclip='xclip -selection clipboard'
alias vimrc='vim ~/.vimrc'
alias tmuxrc='vim ~/.tmux.conf.local'
alias refresh="source ~/.zshrc"
alias sizes="du -a -h --max-depth=1 | sort -hr"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment