Skip to content

Instantly share code, notes, and snippets.

View cableray's full-sized avatar

Garrett cableray

View GitHub Profile
@cableray
cableray / antvatar_part_category.rb
Created October 3, 2012 22:44
Factory girl traits not working
FactoryGirl.define do
factory :antvatar_part_category do
sequence(:name) {|n| "Category #{n}"}
trait :current_seasonal do
started_on {1.week.ago}
stopped_on {1.week.from.now}
end
trait :sesonal_ended do
stopped_on {1.week.ago}
end
Template.add_player.events = {
'submit': function () {
console.log(this);
return false;
}
};
@cableray
cableray / solr_thread.rb
Created December 22, 2011 22:33
Trying to run solr in a thread
require 'java'
require '/Users/cableray/.rvm/gems/jruby-1.6.5@busydocs/gems/sunspot_solr-1.3.0/solr/start.jar'
Dir['/Users/cableray/.rvm/gems/jruby-1.6.5@busydocs/gems/sunspot_solr-1.3.0/solr/lib/*.jar'].each {|f| require f}
Java::OrgMortbay.start.Main.main [] # not in a thread yet, but just trying to start it
@cableray
cableray / gist:1491694
Created December 17, 2011 22:53
raw backtrace for encoding mismatch error when saving AR model to sqlite
java/lang/Thread.java:1503:in `getStackTrace'
org/jruby/runtime/backtrace/TraceType.java:59:in `getBacktraceData'
org/jruby/runtime/backtrace/TraceType.java:111:in `getBacktraceData'
org/jruby/runtime/backtrace/TraceType.java:25:in `getBacktrace'
org/jruby/RubyException.java:160:in `prepareBacktrace'
org/jruby/exceptions/RaiseException.java:205:in `preRaise'
org/jruby/exceptions/RaiseException.java:195:in `preRaise'
org/jruby/exceptions/RaiseException.java:112:in `<init>'
org/jruby/Ruby.java:3348:in `newRaiseException'
org/jruby/Ruby.java:3323:in `newEncodingCompatibilityError'