Skip to content

Instantly share code, notes, and snippets.

View havenwood's full-sized avatar
:octocat:

Shannon Skipper havenwood

:octocat:
  • Ashland, Oregon
  • 19:32 (UTC -07:00)
View GitHub Profile
@havenwood
havenwood / xday.rb
Created December 1, 2011 19:23
Yesterday, Today, Tomorrow
#!/usr/bin/env ruby
class Time
WEEKDAYS = %w[ Sunday Monday Tuesday Wednesday Thursday Friday Saturday ]
def day_before_yesterday
xday -2
end
def yesterday
@havenwood
havenwood / palindrome.rb
Created September 13, 2011 15:54
Find Palindromes
#!/usr/bin/env ruby
require "rubygems"
gem "minitest"
require "minitest/autorun"
require "minitest/pride"
class Palindrome
def search string
@array = string.gsub(/[^0-9a-z ]/i, '').gsub(' ', '').downcase.split ''
@palindromes = []