Skip to content

Instantly share code, notes, and snippets.

View elianderson's full-sized avatar

Eli Anderson elianderson

View GitHub Profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
PS1='\[\e[1;34m\]@\[\e[m\] \[\e[0;32m\]:\W\[\e[m\]\[\e[1;32m\] \[\033[1;31m\]$(parse_git_branch)\[\033[01;34m\] \$\[\e[m\] \[\e[1;37m\]'
PATH="/opt/local/bin:$PATH"
alias ls="ls -G"
alias mysql="/usr/local/mysql/bin/mysql"
alias mate='open -a TextMate.app'
alias sub='open -a "Sublime Text 2"'
@elianderson
elianderson / gist:1045167
Created June 24, 2011 16:38
Run a ruby based app in a sub dir
Create your amazing app, this example is for a standard apache server
We want our app running at test.com/example
our app is here /var/www/apps/example/
in /etc/apache2/sites-available/default (default-ssl also for https) do
RackBaseURI /example
<Directory /var/www/apps/example/public>
@elianderson
elianderson / load sinatra in irb
Created June 22, 2011 16:29
Ruby Quick Finds
irb -r < path to app.rb >
@elianderson
elianderson / the fix
Created June 21, 2011 16:42
WEBrick Port taken
Ever get :
WARN TCPServer Error: Address already in use - bind(2)
The Fix (mac and linux):
$: lsof|grep 3000 <-- port number
this will give you a line starting with: