Skip to content

Instantly share code, notes, and snippets.

@damienstanton
Created May 24, 2016 22:14
Show Gist options
  • Save damienstanton/f0a3e7cf101686b017dab10d6cf1bd3b to your computer and use it in GitHub Desktop.
Save damienstanton/f0a3e7cf101686b017dab10d6cf1bd3b to your computer and use it in GitHub Desktop.
##########
# +----+ #
# | DS | #
# +----+ #
##########
# set vi mode
set -o vi
# set colors correctly on OS X
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# executable pip packages
export PATH="Library/Python/2.7/bin:$PATH"
# give `less` syntax highlighting
alias skim="/usr/local/bin/src-hilite-lesspipe.sh %s"
# ensure misc Brew-installed executables are found
export PATH="/usr/local/sbin:$PATH"
# Scala compiler
export PATH="/usr/local/bin/scalac:$PATH"
# conscript
export PATH="/Users/damien/bin:$PATH"
# added by the Heroku Toolbelt (auto-generated)
export PATH="/usr/local/heroku/bin:$PATH"
# add matlab to path
export PATH="/Applications/MATLAB_R2015a.app/bin:$PATH"
# add local couchbase cli tools
export PATH="/Applications/Couchbase\ Server.app/Contents/Resources/couchbase-core/bin:$PATH"
# add local sbin (not sure why this was missing)
export PATH="/usr/local/sbin:$PATH"
# Ionic / Android SDK
export ANDROID_HOME="/Users/damien/android-sdk-macosx/platforms/android-23"
export PATH="/Users/damien/android-sdk-macosx/tools:$PATH"
# Groovy
export GROOVY_HOME=/usr/local/opt/groovy/libexec
#######
# GSA #
#######
export SOLR_HOME="/Users/damien/solr-5.2.1"
export SOLR_APPS="/Users/damien/solr-5.2.1/server/solr-webapp/webapp"
# AMD Core Math
export ACML_FMA=0
export LD_LIBRARY_PATH=/opt/acml5.3.1/ifort64/lib:$LD_LIBRARY_PATH
# otherwise set for C++
export CFLAGS="-stdlib=libc++"
export MACOSX_DEPLOYMENT_TARGET=10.10
export CC="/usr/bin/gcc"
# provide downstream mono access in Brew
export MONO_GAC_PREFIX="/usr/local"
# glorious haskell
export GHC_DOT_APP="/Applications/ghc-7.8.4.app"
if [ -d "$GHC_DOT_APP" ]; then
export PATH="${HOME}/.cabal/bin:${GHC_DOT_APP}/Contents/bin:${PATH}"
fi
# Cabal
export PATH="~/.cabal/bin:$PATH"
# Spark
export SPARK_HOME="/Users/damien/spark-1.6.1-bin-hadoop2.6"
export PYSPARK_PYTHON="/usr/local/bin/python3"
export PYSPARK_DRIVER_PYTHON=jupyter
export PYSPARK_DRIVER_PYTHON_OPTS='notebook'
export PATH="/Users/damien/spark-1.6.1-bin-hadoop2.6/bin:$PATH"
# Golang
export GOPATH="/Users/damien/go"
export PATH="/Users/damien/go/bin:$PATH"
function godev() {
cd $GOPATH/src/github.com/$1
}
# aliases
alias vi="vim"
alias c="clear;ls -Ctrl"
alias ll="clear;ls -C"
alias x="clear;ls -C"
alias ct="clear;tree"
alias sync="rsync -PRazh"
alias tree="tree -I "env""
alias untar="tar -xvf"
alias guntar="tar -xzf"
alias bn="clear;babel-node"
alias serve="python -m http.server"
alias repl="clear;lein repl"
alias rff="rm -rf"
function checkfilesize() {
du -h $1 | tail -n 1
}
alias sizeof=checkfilesize
function testall() {
go test ./... -cover
}
# fuckin' .pyc files, man
export PYTHONDONTWRITEBYTECODE=1
# -------------
# Prompt Start
# -------------
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "git:${BRANCH}${STAT}"
else
echo ""
fi
}
# get current status of git repo
function parse_git_dirty {
status=`git status 2>&1 | tee`
dirty=`echo -n "${status}" 2> /dev/null | grep "modified:" &> /dev/null; echo "$?"`
untracked=`echo -n "${status}" 2> /dev/null | grep "Untracked files" &> /dev/null; echo "$?"`
ahead=`echo -n "${status}" 2> /dev/null | grep "Your branch is ahead of" &> /dev/null; echo "$?"`
newfile=`echo -n "${status}" 2> /dev/null | grep "new file:" &> /dev/null; echo "$?"`
renamed=`echo -n "${status}" 2> /dev/null | grep "renamed:" &> /dev/null; echo "$?"`
deleted=`echo -n "${status}" 2> /dev/null | grep "deleted:" &> /dev/null; echo "$?"`
bits=''
if [ "${renamed}" == "0" ]; then
bits="⇏${bits}"
fi
if [ "${ahead}" == "0" ]; then
bits="💥${bits}"
fi
if [ "${newfile}" == "0" ]; then
bits="⩲${bits}"
fi
if [ "${untracked}" == "0" ]; then
bits="?${bits}"
fi
if [ "${deleted}" == "0" ]; then
bits="⌦${bits}"
fi
if [ "${dirty}" == "0" ]; then
bits="⚛${bits}"
fi
if [ ! "${bits}" == "" ]; then
echo " ${bits}"
else
echo ""
fi
}
# v1 prompt without hostname
export PS1="\[\e[35m\]\W\[\e[m\] \`parse_git_branch\` ✎ "
# v2 prompt with user and hostname
# export PS1="\[\e[32m\]\u\[\e[m\] at \[\e[36;40m\]\h\[\e[m\] in \[\e[35m\]\W\[\e[m\] \`parse_git_branch\` ✎ "
# ----------
# Prompt End
# ----------
export FILEUPLOAD_U="p3xferdt"
export FILEUPLOAD_P="uA8b@op4#"
# Add GHC 7.10.3 to the PATH, via https://ghcformacosx.github.io/
export GHC_DOT_APP="/Applications/ghc-7.10.3.app"
if [ -d "$GHC_DOT_APP" ]; then
export PATH="${HOME}/.local/bin:${HOME}/.cabal/bin:${GHC_DOT_APP}/Contents/bin:${PATH}"
fi
if [ -e /Users/damien/.nix-profile/etc/profile.d/nix.sh ]; then . /Users/damien/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
# The next line updates PATH for the Google Cloud SDK.
source '/Users/damien/google-cloud-sdk/path.bash.inc'
# The next line enables shell command completion for gcloud.
source '/Users/damien/google-cloud-sdk/completion.bash.inc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment