Skip to content

Instantly share code, notes, and snippets.

@fatjonny
fatjonny / deploy 1
Created October 25, 2011 20:52
Three deploys, three results.
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Authenticated as fatjonny
info: Analyzing your application dependencies in server.js
warn: Local version appears to be old.
warn: Your package.json version will be incremented for you automatically.
warn: About to write /Users/fatjonny/Code/<appname>/package.json
data:
@fatjonny
fatjonny / Weird output.
Created October 17, 2011 15:57
Weird log output.
data: 2011-10-17T15:22:45.718Z: Error: EADDRINUSE, Address already in use
data: 2011-10-17T15:22:45.718Z: at Server._doListen (net.js:1106:5)
data: 2011-10-17T15:22:45.718Z: at net.js:1077:14
data: 2011-10-17T15:22:45.718Z: at Object.lookup (dns.js:159:5)
data: 2011-10-17T15:22:45.718Z: at Server.listen (net.js:1071:20)
data: 2011-10-17T15:22:45.718Z: at Instrument.start (/root/haibu-orchestra/vendor/orchestra-instrument/lib/instrument/instrument.js:119...
data: 2011-10-17T15:22:45.718Z: at [object Object].startInstrument [as instrument] (/root/haibu-orchestra/lib/plugins/carapace/instrume...
data: 2011-10-17T15:22:45.718Z: at /root/haibu-orchestra/node_modules/haibu/node_modules/haibu-carapace/bin/carapace:63:24
data: 2011-10-17T15:22:45.718Z: at /root/haibu-orchestra/node_modules/haibu/node_modules/async/lib/async.js:118:13
data: 2011-10-17T15:22:45.718Z: at Object.forEachSeries (/root/haibu-orchestra/node_modules/haibu/node_modules/async/lib/async.js:
@fatjonny
fatjonny / Test.js
Created September 13, 2011 21:38
Passing callback function and retaining scope
var Test = exports.Test = function() {
this.responseObj = { "response": "success" };
};
Test.prototype.catchAll = function( req, res, next ) {
if( !this.responseObj ) {
console.log( "this is GLOBAL" );
next();
}
else {
@fatjonny
fatjonny / home.html
Created February 10, 2011 18:26
Login. Go to /logout. Login. Go to /logout. Login. 'testo' doesn't show up the third time.
<h1>Login</h1>
<%= name %>
<form method="post" action="/login">
<p>
<label>Username:</label>
<input type="text" name="username">
</p>
<p>
<input type="submit" value="Login">
</p>