Skip to content

Instantly share code, notes, and snippets.

@bts
bts / README.md
Created June 3, 2012 02:18 — forked from juno/README.md
Install rbenv and ruby-build to Amazon Linux (cloud-init).
  1. run user-data.sh
  2. run install-ruby.sh.
@bts
bts / option1.rb
Created September 30, 2011 21:20 — forked from bkeepers/plugin.rb
Theoretical plugin API for Qu
# bts: If I'm writing a plugin, I'd typically like to have a namespace to add
# my own classes, so I would skip this option:
# Qu.plugin(:autoretry) do |*errors|
# options = {:limit => 3}.merge!(errors.extract_options!)
# errors << Exception if errors.empty?
# before :failure do |job, e|
# if errors.any? {|error| error === e }
# job.data[:retries] += 1
@bts
bts / install_homebrew.rb
Created August 4, 2011 21:25 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
#!/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
#!/usr/bin/env ruby
#
# This script generates RESTful scaffolds from your pre-existing models.
# Copyright 2008 Kyle Maxwell, available under the MIT licence.
#
require "rubygems"
require "active_support"
content = File.read(File.dirname(__FILE__) + "/db/schema.rb").split("create_table")