Skip to content

Instantly share code, notes, and snippets.

Job failed to load: undefined method `constantize' for String:Class. Try to manually require the required file.
/srv/chacha.me/shared/bundle/ruby/1.8/gems/delayed_job-2.0.3/lib/delayed/backend/base.rb:93:in `deserialize'
/srv/chacha.me/shared/bundle/ruby/1.8/gems/delayed_job-2.0.3/lib/delayed/backend/base.rb:46:in `payload_object'
/srv/chacha.me/shared/bundle/ruby/1.8/gems/delayed_job-2.0.3/lib/delayed/backend/base.rb:51:in `name'
/srv/chacha.me/shared/bundle/ruby/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:172:in `reserve_and_run_one_job'
/srv/chacha.me/shared/bundle/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/quoting.rb:11:in `detect'
/srv/chacha.me/shared/bundle/ruby/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:170:in `each'
/srv/chacha.me/shared/bundle/ruby/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:170:in `detect'
/srv/chacha.me/shared/bundle/ruby/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:170:in `reserve_and_run_one_job'
/srv/chacha.me/shared/bund
#!/usr/bin/env ruby
# Grab a subset of data from the 'from_db', push it into the 'to_db'
require 'rubygems'
require 'sequel'
require 'pp'
ROW_LIMIT = 1000
TABLES = %W(tablename othertablename otherothertablename anothertablename yetanothertablename)
%legend Enter Information about pricing for registration
- event_form.fields_for :prices do |price_form|
.form_row
= price_form.label :price_type, "Type (ie: Competitive, Adult, etc)"
= price_form.text_field :price_type
.form_row
= price_form.label :price, "Price $"
= price_form.text_field :price, {:class => "price"}
# OMG THIS PATTERN IS REPEATED FOR AT LEAST
# FOUR FUCKING FUNCTIONS IN JUST THIS MODEL
def self.for_year(options = {})
query = "
SELECT
SUM(net_amount) as amount
FROM
guide_payments
WHERE
user_id = #{options[:user_id]}
var zombie = require("zombie");
var assert = require("assert");
var urlList = new Array('http://google.com', 'http://yahoo.com', 'http://bing.com');
for (var i = 0; i < urlList.length; i++) {
zombie.visit(urlList[i], function (err, browser, status) {
...
});
}
desc "Minify JS and CSS, commit the results, and push it all"
task :minify_assets do
`jammit`
status_output = `git status`
unless status_output =~ /nothing to commit/ && status_output !~ /public\/assets/
`git add public/assets/`
`git commit -m "Re-minify JS and CSS before deployment"`
`git push origin master`
end
end
var MyApp = {};
(function() {
this.photoRemovalPrompt = function() {
$('a.remove-photo').click(function(ev) {
if (confirm('Are you sure you want to remove this photo?')) {
$(this).parent('form').submit();
}
});
}
// Evergreen adds a require function to Jasmine!
require('/javascripts/jquery-1.4.4.min.js');
require('/javascripts/my_app.js');
describe('MyApp', function() {
describe('#photoRemovalPrompt', function() {
// Evergreen also adds the ability to specify a
// template against which to test!
template('edit_profile.html');
require('/javascripts/jquery-1.4.4.min.js')
require('/javascripts/my_app.js')
describe 'MyApp', ->
describe '#photoRemovalPrompt', ->
template 'edit_profile.html'
it "should prompt the user upon clicking the remove link", ->
MyApp.photoRemovalPrompt()
$(document).ready(function() {
$.doTimeout(600000, function() {
$.get('/iteration', function(data) {
$('div#current-bugs span').html(data.number_of_bugs);
$('div#progress-bar-container h2').html(data.accepted_features_points + ' / ' + data.features_points);
$('h1#days').html(data.days_left + ' days left!');
$('#progress-bar').progressbar({value: data.percent_finished });
});
return true;
});