Skip to content

Instantly share code, notes, and snippets.

class Room < EM::Channel
def say(nick, type, text = nil)
# some code here to build the string that will be sent back
push(str)
end
end
class LongPollHttpServer < EM::Connection
def receive_data(data)
class LongPollHttpServer < EM::Connection
def receive_data(data)
# some code here to extract path and params from the HTTP request
case path
when '/join'
when '/send'
class LongPollHttpServer < EM::Connection
def unbind
end
def receive_data(data)
end
end
EM.epoll if EM.epoll?
EM.run do
# mongo_template.rb
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"
require "paperclip_migrations"
class AddPaperclipColumnsToProducts < ActiveRecord::Migration
include PaperclipMigrations
def self.up
add_paperclip_fields :items, :vignette
Product.reset_column_information
Product.all.each do |product|
attachment = Asset.find(:first, :conditions => ["assetable_type = ? and assetable_id = ? and type = ?", "Item", product.id, "Vignette"])