Skip to content

Instantly share code, notes, and snippets.

def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@samanthamjohn
samanthamjohn / gist:2d854331eb8cec70d82d
Last active August 29, 2015 14:09 — forked from ashaegupta/gist:3417edaf4e72d255affb
Finding number of projects that are levels
def query_for_terms(terms)
query = ""
terms.each do |term|
query += "lower(substring(title from 0 for 30)) LIKE '%#{term}%' OR "
end
query.chomp("OR ")
end
def projects_arel(weeks_ago)