Skip to content

Instantly share code, notes, and snippets.

View binarycleric's full-sized avatar
💢

Jon Daniel binarycleric

💢
View GitHub Profile
@binarycleric
binarycleric / gist:3782510
Created September 25, 2012 15:11
Git branch in prompt
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}") "
}
white='\[\e[37;1m\]'
green='\[\e[32;1m\]'
blue='\[\e[34;1m\]'
red='\[\e[31;1m\]'
nocolour='\[\e[0m\]'
@binarycleric
binarycleric / event_mockup.rb
Created September 5, 2012 14:35
Event Class Mockup. Events are meant to be self-contained actions who only send and receive plain old ruby objects. An event can be used anywhere.
class SomeController < ApplicationController
def update
handle_response SomeEvent::Update.new(params).invoke
end
private
##
# Performs some default action on the response. Probably just returns the