Skip to content

Instantly share code, notes, and snippets.

@sublimecoder
Last active January 8, 2018 03:41
Show Gist options
  • Save sublimecoder/6f6110cc3fa5c8370248d669aa91d0c1 to your computer and use it in GitHub Desktop.
Save sublimecoder/6f6110cc3fa5c8370248d669aa91d0c1 to your computer and use it in GitHub Desktop.
alias todo='$EDITOR ~/.todo'
alias gclean="git branch | grep -v "master" | xargs git branch -D"
# Handle the fact that this file will be used with multiple OSs
platform=`uname`
if [[ $platform == 'Linux' ]]; then
alias a='ls -lrth --color'
elif [[ $platform == 'Darwin' ]]; then
alias a='ls -lrthG'
fi
alias -g G='| grep'
alias -g L='| less'
alias -g M='| more'
alias aliases='vim ~/.aliases.local'
alias amend="git commit --amend"
alias bdp='production deploy'
alias bds='staging deploy'
alias be='bundle exec'
alias bi='bundle install -j 8'
alias br='bin/rspec'
alias bsf='bin/rspec spec/features'
alias bu='bundle update'
alias bunbang='bundle install && !!'
alias c='cd'
alias d='cd ~/dotfiles'
alias dbprep='rdm && rdtp'
alias drop='cd ~/Dropbox'
alias fs='bundle install && foreman start'
alias gad='git add --all .'
alias gag='git add . && git commit --amend --no-edit && git push -f'
alias gbc='gdc'
alias gca='git commit -a'
alias gcaa='git commit -a --amend -C HEAD'
alias gcl='git clone'
alias gcm="git commit -m"
alias gco='git checkout'
alias gd='git diff'
alias gdc='git diff --cached'
alias gdm='git diff master'
alias gg='git lg'
alias gom-done="git-on-master && gpf && git-done"
alias gp='git push'
alias gph='git push heroku'
alias gpr='git pull --rebase'
alias gpush='echo "Use gp!" && git push'
alias grc='git rebase --continue'
alias gs='git show'
alias gurad='guard'
alias h='sync'
alias herkou='heroku'
alias hpr='hub pull-request'
alias hpush='git push heroku'
alias irb='irb --readline -r irb/completion'
alias killruby='killall -9 ruby'
alias killrudy='killruby'
alias m='git checkout master'
alias mastre='master'
alias newscreen="tmux"
alias pc='production-console'
alias prepdb='dbprep'
alias rc='bin/rails console'
alias rdm="bin/rake db:migrate"
alias rdtp="bin/rake db:test:prepare RAILS_ENV=test"
alias reguard='killall -9 ruby ; guard'
alias remigrate='rake db:migrate && rake db:migrate:redo && rake db:schema:dump && rake db:test:prepare'
alias remore='!! | more'
alias repush="gpr && git push"
alias rerake='!! && rake'
alias restart_apache="sudo /etc/init.d/apache2 restart"
alias restart_postgres="stoppostgres && startpostgres"
alias retag='ctags -R --exclude=.svn --exclude=.git --exclude=log --exclude=tmp *'
alias review="git diff master"
alias rs='bundle check && rails server -p 3000'
alias safepush='git pull --rebase && bundle install && rdm && rake && git push'
alias sc='staging-console'
alias shpush='rake && hpush'
alias so='source ~/.aliases'
alias sp='safepush'
alias squash='git rebase -i master'
alias ss='spring stop'
alias stage='git push staging head:master && staging open'
alias startpostgres='pg_ctl -D /usr/local/var/postgres9.4 -l /usr/local/var/postgres9.4/server.log start'
alias startredis='redis-server /usr/local/etc/redis.conf &'
alias stoppostgres='pg_ctl -D /usr/local/var/postgres9.4 -l /usr/local/var/postgres9.4/server.log stop'
alias sync='git add -u . && git commit -m "Minor changes. Commit message skipped." && repush'
alias tail-logs='heroku logs -t'
alias track='git checkout -t'
alias trs='tmux rename-session'
alias u='cd ..'
# Heroku staging
alias staging-console='heroku run console --remote staging'
alias staging-tail='heroku logs --tail --remote staging'
# Heroku production
alias production-console='heroku run console --remote production'
alias production-tail='heroku logs --tail --remote production'
# # Heroku databases
alias db-pull-staging='development restore staging'
alias db-pull-production='development restore production'
alias db-copy-production-to-staging='staging restore production'
# Elixir Aliases
alias i='iex'
alias ips='iex -S mix phx.server'
alias ism='iex -S mix'
alias m='mix'
alias mab='mix archive.build'
alias mai='mix archive.install'
alias mat='mix app.tree'
alias mc='mix compile'
alias mcv='mix compile --verbose'
alias mcl='mix clean'
alias mdl='mix dialyzer'
alias mdlp='mix dialyzer --plt'
alias mcr='mix credo'
alias mcrs='mix credo --strict'
alias mcx='mix compile.xref'
alias mdc='mix deps.compile'
alias mdg='mix deps.get'
alias mdgc='mix do deps.get, deps.compile'
alias mdu='mix deps.update'
alias mdt='mix deps.tree'
alias mdua='mix deps.update --all'
alias mdun='mix deps.unlock'
alias mduu='mix deps.unlock --unused'
alias meb='mix escript.build'
alias mec='mix ecto.create'
alias mecm='mix do ecto.create, ecto.migrate'
alias med='mix ecto.drop'
alias mem='mix ecto.migrate'
alias megm='mix ecto.gen.migration'
alias merb='mix ecto.rollback'
alias mers='mix ecto.reset'
alias mes='mix ecto.setup'
alias mho='mix hex.outdated'
alias mlh='mix local.hex'
alias mn='mix new'
alias mns='mix new --sup'
alias mpgc='mix phx.gen.channel'
alias mpgh='mix phx.gen.html'
alias mpgj='mix phx.gen.json'
alias mpgm='mix phx.gen.model'
alias mpgs='mix phx.gen.secret'
alias mpn='mix phx.new'
alias mpr='mix phx.routes'
alias mps='mix phx.server'
alias mr='mix run'
alias mrnh='mix run --no-halt'
alias mrl='mix release'
alias mt='mix test'
alias mts='mix test --stale'
alias mtw='mix test.watch'
alias mx='mix xref'
# Heroku
alias hri='heroku run "POOL_SIZE=2 iex -S mix"'
alias hrmem='heroku run "POOL_SIZE=2 mix ecto.migrate"'
alias hrmes='heroku run "POOL_SIZE=2 mix run priv/repo/seeds.exs"'
mncd() {
arg="$*"
mix new "$arg";cd "$arg";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment