Some CoffeeScript (verbosely commented for clarity)
# Override Rails handling of confirmation
$.rails.allowAction = (element) ->
# The message is something like "Are you sure?"
message = element.data('confirm')
# Some cleaning up ;) | |
run "rm public/index.html" | |
# Installing required plugins | |
plugin 'Authentasaurus', :git => 'git://github.com/logicpath/Authentasaurus.git' | |
plugin 'flash_message_conductor', :git => 'git://github.com/planetargon/flash-message-conductor.git' | |
plugin 'acts_as_taggable_on_steroids', :git => 'git://github.com/jviney/acts_as_taggable_on_steroids.git' | |
plugin 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git' | |
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git' |
config.gem "webrat", :lib => false, :version => "0.5.3" | |
config.gem "cucumber", :lib => false, :version => "0.3.98" | |
config.gem "thoughtbot-factory_girl", :lib => 'factory_girl', :source => 'http://gems.github.com', :version => "1.2.1" |
run "rm public/index.html" | |
run "rm public/images/rails.png" | |
plugin 'flash_message_conductor', :git => 'git://github.com/planetargon/flash-message-conductor.git' | |
plugin 'acts_as_taggable_on_steroids', :git => 'git://github.com/jviney/acts_as_taggable_on_steroids.git' | |
plugin 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git' | |
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git' | |
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git' |
/* Ismael Celis 2010 | |
Simplified WebSocket events dispatcher (no channels, no users) | |
var socket = new FancyWebSocket(); | |
// bind to server events | |
socket.bind('some_event', function(data){ | |
alert(data.name + ' says: ' + data.message) | |
}); |
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations) | |
# By Peter Cooper | |
# | |
# MIT license | |
# | |
# * Not advised to use in your production environment! ;-) | |
# * Requires Ruby 1.9 | |
# * Supports A and CNAME records | |
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance | |
# * All records get the same TTL |
module ActiveRecord::NestedAttributes | |
module ClassMethods | |
def accepts_nested_attributes_for(*attr_names) | |
options = { :allow_destroy => false, :update_only => false } | |
options.update(attr_names.extract_options!) | |
# Modified stuff | |
#options.assert_valid_keys(:allow_destroy, :reject_if, :limit, :update_only) | |
options.assert_valid_keys(:allow_destroy, :reject_if, :limit, :update_only, :allow_existing) |
# This is an incomplete implementation. | |
module MongoMapper | |
module NestedAttributes | |
def self.included(base) | |
base.extend(ClassMethods) | |
base.send :include, InstanceMethods | |
end | |
module ClassMethods | |
def accepts_nested_attributes_for(*attr_names) |
/* Abstract event binding | |
Example: | |
var MyEventEmitter = function(){}; | |
MyEventEmitter.prototype = new AbstractEventsDispatcher; | |
var emitter = new MyEventEmitter(); | |
// Bind to single event | |
emitter.bind('foo_event', function(data){ alert(data)} ); |
var wireio = new WireIO({app_key: "yourappkey"}); | |
wireio.on('wireio/connected', function() { | |
console.log("Connected"); | |
}); | |
wireio.on('chatter-entered', {nick: 'awesomechatter'}); |