Skip to content

Instantly share code, notes, and snippets.

View levent's full-sized avatar

Levent Ali levent

View GitHub Profile
# 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
@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\]"
@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
==========================================================
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.
module ActiveRecordAssociationMatcher
class AbstractAssociationMatcher
def initialize(expected)
@expected = expected
@expected_options = {}
end
def matches?(target)
@target = target
begin
module ActiveRecordValidationMatcher
class RequireA
def initialize(expected)
@expected = expected
end
def matches?(target)
@target = target
@target.send("#{@expected}=", nil)
@target.valid?
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"

ESP is looking for a front end developer

We are looking for a senior and junior front developer to work with us to build out our proposition

POSITION: Permanent / Contractor SALARY: Competitive
LOCATION: CENTRAL LONDON STARTING: ASAP

Enrich Social Productions develops, licenses and distributes next generation entertainment formats that operate across Internet, mobile, and TV. All our formats combine user generated content and celebrity, and are based either on traditional entertainment or team sport.

@levent
levent / half_hour_increments.rb
Created March 16, 2010 15:07
Can this be made more illegible?
(0..23).inject([]) { |times, hour| times << ("%02d:00" % hour) << ("%02d:30" % hour) } # @craigwebster wins so far
class EmmissionCategory < ActiveRecord::Base
def self.all
return EmmissionCategory.find(:all)
end
end