Skip to content

Instantly share code, notes, and snippets.

@tjogin
tjogin / colors.sh
Created June 8, 2011 17:30
Bash colors
DULL=0
BRIGHT=1
FG_BLACK=30
FG_RED=31
FG_GREEN=32
FG_YELLOW=33
FG_BLUE=34
FG_VIOLET=35
FG_CYAN=36
@tjogin
tjogin / .bash_profile
Created June 8, 2011 17:30
.bash_profile
source ~/.bashrc
source ~/.git-completion.sh
source ~/.colors.sh
GIT_PS1_SHOWDIRTYSTATE=1
if [ "\$(type -t __git_ps1)" ]; then
#PS1="\h:\w \$(__git_ps1 '(%s)')$"
GIT_BRANCH="${BRIGHT_CYAN}\$(__git_ps1 '(${CYAN}%s${BRIGHT_CYAN})')${NORMAL}"
PS1="${WHITE}\h:\w $GIT_BRANCH \$ ${RESET}"
@tjogin
tjogin / .git-completion.sh
Created June 8, 2011 17:31
Bash git completion
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@tjogin
tjogin / rackup.ru
Created June 9, 2011 06:00
Simple rack server
class Server
@@mime_types = { :txt => 'text/plain', :js => 'application/x-javascript', :css => 'text/css' }
def call(env)
file = file_name env["REQUEST_PATH"]
if File.exists? file
[200, { 'Content-Type' => mime_type_for_file(file) }, [ File.read(file) ] ]
else
[404, { 'Content-Type' => 'text/html' }, []]
end
@tjogin
tjogin / README.md
Created September 5, 2011 06:56 — forked from rodrigorm/README.md
Configuration file to use PHP with Ruby rack

Installation

First you need php-cgi, i used brew with Formula below:

$ curl -O https://raw.github.com/gist/1194269/7ae1709453a8a19ce9c030bf41d544dd08d96d85/php.rb
$ mv php.rb `brew --prefix`/Library/Formula
$ brew install php --with-mysql

Second, install this ruby gems: