Skip to content

Instantly share code, notes, and snippets.

@nickccm1122
Last active July 21, 2019 11:05
Show Gist options
  • Save nickccm1122/ea19e44e254b5844ae840fe7df02c353 to your computer and use it in GitHub Desktop.
Save nickccm1122/ea19e44e254b5844ae840fe7df02c353 to your computer and use it in GitHub Desktop.
My zsh aliases setting
#!/usr/bin/sh
# check if the alias exists
# TODO: need to excape string input in the 2nd arg
setalias() {
if alias $1 2>/dev/null; then
cmd="$1='$2'"
eval "alias $cmd"
else
echo "$1 has been set alias..."
fi
}
# switch to personal github
alias use-nickccm-gh='rm -f ~/.ssh/github_rsa &&
rm -f ~/.gist &&
rm -f ~/.gitsomeconfig &&
ln -s ~/.ssh/keys/personal/github_rsa ~/.ssh/github_rsa &&
ln -s ~/.gist-tokens/nickccm ~/.gist &&
ln -s ~/.gitsomeconfig-nickccm ~/.gitsomeconfig'
# check if yor are secured
alias amimullvad="curl https://am.i.mullvad.net/json | jq"
# group task when sign off from work
alias logoff="mackup backup && todoist sync"
alias pfzf="fzf --preview 'bat {}'"
## Golang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment