Skip to content

Instantly share code, notes, and snippets.

@plus3x
Last active September 29, 2022 07:15
Show Gist options
  • Save plus3x/987d95dd2bee659b868bcd31f5a3cc25 to your computer and use it in GitHub Desktop.
Save plus3x/987d95dd2bee659b868bcd31f5a3cc25 to your computer and use it in GitHub Desktop.
My aliases
#!/bin/bash
alias ln="ln -v"
alias mkdir="mkdir -p"
alias ...="../.."
alias l="ls"
alias ll="ls -al"
alias lh="ls -Alh"
# alias -g G="| grep"
# alias -g M="| less"
# alias -g L="| wc -l"
# alias -g ONE="| awk '{ print \$1}'"
alias e="$EDITOR"
alias v="$VISUAL"
# Git
# alias gci="git pull --rebase && rake && git push"
# alias gitinspect="~/Downloads/gitinspector-0.3.2/gitinspector/gitinspector.py"
# alias gitreport="gitinspect -rTF html"
# Diff with master(only added and modified)
alias git_diff_master="git diff master --diff-filter=AM --name-only"
# Rails
alias migrate="bin/rake db:migrate db:rollback && bin/rake db:migrate"
alias m="migrate"
# Heroku
# alias export_env_from_heroku="for s in `heroku config -s`; do export $s; done"
# Ruby
# Bundler
alias b="bundle"
# Rake run
alias rk="bin/rake"
# Tests and Specs
# alias t="ruby -I test"
# Rubocop run
alias rb="rubocop -P"
# RSpec run
alias s="bin/rspec"
# Rubocop agains diff with master
alias rb_master="git_diff_master | grep -e '\(\(\.\(rb\|jbuilder\)$\)\|\(Gemfile$\)\|Rakefile\)' | xargs -n1000 rubocop -P"
# RSpec agains diff with master
alias s_master="git_diff_master | grep _spec | xargs -n1000 bin/rspec"
# RSpec agains diff with current HEAD
alias s_current="git diff --diff-filter=AM --name-only HEAD... | grep _spec | xargs -n1000 bin/rspec"
# Reek agains diff with master
alias reek_master="git_diff_master | xargs -n1000 bundle exec reek"
# Brakeman agains diff with master(Short brakeman report)
alias brakeman_master="git_diff_master | xargs -n1000 bundle exec brakeman -qf tabs -p . --only-files"
# Reek, Rubocop, RSpec and Brakeman agains diff with master
alias rk_master="reek_master ; rb_master ; s_master ; brakeman_master"
# Include custom aliases
[[ -f ~/.aliases.local ]] && source ~/.aliases.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment