Skip to content

Instantly share code, notes, and snippets.

@shannonwells
Last active January 12, 2019 00:10
Show Gist options
  • Save shannonwells/23113ee3b10b283daaed to your computer and use it in GitHub Desktop.
Save shannonwells/23113ee3b10b283daaed to your computer and use it in GitHub Desktop.
bash profile
cat ~/.bash_profile
export EDITOR=vim
export CLICOLOR=1
export PS1="\[\033[34m\]\h:\W \[\033[35m\]\$(parse_git_branch)\[\033[00m\]\$(git config user.initials)$\[\033[00m\] "
export SUDO_PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[0m\]'
export HISTCONTROL=ignoredups;
shopt -s histappend;
export PROMPT_COMMAND='echo -ne "\033]0;${USER}: ${PWD}\007"'
source $SECRET_VARIABLES_FILE
### FUNCTIONS
function feature() { git checkout feature/$1; }
function fstart() { git flow feature start $1; }
function gco() { git checkout $1; }
function routes() { rake routes | grep $1; }
# GO
function gob() { go run ./build/*.go $1; }
# This function is used in several aliases below.
function parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /'; }
export -f parse_git_branch
for file in "$HOME/.bash_includes/*" ; do source $file ; done
#### ALIASES
# General
alias view='vim -R'
alias ll='ls -lhA'
alias lsd='ls .??*'
# GIT
alias gitrm='git rm $(git ls-files --deleted)'
alias gfp='git fetch --prune'
alias gclean='git branch --merged | grep -v "\*" | xargs -n 1 git branch -d'
alias gmop='git checkout development && pullor'
alias pullor='git pull origin `parse_git_branch`'
alias pullreb='git pull --rebase origin `parse_git_branch`'
alias pushor='git push origin `parse_git_branch`'
alias pushfor='git push --force-with-lease origin `parse_git_branch`'
# HEROKU
alias hltp="heroku logs -t -a $1"
alias hlts="heroku logs -t -a $1"
alias hrcp="heroku run rails c -a $1"
alias hrcs="heroku run rails c -a $1"
# RAILS/FOREMAN
alias anno='annotate --exclude tests,fixtures,factories,serializers'
alias drc='dotenv rails c'
alias fs='foreman start'
alias rs='dotenv rspec'
alias be='bundle exec'
# Other
if [ -f ~/.config/exercism/exercism_completion.bash ]; then
source ~/.config/exercism/exercism_completion.bash
fi
alias sudo="sudo ";
alias gem='ruby -e "raise \"SUDO GEM DETECTED. Unalias gem at your own risk\" if ENV[\"USER\"] == \"root\"" && gem';
alias py3="python3"
alias gf="go-filecoin"
export PATH=${PATH}:~/.rbenv/bin
eval "$(ssh-agent -s)"
eval "$(rbenv init -)"
source ${HOME}/torch/install/bin/torch-activate
source ${HOME}/.cargo/env
export PATH="/usr/local/opt/bin:/usr/local/sbin:/usr/local/opt/postgresql/bin:$HOME/bin:$GOPATH/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment