Skip to content

Instantly share code, notes, and snippets.

app.game = {
state: {
currentTurn: 'player1'
},
player1: {
name: 'Player 1',
stacks: {
stack1: ['1'],
stack2: ['2'],
stack3: ['3'],
@chimmelb
chimmelb / output withErrors=false
Last active September 15, 2015 14:45
Promise.promisifyAll of a class and errors
start promisifyInLine
calling `a`, willError=false
promisifyInLine from a=123
calling `b`, willError=false
promisifyInLine from b=456
promisifyInLine error=null results=done promisifyInLine
start promisifyUsingAll
calling `a`, willError=false
promisifyUsingAll from a=123
@chimmelb
chimmelb / client.js
Created November 4, 2014 21:44
engine.io-client connect to primus server
var socket = require( 'engine.io-client' )( 'http://localhost:8080' );
//engine.io-client callbacks
socket.on( 'open', function() {
console.log( 'open!' );
} );
socket.on( 'message', function( data ) {
console.log( 'message=' + message.toString() );
} );
socket.on( 'close', function() {
@chimmelb
chimmelb / client.js
Last active August 29, 2015 14:08
Socket.io server and client, connect to primus
var socket = require( 'socket.io-client' )( 'http://localhost:4567' );
//var socket = require( 'socket.io-client' )( 'http://127.0.0.1:8080/primus', {
// transports: [ 'polling', 'websocket' ],
// forceBase64: true,
// rememberUpgrade: false,
// enablesXDR: false,
// timestampRequests: true
//} );
//var socket = require( 'socket.io-client' )( 'http://127.0.0.1:8080/primus' );