This file contains 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
fs = require 'fs' | |
{print} = require 'sys' | |
{log, error} = console; print = log | |
{spawn, exec} = require 'child_process' | |
run = (name, args...) -> | |
proc = spawn(name, args) | |
proc.stdout.on('data', (buffer) -> print buffer if buffer = buffer.toString().trim()) | |
proc.stderr.on('data', (buffer) -> error buffer if buffer = buffer.toString().trim()) | |
proc.on 'exit', (status) -> |
This file contains 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
// http://stackoverflow.com/questions/10058226/send-response-to-all-clients-except-sender-socket-io | |
// send to current request socket client | |
socket.emit('message', "this is a test"); | |
// sending to all clients, include sender | |
io.sockets.emit('message', "this is a test"); | |
// sending to all clients except sender | |
socket.broadcast.emit('message', "this is a test"); |
This file contains 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
# Override console.log on Heroku | |
# We are doing this console.log kills performance | |
console.log = if global.process.env.NODE_ENV? then () -> else console.log |