Skip to content

Instantly share code, notes, and snippets.

🐳
Working from home

Oshan Wisumperuma oshanz

🐳
Working from home
Block or report user

Report or block oshanz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@staltz
staltz / introrx.md
Last active Jul 17, 2019
The introduction to Reactive Programming you've been missing
View introrx.md
@mperham
mperham / gist:1379464
Created Nov 19, 2011
Flexibility without Dependency Injection
View gist:1379464
class TaxCode
GENERATORS = {
:us => lambda { |id| "US-#{id}" },
:br => lambda { |id| "#{id + 9}-BRA" },
}
def self.generate(code, id)
gen = GENERATORS[code] || raise ArgumentError, "No generator for country #{code}"
gen.call(id)
end
You can’t perform that action at this time.