Skip to content

Instantly share code, notes, and snippets.

View johaywood's full-sized avatar

Josh Haywood johaywood

  • Bluesight
View GitHub Profile
@johaywood
johaywood / ncdhhs_downloader.rb
Created January 11, 2022 02:34
Download data from NCDHHS COVID dashboards
#!/usr/bin/env ruby
# Install capybara and selenium-webdriver gems
#
# $ gem install capybara
# $ gem install selenium-webdriver
#
# Install chromedriver
#
# $ brew install chromedriver
class Scrabble
attr_reader :string, :scores, :multiplier
def initialize(string, multiplier = :single)
@string = string
@multiplier = multiplier
end
def score
score = 0
@johaywood
johaywood / roman_numeral.rb
Created November 18, 2015 01:06
Convert Fixnum to Roman Numeral String
class Fixnum
VERSION = 1
def to_roman
numeral = ""
numeral << numeral_thousands
numeral << numeral_hundreds
numeral << numeral_tens
numeral << numeral_ones
end
@johaywood
johaywood / secret_santa.rb
Created September 16, 2015 00:33
Secret Santa Exercise
class SecretSanta
attr_accessor :people
def initialize(file)
@people = []
File.new(file).each_line do |line|
first, last = line.split(' ')
@people << Person.new(first, last)
end
assign_santas