A few lines of Ruby with pg driver
is a simple alternative to a job queuing library.
Job queues are defined as database tables
and workers are defined in one Ruby file.
queuea: bundle exec ruby queue/a.rb
queueb: bundle exec ruby queue/b.rb
| #!/usr/bin/env ruby | |
| # createdb db | |
| # chmod +x dataclips.rb | |
| # DATABASE_URL=postgres:///db ./dataclips.rb | |
| require "bundler/inline" | |
| require "csv" | |
| gemfile do | 
A few lines of Ruby with pg driver
is a simple alternative to a job queuing library.
Job queues are defined as database tables
and workers are defined in one Ruby file.
queuea: bundle exec ruby queue/a.rb
queueb: bundle exec ruby queue/b.rb
| import * as React from 'react' | |
| // routing, etc. | |
| import { Reset } from '~/ui/shared/Reset' | |
| export class App extends React.Component { | |
| public render() { | |
| return ( | |
| <div> | |
| <title>Dashboard</title> | 
| --- | |
| rvm: | |
| - 2.0.0 | |
| before_install: | |
| - "echo 'gem: --no-document' > ~/.gemrc" | |
| - "echo '--colour' > ~/.rspec" | |
| - gem install fog | |
| - "./script/travis/bundle_install.sh" | |
| - export DISPLAY=:99.0 | 
| 1.9.3-p392 | 
| class Customer | |
| def initialize(attrs = {}) | |
| @id = attrs[:id] | |
| @country = attrs[:country] | |
| end | |
| def tax_code | |
| TaxCodes[@country].call(@id) | |
| rescue | |
| raise "Tax codes for #{@country} not supported" | 
Thanks to this week's contributors to thoughtbot projects.
Test your Ruby gem against different versions of its dependencies.
A guide for getting things done.
Set up your laptop with this script and these dotfiles.
| module DelayedJob | |
| module Matchers | |
| def enqueue_delayed_job(handler) | |
| DelayedJobMatcher.new handler | |
| end | |
| class DelayedJobMatcher | |
| def initialize(handler) | |
| @handler = handler | |
| @attributes = {} |