Skip to content

Instantly share code, notes, and snippets.

@vcokltfre
Created August 6, 2022 19:42
Show Gist options
  • Save vcokltfre/6edd5cbb6fb4d96731fe5fec27b22144 to your computer and use it in GitHub Desktop.
Save vcokltfre/6edd5cbb6fb4d96731fe5fec27b22144 to your computer and use it in GitHub Desktop.
# Utilities for vcokltfre
## Git aliases
alias cmt="git commit -m"
alias gac="git add . && cmt"
alias gca="git add . && git commit --amend --no-edit"
alias gcm="git checkout master"
alias gcb="git checkout -b"
alias gic="git commit -m \"feat: initial commit\" --allow-empty"
alias rmg="rm -rf .git"
alias push="git push"
alias pull="git pull"
## Go aliases & env vars
alias gr="go run main.go"
alias gg="go get"
alias gf="go fmt ./..."
alias gt="go test ./..."
alias gmt="go mod tidy"
alias gmi="go mod init"
alias ga="gmt && gf && gmt"
export GO111MODULE=on
export GOPATH=$HOME/.go
export GOROOT=/usr/local/go
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
## Generic aliases
alias d="cd"
alias c="code ."
alias cr="code -r ."
alias pip="python3 -m pip"
alias python="python3"
alias bl="black . && isort --profile black ."
alias yays="yay -Syu"
alias prs="git init && gic && license && gitignore"
alias ipi="echo $(curl -s ip.vcokltfre.workers.dev)"
## Gitignore generator
declare -A reps
reps[py]=Python
reps[go]=Go
reps[js]=Node
reps[ts]=Node
gitignore() {
rep=$reps[$1]
if [ -z "$rep" ]
then
curl -q -o .gitignore "https://raw.githubusercontent.com/github/gitignore/main/$1.gitignore"
else
curl -q -o .gitignore "https://raw.githubusercontent.com/github/gitignore/main/$rep.gitignore"
fi
}
## License generator
alias license="curl -o LICENSE https://raw.githubusercontent.com/vcokltfre/crosschat/master/LICENSE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment