Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Oshan Wisumperuma oshanz

🌴
On vacation
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 Jan 18, 2020
The introduction to Reactive Programming you've been missing
View introrx.md
@stevensona
stevensona / delayed_job@.service
Last active Jan 6, 2020
systemd unit file for running ruby/rails delayed_job as service
View delayed_job@.service
# Keep delayed job workers running using systemd on ubuntu
# Usage
# Start "sudo systemctl start delayed_job@{0..3}" to start 4 worker instances
# Enable "sudo systemctl enable delayed_job@{0..3}" to enable 4 worker instances
# Restart "sudo systemctl restart delayed_job@{0..3}" to restart 4 worker instances
# Disable "sudo systemctl disable delayed_job@{0..3}" to disable 4 worker instances
# Stop "sudo systemctl stop delayed_job@{0..3}" to stop 4 worker instances
[Unit]
Description=Delayed Job Worker %i
@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.