Skip to content

Instantly share code, notes, and snippets.

View jesscanady's full-sized avatar

Jessica Canady jesscanady

View GitHub Profile
[ODBC Data Sources]
dsn_name = tds
[ODBC]
Trace = 1
TraceAutoStop = 0
TraceFile = /Users/whatever/Desktop/odbc.log
TraceLibrary =
[dsn_name]
class Things < ActiveRecord::Base
def massive_calculation
@massive_calc_results ||= self.execute_massive_sql
end
end
@jesscanady
jesscanady / author_delegate.rb
Created November 4, 2010 14:39
Example of the delegate method
class Authorship < ActiveRecord::Base
belongs_to :author
belongs_to :book
delegate :full_name, :to => :author
end
# > @authorship.full_name now calls @authorship.author.full_name
def google_font_link_tag(family)
tag('link', {:rel => :stylesheet, :type => Mime::CSS, :href => "http://fonts.googleapis.com/css?family=#{family}"}, false, false)
end
for f in *; do mv $f ${f/erb/haml}; done