Skip to content

Instantly share code, notes, and snippets.

@ManWithBear
Last active November 29, 2019 23:14
Show Gist options
  • Save ManWithBear/1991fcb778c2abb1d8ebec9d18138b4a to your computer and use it in GitHub Desktop.
Save ManWithBear/1991fcb778c2abb1d8ebec9d18138b4a to your computer and use it in GitHub Desktop.
My work bash_profile
source ~/.profile
source ~/.git-completion.bash
source ~/.git-prompt.sh
source ~/tools/arcanist/resources/shell/bash-completion
export PATH="$PATH:$HOME/tools/arcanist/bin/"
export EDITOR="/usr/bin/vim"
PS1='\[\e[31m\][\[\e[0m\]\W$(__git_ps1 " (\[\e[36m\]%s\[\e[0m\])")\[\e[31m\]]\[\e[0m\]\$ '
alias be='bundle exec'
alias ll='ls -al'
alias gti='git'
# If right now in arc path branch, checkout previous branch and delete this one
function finishReview()
{
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ $BRANCH == arcpatch* ]];
then
git co -
git br -D "$BRANCH"
fi
}
function arcd()
{
git lfs push origin $(git rev-parse --abbrev-ref HEAD) && arc diff "$@"
}
function gittmp()
{
git add .
git ci -m "gittmp"
}
function gituntmp()
{
local msg=$(git log -1 --pretty=%B)
if [[ $msg == "gittmp" ]];
then
git reset --soft HEAD~
else
echo "Last commit message different from \"gittmp\". Do nothing. ($msg)"
fi
}
function tmpfolder()
{
NAME=$(cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-f0-9' | head -c 20)
mkdir -p /tmp/tmpfolder/$NAME
pushd /tmp/tmpfolder/$NAME
}
eval $(thefuck --alias)
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
@ManWithBear
Copy link
Author

ManWithBear commented Aug 17, 2019

PS1 for zsh:

setopt PROMPT_SUBST ; PS1='%F{red}[%f%1~%F{cyan}$(__git_ps1 " (%s)")%f%F{red}]%f\$ '

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment