Skip to content

Instantly share code, notes, and snippets.

@ajmorris
Created January 13, 2009 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajmorris/46503 to your computer and use it in GitHub Desktop.
Save ajmorris/46503 to your computer and use it in GitHub Desktop.
### .bash_profile
export EDITOR='mate -w'
export VISUAL='mate -w'
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local RED="\[\033[0;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local BLUE="\[\033[0;34m\]"
local LIGHT_BLUE="\[\033[1;34m\]"
local WHITE="\[\033[1;37m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
local LIGHT_PURPLE="\[\033[1;35m\]"
local PURPLE="\[\033[0;35m\]"
local LIGHT_CYAN="\[\033[1;36m\]"
local CYAN="\[\033[0;36m\]"
case $TERM in
xterm*)
TITLEBAR='\[\033]0;\u@\h:\w\007\]'
;;
*)
TITLEBAR=""
;;
esac
PS1="${TITLEBAR}\
$CYAN[$PURPLE\u$LIGHT_CYAN@$PURPLE\h:$LIGHT_CYAN\w$GREEN\$(parse_git_branch)$CYAN]\
$CYAN\$ "
PS2='> '
PS4='+ '
}
proml
#export PS1='[\e[36m\u\e[0m\e[32m@\h\e[0m \e[33m\W\e[31m$(__git_ps1 " (%s)")\e[0m]
#> '
# Use this in any RAILS_ROOT dir. That restart.txt file tells mod_rails to restart this app.
# You'll want to do this when (for example) you install a new plugin.
alias restart_rails='touch tmp/restart.txt'
# By default, your app's error log now goes here. Unless you configure your apps otherwise,
# it's helpful to have an alias to take you to your error log quickly.
alias apache_logs='cd /private/var/log/apache2/'
# You'll be adding to your vhosts configuration everytime you introduce a new Rails app.
# Might as well make it a shortcut
alias vhosts='sudo vi /private/etc/apache2/extra/httpd-vhosts.conf'
# Dito with hosts
alias hosts='sudo vi /etc/hosts'
# You'll need to restart apache whenever you make a change to vhosts.
# You can also click System Preference->Sharing->Web Sharing, but this is quicker.
alias apache_restart='sudo apachectl restart'
# Starts tailing the log file.
# You need to be in the RAILS_ROOT dir for this to work.
alias loggerd='tail -f log/development.log'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment