From 6b5a4eaca4f99336c89af53a3bc6e5386e2afe00 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Mon, 24 Apr 2017 10:45:50 -0400 Subject: [PATCH] misc changes --- bash_aliases | 4 ++-- gitconfig | 5 +++++ pythonstartup.py | 4 ++++ zshrc | 36 +++++++++++++++++++++++++++++++++++- 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/bash_aliases b/bash_aliases index ad5d343..d4d1e4c 100644 --- a/bash_aliases +++ b/bash_aliases @@ -1,7 +1,7 @@ export HOMEBREW_GITHUB_API_TOKEN="caf4cd85c6eb6ddcf006d4571d4a294c0b0592e4" alias ag='\ag --pager="less"' alias cg='cd "$(git rev-parse --show-toplevel)"' -alias fuck='eval $(thefuck $(fc -ln -1)); history -r' +alias fuck='eval $(thefuck $(fc -ln -1)); \history -r' alias g='git' alias pdb="python -m pdb" alias ppjson="python -m json.tool" @@ -11,7 +11,7 @@ alias adocs='cd $ADDGENE_CORE_REPO_DIR/docs && make html && open $ADDGENE_CORE_R alias deploy_all="fab -R silver-web deploy:master && fab -R gold-web deploy:master && fab -R jupyter fab -R jupyter deploy_jupyter && fab --parallel avail_staging_hosts deploy:master" alias deploy_all_migration="fab -R silver-web deploy:master,1 && fab -R gold-web deploy:master,1 && fab -R jupyter deploy_jupyter & fab --parallel avail_staging_hosts deploy:master,1" alias aenv='env | sort | grep ADDGENE' -alias sl='source local.env' +alias sl="source local.env.$(basename $SHELL)" if [[ $OSTYPE == darwin* ]]; then alias rm=trash; diff --git a/gitconfig b/gitconfig index c349220..a9c3f11 100644 --- a/gitconfig +++ b/gitconfig @@ -11,11 +11,15 @@ interactive = auto [push] default = current +[fetch] + prune = true [format] pretty = format:%C(auto)%h %C(green)%G? %C(red)%<(15,trunc)%aN %C(cyan)%<(15,trunc)%ar %C(white)%<(60,trunc)%s %C(auto)%d [alias] # show all these aliases alias = "!git config -l | grep alias | cut -c 7-" + # delete all merged branches + bc = !git branch --merged master | grep -v master | xargs git branch -d # Way more information on git log ll = log --stat --abbrev-commit # Show files modified per commit @@ -37,6 +41,7 @@ pr = !"pr() { git fetch origin pull/$1/head:pr-$1; git checkout pr-$1; }; pr" # Diff so fancy! dsf = "!f() { [ \"$GIT_PREFIX\" != \"\" ] && cd "$GIT_PREFIX"; git diff --color $@ | diff-so-fancy | less --tabs=4 -RFX; }; f" + scrum = log --since='1 day ago' --author='Tyrel Souza' --oneline [filter "lfs"] clean = git-lfs clean %f smudge = git-lfs smudge %f diff --git a/pythonstartup.py b/pythonstartup.py index ed6f9f8..e51c889 100644 --- a/pythonstartup.py +++ b/pythonstartup.py @@ -1,3 +1,7 @@ import sys import pprint sys.displayhook = pprint.pprint +try: + import pdir +except ImportError: + pass diff --git a/zshrc b/zshrc index 6df00a4..13c3211 100644 --- a/zshrc +++ b/zshrc @@ -3,7 +3,6 @@ plugins=(git sudo github django python pip cp vagrant virtualenv nmap rvm) if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then ZSH_THEME="soliah" else - ZSH_THEME="candy" ZSH_THEME="tyrel" export VIRTUAL_ENV_DISABLE_PROMPT=1 fi @@ -92,3 +91,38 @@ function adtest () { function dots(){ cd $(dirname `readlink ~/.zshrc`) } +alias shrug="echo -n '¯\_(ツ)_/¯' | pbcopy" + +function h () { + if [ -z "$*" ] + then + history + else + history | egrep "$@" + fi +} + +if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then + export PS1="$PS1" +fi +alias stabbats='sudo killall VDCAssistant && open https://appear.in/stab-bats' + + +function GitHub() +{ + git_url=`git config --get remote.origin.url` + if [[ $git_url == https://github* ]]; + then + url=${git_url%.git} + else + if [[ $git_url == git@github.com* ]] + then + url="https://github.com/${${git_url:15}%.git}" + else + echo "ERROR: Remote origin is invalid" && return false; + fi + fi + open $url +} + +alias github=GitHub