Skip to content

Instantly share code, notes, and snippets.

View levent's full-sized avatar

Levent Ali levent

View GitHub Profile
Name: Performance#description should replace an obscene description with an innocent one
Type: Failure Message:
expected: "Me performing care bear on my teddy",
got: "Me performing cunillingus on my teddy"
Name: Performance#title should replace an obscene title with an innocent one
Type: Failure Message:
expected: "care bear",
got: "fingerfuckers"
module ActiveRecordValidationMatcher
class RequireA
def initialize(expected)
@expected = expected
end
def matches?(target)
@target = target
@target.send("#{@expected}=", nil)
@target.valid?
module ActiveRecordAssociationMatcher
class AbstractAssociationMatcher
def initialize(expected)
@expected = expected
@expected_options = {}
end
def matches?(target)
@target = target
begin
==========================================================
Great Ruby Developers and Front-End Coders required at ESP
==========================================================
I am about to take up an exciting position with a well
funded start-up called Enrich Social Productions.
Unfortunately I cannot give out too much information
publicly until the initial BETA has launched.
@levent
levent / gist:11439
Created September 18, 2008 15:21 — forked from lifo/gist:11172
# Released under WTFPL - http://sam.zoy.org/wtfpl/
module PoorMansMigrations
@@_migration_columns = []
def column(name, type, options = {})
@@_migration_columns << {:column_name => name, :column_type => type, :options => options}
end
def realize!(force_drop = false)
# Force drop if needed
@levent
levent / .bash_profile
Created September 2, 2008 07:13
jgp-macbook-pro
####
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
# Taken directly from rails docs
class MyMailer
include ActionController::UrlWriter
default_url_options[:host] = 'www.basecamphq.com'
def signup_url(token)
url_for(:controller => 'signup', action => 'index', :token => token)
end
end