This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'active_support' | |
require 'active_model' | |
class Stub | |
def self.generate(name, *attrs) | |
Object::const_set(name.intern, Class::new do | |
include ActiveModel::Serialization | |
include ActiveModel::Validations | |
attr_accessor *attrs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :application, "myapp" | |
set :repository, "git@myhost.com:myapp.git" | |
set :user, 'deploy' | |
set :ssh_options, {:forward_agent => true} | |
# If you have previously been relying upon the code to start, stop | |
# and restart your mongrel application, or if you rely on the database | |
# migration code, please uncomment the lines you require below |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mobile-warrior:storefront jmartin$ which ruby | |
/Users/jmartin/.rvm/rubies/ruby-1.9.2-head/bin/ruby | |
mobile-warrior:storefront jmartin$ gem install nokogiri | |
Building native extensions. This could take a while... | |
Successfully installed nokogiri-1.4.2 | |
1 gem installed | |
Installing ri documentation for nokogiri-1.4.2... | |
Installing RDoc documentation for nokogiri-1.4.2... | |
mobile-warrior:storefront jmartin$ AUTOFEATURE=true autotest | |
loading autotest/cucumber_rails_rspec2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateConfigurations < ActiveRecord::Migration | |
def self.up | |
create_table :configurations do |t| | |
t.string :key | |
t.text :value | |
t.timestamps | |
end | |
add_index :configurations, :key, :unique => true | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'digest/sha1' | |
require 'rubygems' | |
require 'amatch' | |
require 'bio' | |
challenge_phrase = File.read('challenge.txt') | |
challenge_sha1 = Digest::SHA1.hexdigest(challenge_phrase) | |
words = File.read('dict.txt').split("\n").uniq | |
test_phrase = words.sort{rand <=> 0.5}[3..rand(10)+5].join(' ') |
NewerOlder