This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LongPollHttpServer < EM::Connection | |
| def unbind | |
| end | |
| def receive_data(data) | |
| end | |
| end | |
| EM.epoll if EM.epoll? | |
| EM.run do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"]) |
NewerOlder