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
var Router = Backbone.Router.extend({ | |
routes: { | |
"your-complex-form": "complexFormHandler", | |
"": "default" | |
}, | |
complexFormHandler: function(){ | |
if( !this.complexFormViewInstance ){ | |
this.complexFormViewInstance = new ComplexFormViewInstance(); | |
} |
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
var Iconv = require( "iconv" ).Iconv, | |
fromLatinToUtf8 = new Iconv( "ISO-8859-1", "UTF-8" ), | |
removeAccent = new Iconv( "UTF-8", "US-ASCII//TRANSLIT//IGNORE" ); | |
var stringWithAccents = "árvíztűrőtükörfúrógép"; // it's great hungarian word, it contains all the tricky characters | |
removeAccent.convert( stringWithAccents ).toString().replace( /"*'*:*~*/gm, "" ) === "arvizturotukorfurogep"; |
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
var async = require( "async" ), | |
request = require( "request" ), | |
fs = require( "fs" ), | |
path = require( "path" ), | |
zlib = require( "zlib" ), | |
AdmZip = require( "adm-zip" ), | |
spawn = require( "child_process" ).spawn; | |
// http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/GeoLiteCity-latest.zip | |
// http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip |
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
var haproxyLog = new HaProxyLog({ | |
port: process.env.PORT||3333 | |
}); | |
haproxyLog | |
.on( "up", console.log.bind( console, "Server is up" ) ) | |
.on( "down", console.log.bind( console, "Server is down" ) ) | |
.on( "backend-down", console.log.bind( console, "Backend is down" ) ) | |
.on( "access-log", console.log.bind( console, "access log entry:" ) ) | |
.on( "raw", function( message ){console.log( "this is the raw message:", message.toString() ) }); |
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
info: Welcome to Nodejitsu oroce | |
info: jitsu v0.9.7 | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command logs app elvira | |
error: Error running command logs app elvira | |
error: Nodejitsu Error (500): Internal Server Error | |
warn: Error returned from Nodejitsu | |
error: Error: socket hang up | |
error: at createHangUpError (http.js:1344:15) |
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
{ | |
"scripts": { | |
"start": "node --nouse-idle-notification --expose-gc app.js" | |
} | |
} |
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
var spawn = require( "child_process" ).spawn; | |
var env = process.env || {}; | |
env.PORT = 3001; | |
var childProcess = spawn( "node", [ | |
"--nouse-idle-notification", | |
"--expose-gc", | |
"app.js" | |
], { | |
env: env | |
}); |
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
var | |
express = require("express") | |
app = express() | |
sio = require("socket.io"), | |
server = require('http').createServer(app) | |
io = sio.listen(server); | |
server.listen(3333); | |
io.sockets.on('connection', function (socket) { |
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
socket.broadcast.emit( "clients", io.sockets.clients().map(function(s){ return s.id; })); |
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
Error: not opened | |
at WebSocket.send (/my/folder/node_modules/nodefly/node_modules/socket.io-client/node_modules/ws/lib/WebSocket.js:175:16) | |
at Transport.WS.send (/my/folder/node_modules/nodefly/node_modules/socket.io-client/lib/transports/websocket.js:107:22) | |
at Transport.packet (/my/folder/node_modules/nodefly/node_modules/socket.io-client/lib/transport.js:178:10) | |
at Socket.packet (/my/folder/node_modules/nodefly/node_modules/socket.io-client/lib/socket.js:295:22) | |
at SocketNamespace.packet (/my/folder/node_modules/nodefly/node_modules/socket.io-client/lib/namespace.js:64:17) | |
at SocketNamespace.emit (/my/folder/node_modules/nodefly/node_modules/socket.io-client/lib/namespace.js:113:17) | |
at SocketNamespace.<anonymous> (/my/folder/node_modules/nodefly/lib/sockets.js:40:10) | |
at SocketNamespace.EventEmitter.emit [as $emit] (/my/folder/node_modules/nodefly/node_modules/socket.io-client/lib/events.js:165:15) | |
at SocketNamespace.onPacket (/my/folder/node_modules/nodefly/node_modules/ |