Skip to content

Instantly share code, notes, and snippets.

View nthj's full-sized avatar

Nathaniel Jones nthj

  • Orlando, FL
View GitHub Profile
@ryanong
ryanong / gist:1038659
Created June 21, 2011 19:27
Compare Strings By Character Pairs
def compare_strings(str1,str2)
str1.downcase!
pairs1 = (0..str1.length-2).collect {|i| str1[i,2]}.reject { |pair| pair.include? " "}
str2.downcase!
pairs2 = (0..str2.length-2).collect {|i| str2[i,2]}.reject { |pair| pair.include? " "}
union = pairs1.size + pairs2.size
intersection = 0
@beef
beef / Gemfile
Created December 15, 2010 11:29
Production environment for Rails 3 on heroku with rack-cache
# Add this to your gem file
group :production do
gem 'dalli'
gem 'rack-cache', :require => 'rack/cache'
gem 'rack-contrib', :require => 'rack/contrib'
end