Discover gists
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
// ==UserScript== | |
// @name bitlyUI | |
// @namespace http://fluidapp.com | |
// @description What does this do? | |
// @include * | |
// @author Someone | |
// ==/UserScript== | |
// | |
// GreaseKit friendly |
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 'sinatra' | |
module ::Haml::Filters::Maruku | |
end | |
get '/' do | |
"blah" | |
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
require 'rubygems' | |
require 'bio' | |
triplets = %w( 1 2 3 1 2 2 4 2 1 3 2 4 3 1 1 3 4 4 2 4 1 1 1 4 2 3 1) | |
bases = %w(a c t g) | |
decoded = [] | |
bases.each do |i| | |
bases.each do |j| | |
bases.each do |k| |
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 'bio' | |
triplets = %w( 1 2 3 1 2 2 4 2 1 3 2 4 3 1 1 3 4 4 2 4 1 1 1 4 2 3 1) | |
bases = %w(a c t g) | |
decoded = [] | |
bases.each do |i| | |
bases.each do |j| | |
bases.each do |k| |
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 'tempfile' | |
require 'rubygems' | |
require 'mojombo-grit' | |
include Grit | |
PATH_TO_DIFFMERGE = "/usr/bin/diffmerge" |
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
= spans(!columns) | |
- for !column from 1 through !columns by 2 // though = .., to = ..., by = incrementor | |
+span(!column,!columns) | |
= span(!column, !columns) | |
.span-#{!column} | |
:width= 45px * !column + 15px | |
- if !column != !columns | |
:margin-right 15px | |
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
describe '#save' do | |
describe 'with a new resource' do | |
it "should save child assosciations" | |
it "should set defaults before create" | |
it "should create when the resource is dirty" do | |
zoo = Zoo.new | |
zoo.name = "San Diego" | |
zoo.should_receive(:create) |
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
describe '#save' do | |
describe 'with a new resource' do | |
it "should create when the resource is dirty" do | |
Zoo.new(:city => "San Diego").save | |
Zoo.first.name.should == "San Diego" | |
end | |
end | |
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
# current behavior | |
zoo1 = Zoo.new(:city => "SF") | |
zoo2 = Zoo.new(:city => "SF") | |
zoo1.eql?(zoo2) # => true | |
zoo1.save | |
zoo2.save | |
zoo1.eql?(zoo2) # => false |
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
it "should save child assosciations" do | |
repository(ADAPTER) do | |
animal = Animal.new | |
@zoo.animals << animal | |
@zoo.save | |
animal.new_record?.should be_false | |
end | |
end | |