Skip to content

Instantly share code, notes, and snippets.

@rwz
rwz / doesnt.rb
Created December 13, 2010 06:50
state_machine + delayed_job wtf
# doesn't fucking work
class Logo < ActiveRecord::Base
state_machine :state, :initial => :initial do
# here vvv
after_transition :initial => :used, :do => :test_callback
@rwz
rwz / rails_template.rb
Created November 18, 2010 10:42
rails template
run 'rm public/index.html'
run 'rm public/favicon.ico'
run 'rm public/images/rails.png'
# remove Prototype defaults
run 'rm public/javascripts/controls.js'
run 'rm public/javascripts/dragdrop.js'
run 'rm public/javascripts/effects.js'
run 'rm public/javascripts/prototype.js'
/*
Prototype's helper for quick and easy observing
click events on different elements including
anchors with '#' href
Usage examples:
instead of:
// Prototype toQueryString fix
(function(){
'use strict';
function typeOf(obj) {
if (obj instanceof Date) {
return 'date';
} else if (Object.isArray(obj)) {
return 'array';