Skip to content

Instantly share code, notes, and snippets.

@mexelout
Last active March 22, 2021 12:49
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 mexelout/fd6990c2808d284e59885040d5c5d1b2 to your computer and use it in GitHub Desktop.
Save mexelout/fd6990c2808d284e59885040d5c5d1b2 to your computer and use it in GitHub Desktop.
bash
PATH="$HOME/homebrew/bin:$PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# rails
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
# alias
alias vi='vim'
alias ls='ls -G'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias dsstore='sudo find / -name ".DS_Store" -print -exec rm {} ";"'
alias ga='git add'
alias gd='git diff'
alias gdc='gd --cached'
alias gb='git branch'
alias gs='git status -s'
alias gc='git checkout'
alias gps='git push'
alias gpu='git pull'
alias gl='git log'
alias gla='gl --all --graph --date=format:"%y-%m-%d %H:%M" --pretty="%C(cyan)%h %C(green)%d %C(yellow)%an %C(red)%ad %C(reset)%s"'
alias gco='git commit'
alias gst='git stash'
alias tiga='tig --all'
alias be='bundle exec'
alias em='emacs'
# functions
function gbchange() {
gc $(gb | cut -b3- | peco)
}
function gbcurrent() {
echo $(git rev-parse --abbrev-ref HEAD)
}
# new local branch
alias gpsu='gps --set-upstream origin $(gbcurrent)'
function gbgone() {
gb -vv | grep gone | awk '{print $1}'
}
function gbdelete() {
gb -D $(gb | cut -b3- | peco)
}
function gbclean() {
gbgone | xargs git branch -D
}
function already_exec() {
ps aux | grep $1 | grep -v grep
}
function ropen() {
chrome "http://$(lsof -P -i | grep $(cat tmp/pids/server.pid) | awk '{print $9}')/$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment