Skip to content

Instantly share code, notes, and snippets.

/* 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() {
String.prototype.getBytes = function() {
return encodeURIComponent(this).replace(/%../g, 'x').length;
};
var puts = require("sys").puts,
http = require("http"),
server = http.createServer,
pubClient = http.createClient(80, "bootstrip.localhost");
var postServer = server(function(postRequest, postResponse) {
String.prototype.getBytes = function() {
return encodeURIComponent(this).replace(/%../g, 'x').length;
};
var puts = require("sys").puts,
http = require("http"),
server = http.createServer,
pubClient = http.createClient(80, "bootstrip.localhost");
var postServer = server(function(postRequest, postResponse) {
String.prototype.getBytes = function() {
return encodeURIComponent(this).replace(/%../g, 'x').length;
};
var puts = require("sys").puts,
http = require("http"),
server = http.createServer,
pubClient = http.createClient(80, "localhost");
var postServer = server(function (postRequest, postResponse) {
<div id="main" class="palm-hasheader">
<div class="palm-header">Match4</div>
<div id="board">
<table class="board">
<thead id="row6">
<th><div id="head0" class="container"><div id="red-piece" class="piece red"/></div></th><th><div id="head1" class="container"></div></th><th><div id="head2" class="container"></div></th><th><div id="head3" class="container"></div></th><th><div id="head4" class="container"></div></th><th><div id="head5" class="container"></div></th><th><div id="head6" class="container"></div></th>
</thead>
<tbody>
<tr id="row5">
<td id="col0_5"><div id="con0_5"></div></td><td id="col1_5"><div id="con1_5"></div></td><td id="col2_5"><div id="con2_5"></div></td><td id="col3_5"><div id="con3_5"></div></td><td id="col4_5"><div id="con4_5"></div></td><td id="col5_5"><div id="con5_5"></div></td><td id="col6_5"><div id="con6_5"></div></td>
/*
* Example drag-n-drop for webos
*/
function BoardAssistant(){
/* this is the creator function for your scene assistant object. It will be passed all the
additional parameters (after the scene name) that were passed to pushScene. The reference
to the scene controller (this.controller) has not be established yet, so any initialization
//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});
}
});
})();
//in en-US language specific file
//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', {
GIT_INDEX_FILE=.git/index-foo1234.tmp git add public
git rev-parse `GIT_INDEX_FILE=.git/index-foo1234.tmp git write-tree`:public`
rm .git/index-foo1234.tmp