Skip to content

Instantly share code, notes, and snippets.

View tekwiz's full-sized avatar

Travis D. Warlick, Jr. tekwiz

View GitHub Profile
state_machine User do
state :new
state :normal
state :locked
end
state_machine Membership do
state :new
state :active
state :inactive
@tekwiz
tekwiz / mate-gem
Created April 25, 2010 18:00
Opens a gem and its direct dependencies in text mate
#!/usr/bin/env ruby
# Opens the source code for a gem and the gem's direct dependencies in textmate.
#
# When this is mature it will be added to [Dionysus](http://github.com/tekwiz/dionysus).
#
# TODO add banner and better docs to option parser
# TODO add --quiet flag to suppress dependency not found warnings
# TODO add recursive dependencies (e.g. failure: `mate-gem rails 3.0.0.beta3` does not load activemodel
# since that is a dependency of activerecord)
@tekwiz
tekwiz / CloudFilesSnippets.rb
Created September 2, 2009 16:29
Ruby Snippets for CloudFiles
require 'rubygems'
require 'cloudfiles'
require 'activesupport'
CF_USERNAME = ''
CF_API_KEY = ''
CONTAINER = ''
# Connect
cf = CloudFiles::Connection.new(CF_USERNAME, CF_API_KEY)
@tekwiz
tekwiz / S3Snippets.rb
Created September 2, 2009 16:25
Ruby Snippets for S3
require 'rubygems'
require 'aws/s3'
require 'activesupport'
S3_KEY_ID = ''
S3_ACCESS_KEY = ''
BUCKET = ''
# Connect
AWS::S3::Base.establish_connection!(