Skip to content

Instantly share code, notes, and snippets.

@gabrielfalcao
Created March 1, 2011 04:49
Show Gist options
  • Save gabrielfalcao/848630 to your computer and use it in GitHub Desktop.
Save gabrielfalcao/848630 to your computer and use it in GitHub Desktop.
badass bash profile
# -*- coding: utf-8 -*-
# <bash_profile - for mac>
# Copyright (C) <2011> Gabriel Falcão <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
export TERM="xterm-color"
alias ls="ls -G"
alias egrep="egrep --colour"
alias grep="egrep --colour"
export PYTHONPATH=$PYTHONPATH:$HOME/usr/python-libs:/Library/Python/2.6/site-packages/:$HOME/globo.com/publicacao-core/publicacao/:$HOME/Projetos/lettuce
export PATH=$HOME/usr/bin:/usr/local/sbin:$HOME/.node_libraries/.npm:$PATH:/usr/local/mysql/bin:/usr/local/bin
export GEM_HOME='/usr/local/Cellar/gems/1.8'
export BASH_COMPLETION_PATH=$HOME/usr/bash_completion.d
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
for completion in `ls $BASH_COMPLETION_PATH`
do
. $BASH_COMPLETION_PATH/$completion
done
alias nose="nosetests --verbosity=2 -s"
alias gvim="/Applications/MacVim.app/Contents/MacOS/Vim -g"
mydump () {
mysqldump --add-drop-table --compact --quick -u root -B $1
}
export HISTFILESIZE=3000
export HISTCONTROL=ignoredups
alias hist='history | grep $1'
export NODE_PATH=/usr/local/lib/node
export VIRTUOSO_HOME=/usr/local/Cellar/virtuoso/6.1.2
harvest () {
python manage.py harvest $@
}
unit () {
python manage.py test unit
}
func () {
python manage.py test functional
}
intg () {
python manage.py test integration
}
limpar_virtuoso_com_a_porra_toda () {
cap LOADER_OPTS="-CGrt" ambiente:local base:tudo produto:tudo action:deploylocal
}
fast_runserver () {
gunicorn_django --debug --preload -b 0.0.0.0:8000 --keep-alive=30 -w 4
}
stripstring () {
sed 's/^[ ]*//g' | sed 's/[ ]*$//g'
}
gitroot () {
git rev-parse --git-dir | sed 's/\.git$//g' | stripstring
}
cwgd () {
# if [ `wc -c $(gitroot)` > 0 ]; then
# basename $(gitroot)
# fi;
printf ""
}
total_of_commits () {
git log --oneline | wc -l | awk '{ print $1 }'
}
branch_name () {
git status | head -1 | sed 's/[#] On branch //g'
}
gitps1 () {
(test -e scripts/git-helpers)
if [ $? == 0 ]; then
source scripts/git-helpers
fi
(test -e scripts/qa-helpers)
if [ $? == 0 ]; then
source scripts/qa-helpers
fi
(git branch 2>&1 > /dev/null) 2>&1 > /dev/null
if [ $? == 0 ] && [ $(basename `pwd`) != '.git' ]; then
printf "$USER\033[1;37m\033[1;33m\033[1;37m@\033[1;33m$(cwgd)$(branch_name)\033[1;37m"
else
printf "$USER@$(hostname)"
fi
}
PS1='\[\033[01;32m\]$(gitps1)\[\033[01;34m\] \w \$\[\033[00m\] '
get_put_io_links () {
curl -s http://www.fgsexy.com/blog/ | egrep 'http[:][/][/]hotfile[^ ]*[.]html' | mate
}
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment