-
-
Save thomasvds/72492551ed4c8d1dd701d1e61179b0ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export ZSH=/Users/thomasvanderstraeten/.oh-my-zsh | |
ZSH_THEME="agnoster" | |
ZSH_DISABLE_COMPFIX=true | |
plugins=(git bundler osx common-aliases history-substring-search zsh-syntax-highlighting) | |
source $ZSH/oh-my-zsh.sh | |
# ACTIONS | |
alias glean="git fetch && gswp && git-clean-local-branches" | |
alias gst="git status" | |
alias gplm="git pull origin master" | |
alias gswp="git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d" | |
alias unshite="find . -name '*.DS_Store' -type f -delete" | |
alias pkglambda="zip -r ../lambda.zip ./*" | |
alias dev="yarn dev" | |
alias tunnel="yarn dev:tunnel" | |
alias dcu="docker-compose up" | |
alias dcub="docker-compose up --build" | |
alias uuidgen='uuidgen | tr "[:upper:]" "[:lower:]"' | |
# REPOS | |
alias landing="cd ~/code/canyon/landing" | |
alias portal="cd ~/code/canyon/portal" | |
alias chub="cd ~/code/canyon/hub" | |
alias ops="cd ~/code/canyon/legalops" | |
alias cdkb="cd ~/code/canyon/aws-cdk-back" | |
alias cdkf="cd ~/code/canyon/aws-cdk-front" | |
alias sless="cd ~/code/canyon/serverless" | |
gps() { | |
git push origin $(git branch | grep \* | cut -d ' ' -f2-) | |
} | |
gpl() { | |
git pull origin $(git branch | grep \* | cut -d ' ' -f2-) | |
} | |
git-clean-local-branches () { | |
# Remove all local branches for which the remote has been deleted | |
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done | |
} | |
pr() { | |
# Prerequisites: | |
# - brew install hub | |
# - hub browser | |
# Save current branch name | |
CURRENT_BRANCH=$(git branch | grep \* | cut -d ' ' -f2-) | |
# Check out from current branch to new branch | |
git checkout -b $1 | |
# Create empty commit to allow opening a PR | |
git commit --allow-empty -m "Create branch" | |
# Push the new branch and open a PR against the current branch, with branch name as PR title | |
hub pull-request --push --base $CURRENT_BRANCH --message $1 | |
} | |
DEFAULT_USER=$USER | |
prompt_context() { | |
emojis=("โก๏ธ" "๐ฅ" "๐" "๐" "๐" "๐ธ" "๐ต" "๐ฆ" "๐" "๐ป" "๐" "๐ก" "๐" "๐" "๐ฆ" "๐" "๐" "๐ฎ" "๐") | |
RAND_EMOJI_N=$(( $RANDOM % ${#emojis[@]} + 1)) | |
prompt_segment black default "${emojis[$RAND_EMOJI_N]} " | |
} | |
PATH=$PATH:/usr/local/sbin | |
RPS1="SHIP OR DIE" | |
GOPATH=$HOME/go | |
GOBIN=$GOPATH/bin | |
PATH=${PATH}:$GOBIN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment