diff --git a/bash_aliases b/bash_aliases index 565062d..e6e5af2 100644 --- a/bash_aliases +++ b/bash_aliases @@ -2,7 +2,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" @@ -12,7 +12,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; @@ -45,4 +45,39 @@ function cpbr () { } function hidden() { ls -a "$@" | grep '^\.'; } +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 diff --git a/bin/resolv_work.sh b/bin/resolv_work.sh new file mode 100755 index 0000000..e0f309f --- /dev/null +++ b/bin/resolv_work.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +cp /etc/resolv.conf /home/tyrelsouza/prev_resolv.conf + +echo > /etc/resolv.conf +echo "nameserver 10.0.2.22" >> /etc/resolv.conf +echo "search addgene.org" >> /etc/resolv.conf 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 839ef2a..331ecc5 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