Skip to content

Instantly share code, notes, and snippets.

@djGrill
Last active May 10, 2024 04:13
Show Gist options
  • Save djGrill/64b2dedac8c119e1e149 to your computer and use it in GitHub Desktop.
Save djGrill/64b2dedac8c119e1e149 to your computer and use it in GitHub Desktop.
Zsh profile
# terminal customs
export BUNDLER_EDITOR=/usr/local/bin/code
export CLICOLOR=1
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"
# history
export HISTCONTROL=erasedups
export HISTSIZE=100000
# fixes Postgre failure
export PGHOST=localhost
# custom commands
alias dc="docker-compose"
alias foremanlocal="foreman start -f Procfile_local -p 3000"
alias rmrf="rm -rf"
alias sc="screen"
alias scls="screen -ls"
alias scr="screen -r"
alias tf="terraform"
alias tfa="terraform apply"
alias tfaro="terraform apply -refresh-only"
alias tff="terraform fmt -recursive"
alias tfpo="terraform plan -out"
# bundler
alias be="bundle exec"
alias bi="bundle install"
alias bu="bundle update"
# rails
alias brbr="bundle exec rubocop -A; bundle exec rspec"
alias rac="bundle exec rails c"
alias ract="bundle exec rails c test"
alias rad="bundle exec rails d"
alias rag="bundle exec rails g"
alias ras="bundle exec rails s"
alias rkcreate="be rails db:create"
alias rkdrop="be rails db:drop"
alias rkfull="be rails db:drop db:create db:migrate"
alias rkmigrate="be rails db:migrate"
alias rkrollback="be rails db:rollback"
alias rkseed="be rails db:seed"
alias rktestload="be rails db:test:load"
alias rktestprepare="be rails db:test:prepare"
alias rktestpurge="be rails db:test:purge"
# rspec
alias rnf="rspec --next-failure"
alias rof="rspec --only-failures"
# heroku
alias condev="heroku console --remote dev"
alias conprod="heroku console --remote production"
alias constag="heroku console --remote staging"
alias pgcaptureprod="heroku pg:backups capture --remote production"
alias pgcapturestag="heroku pg:backups capture --remote staging"
alias pgdownloadcurrentprod="pgcaptureprod; pgdownloadprod"
alias pgdownloadcurrentstag="pgcapturestag; pgdownloadstag"
alias pgdownloadprod="curl -o latest-production.dump \`heroku pg:backups public-url --remote production\`"
alias pgdownloadstag="curl -o latest-staging.dump \`heroku pg:backups public-url --remote staging\`"
alias pgrestore="pg_restore --verbose --clean --no-acl --no-owner -h localhost -U djGrill -d"
# git
alias g=git
alias ga="git add --all"
alias gau="git add -u :/"
alias gb="git branch"
alias gba="git branch -a"
alias gbac="git branch -a --contains"
alias gbd="git branch -d"
alias gbD="git branch -D"
alias gbm="git branch -m"
alias gbrd="git branch -rd"
alias gc="git commit"
alias gca="git commit -a"
alias gcaam="git commit -a --amend"
alias gcam="git commit --amend"
alias gcamne="git commit --amend --no-edit"
alias gcm="git commit -m"
alias gco-="git checkout --"
alias gco="git checkout"
alias gcob="git checkout -b"
alias gcod="git checkout dev"
alias gcom="git checkout main"
alias gcp="git cherry-pick"
alias gd="git diff"
alias gds="git diff --staged"
alias gfo="git fetch origin"
alias gl="git log --graph --all --format=format:'%C(red)%h%C(reset)%C(bold cyan)%d%C(reset)'' %C(white)%s%C(reset)' --abbrev-commit"
alias glf="git ls-files"
alias glong="git log --graph --all --format=format:'%C(red)%h%C(reset)%C(bold cyan)%d%C(reset)'' %C(white)%s%C(reset) %C(yellow)%an, %ar' --abbrev-commit"
alias gm="git merge"
alias gmnff="git merge --no-ff"
alias gp="git push"
alias gpdo="git push -d origin"
alias gpf="git push -f"
alias gpfg="git push -f github"
alias gpfh="git push -f heroku"
alias gpfo="git push -f origin"
alias gpfsd="git push -f staging dev:main"
alias gpfsm="git push -f staging main"
alias gph="git push heroku"
alias gphm="git push heroku main"
alias gpo="git push origin"
alias gpod="git push origin --delete"
alias gpom="git push origin main"
alias gppm="git push production main"
alias gpr="git pull --rebase"
alias gprg="git pull --rebase github"
alias gprgm="git pull --rebase github main"
alias gpro="git pull --rebase origin"
alias gprod="git pull --rebase origin dev"
alias gprom="git pull --rebase origin main"
alias gpsd="git push staging dev:main"
alias gpsm="git push staging main"
alias gpt="git push --tags"
alias gri="git rebase -i"
alias grm="git rebase main"
alias grm="git rm"
alias grmr="git rm -r"
alias grpo="git remote prune origin"
alias grps="git remote prune staging"
alias grs="git restore --staged"
alias gru="git remote update"
alias grv="git remote -v"
alias gs="git stash"
alias gsa="git stash apply"
alias gsh="git show"
alias gsl="git stash list"
alias gsp="git stash pop"
alias gss="git stash save"
alias gst="git status"
alias gsu="git submodule update"
alias gsuno="git status -suno"
alias gt="git tag"
alias gta="git tag -a"
alias gtd="git tag -d"
alias guia="git update-index --again"
alias gupdate="gru;grpo;gprom"
alias gupdatedev="gru;grpo;gprod"
alias nrl="npm run lint"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment