Skip to content

Instantly share code, notes, and snippets.

require 'test_helper'
class OrdersControllerTest < ActionController::TestCase
context "responding to GET /orders/new" do
should "succeed" do
get :new
assert_response :success
end
end
end
class House < ActiveRecord::Base
has_many :rooms
end
class Room < ActiveRecord::Base
belongs_to :house
default_scope :order => 'dimensions DESC'
attr_accessor :color, :dimensions
end
gem list
*** LOCAL GEMS ***
actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.2.2)
activeresource (2.2.2)
activesupport (2.2.2)
annotate-models (1.0.4)
jQuery.fn.getWithAjax = function() {
this.unbind('click', false);
this.click(function() {
$.get($(this).attr("href"), $(this).serialize(), null, "script");
return false;
})
return this;
};
function ajaxLinks(){
# Activate a gem (i.e. add it to the Ruby load path). The gem
# must satisfy all the specified version constraints. If
# +autorequire+ is true, then automatically require the specified
# autorequire file in the gem spec.
#
# Returns true if the gem is loaded by this call, false if it is
# already loaded, or an exception otherwise.
#
def activate(gem, autorequire, *version_requirements)
unless version_requirements.size > 0
> rbbt_config update organisms -o sgd
Changing directory to /Users/nachocab/rbbt/data/organisms
cd /Users/nachocab/rbbt/data/organisms
Updating sgd
/usr/local/lib/ruby/gems/1.8/gems/rbbt-1.0.3/lib/rbbt/util/arrayHash.rb:192:in `initialize': undefined method `length' for nil:NilClass (NoMethodError)
from ./../rake-include.rb:25:in `new'
from ./../rake-include.rb:25
from /Users/nachocab/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
from /Users/nachocab/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
from /Users/nachocab/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
irb(main):002:0> require 'v8'
LoadError: dlopen(/usr/local/lib/ruby/gems/1.8/gems/therubyracer-0.8.0/ext/v8/v8.bundle, 9): no suitable image found. Did find:
/usr/local/lib/ruby/gems/1.8/gems/therubyracer-0.8.0/ext/v8/v8.bundle: mach-o, but wrong architecture - /usr/local/lib/ruby/gems/1.8/gems/therubyracer-0.8.0/ext/v8/v8.bundle
from /usr/local/lib/ruby/gems/1.8/gems/therubyracer-0.8.0/ext/v8/v8.bundle
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/therubyracer-0.8.0/lib/v8.rb:6
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from (irb):2
irb(main):003:0>
@nachocab
nachocab / viterbi.rb
Created October 10, 2011 16:12 — forked from misshie/viterbi.rb
A Ruby implementation of the Viterbi algorithm based on the hidden Markov model (HMM)
# A Ruby implementation of
# the Viterbi algorithm based on the hidden Markov model (HMM)
#
# An original Python code: a Wikipedia page "Viterbi algorithm" at
# http://en.wikipedia.org/wiki/Viterbi_algorithm
#
# Author: MISHIMA, Hiroyuki
#
require 'pp'
@nachocab
nachocab / genes.csv
Created May 20, 2012 22:16
D3 heatmap using Backbone.js and CoffeeScript
gene_name lassa_day_0 lassa_day_3 lassa_day_6 lassa_day_8 lassa_day_10 lassa_day_12 marburg_day_0 marburg_day_1 marburg_day_3 marburg_day_5 marburg_day_7 marburg_day_9 ebola2_day_0 ebola2_day_1 ebola2_day_3 ebola2_day_4 ebola2_day_5 ebola2_day_6 ebola2_day_7 ebola2_day_8 lcmv_day_1 lcmv_day_2 lcmv_day_3 lcmv_day_4 lcmv_day_6 lcmv_day_7
GENE_1 0 0.685 1.047 1.020 0.957 8e-01 0 -0.855 -1e+00 -1.546 -1.359 -1.077 0 -6e-01 -0.219 1.295 0.923 1.216 1e+00 1.632 0.550218483523337 -0.117805570597282 0.0732205574710542 -0.564914153485835 -0.359415199104997 0.00898927502093986
GENE_2 0 2.459 3.299 3.086 2.658 3e+00 0 0.193 9e-01 1.433 1.246 1.091 0 -1e-01 0.392 2.142 2.734 3.863 4e+00 4.216 -0.0754593963815329 0.0967734690139892 0.28316769523287 -0.412279746153753 -0.324753442770228 0.288227993676913
GENE_3 0 0.121 2.131 1.628 1.561 1e+00 0 -0.939 -1e+00 -1.544 -1.632 -1.055 0 2e-02 -0.049 0.008 0.393 1.031 3e-01 0.324 0.0499325227230727 -0.0397401531526083 0.2124328794823 0.0731657480808578 0.0189570855935306 -0.01848
@nachocab
nachocab / FIle.sublime-settings.json
Created June 5, 2012 14:27 — forked from etrepat/FIle.sublime-settings.json
Sublime Text 2 - My Settings
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overriden in the platform
// specific settings file, for example, "Base File (Linux).sublime-settings".
// Because of this, setting them here will have no effect: you must set them
// in your User File Preferences.
"font_face": "Monaco",
"font_size": 12,