Skip to content

Instantly share code, notes, and snippets.

View drueck's full-sized avatar

David Rueck drueck

View GitHub Profile
@drueck
drueck / active_record_spec_helper.rb
Created May 6, 2014 06:07
Variation of Corey Haines' active_record_spec_helper.rb that supports FactoryGirl, Shoulda and MoneyRails
require "simplecov"
SimpleCov.start "rails"
require "yaml"
require "active_record"
require "factory_girl_rails"
require "shoulda-matchers"
require 'money-rails'
connection_info = YAML.load_file("config/database.yml")["test"]
function Anagram(word) {
this.word = word;
}
Anagram.prototype.match = function(words) {
return words.filter(function(word) {
return areAnagrams(this.word, word);
}, this);
};
var DNA_NUCLEOTIDES = ['A', 'T', 'C', 'G'];
var ALL_NUCLEOTIDES = DNA_NUCLEOTIDES.concat('U');
function initialCounts() {
return DNA_NUCLEOTIDES.reduce(function(counts, nucleotide) {
counts[nucleotide] = 0;
return counts;
}, {});
}