Skip to content

Instantly share code, notes, and snippets.

@jonnyjava
Last active May 20, 2019 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonnyjava/67fa1ce8bea05dceeba04d59a80017c4 to your computer and use it in GitHub Desktop.
Save jonnyjava/67fa1ce8bea05dceeba04d59a80017c4 to your computer and use it in GitHub Desktop.
Everyday aliases
alias 1pass='wine ~/.wine/drive_c/Program\ Files\ \(x86\)/1Password\ 4/1Password.exe'
alias apalogs='cd && tail -f /var/log/apache2/error.log'
alias checkstyle='rubocop -a -f fuubar ; scss-lint'
alias gl='git lg'
alias openmysql='mysql --defaults-file=~/.local_db_conf'
alias quality_test='checkstyle ; rake traceroute ; rubycritic'
alias testall='bin/rspec'
alias update_me_motherfucker='git checkout master && git pull origin master && bundle install && rake db:migrate'
-----------------------------
.local_db_conf
[client]
host=localhost
user=MY_MYSQL_ROOT_USER
password='MY_MYSQL_PASSWORD'
------------------------------------------------------------
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working tree clean" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ '
--------------------------------------------
update_branch() {
if [ -z "$1" ];then
git checkout master && git fetch && git pull origin master && bundle install && rake db:migrate
else
git checkout "$1" && git fetch && git pull origin "$1" && bundle install && rake db:migrate
fi
}
-----------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment