Skip to content

Instantly share code, notes, and snippets.

@saimonmoore
saimonmoore / Gemfile
Created March 26, 2010 12:12 — forked from lifo/Gemfile
CRAMP Websocket example
gem 'cramp'
gem 'erubis', '2.6.5'
gem 'usher', "0.6.0"
/* Ismael Celis 2010
Simplified WebSocket events dispatcher (no channels, no users)
var socket = new ServerEventsDispatcher();
// bind to server events
socket.bind('some_event', function(data){
alert(data.name + ' says: ' + data.message)
});
var
PARALLEL_CONNECTS = 10,
http = require('http'),
sys = require('sys'),
connectionCount = 0,
messageCount = 0;
lastMessages = 0;
function addClient() {
//extend MooTools.lang to add support for pluralization..
(function(){
$extend(MooTools.lang, {
pluralise: function(key, delta) {
return this.get('Translations', 'pluralise', [key, delta]).substitute({delta: delta});
}
});
})();
MooTools.lang.set('en-US', 'Translations', {
#
# A try to built a simple drummachine using Shoes and Midiator.
# Unfortunalty animation seems to be quite processor heavy. Things might get slow..
# Because of that, the beats don't get highlighted on beat.
#
# You will need a midi input for this.
# On OSX you could use http://notahat.com/midi_patchbay
# and http://notahat.com/simplesynth or Garage Band
#
# Usage:
@saimonmoore
saimonmoore / git.rake
Created September 3, 2008 09:30 — forked from defunkt/gist:4169
# by bryan helmkamp with slight modification by chris wanstrath
# and a bit of refactoring by saimon moore
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow
module GitCommands
extend self
def diff_staging
execute('git fetch')
puts `git diff origin/production origin/staging`