This file contains hidden or 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
### Nginx upstart script | |
### source: http://serverfault.com/a/391737/70451 | |
### /etc/init/nginx.conf | |
description "nginx http daemon" | |
start on (filesystem and net-device-up IFACE=lo) | |
stop on runlevel [!2345] | |
env DAEMON=/usr/local/sbin/nginx |
This file contains hidden or 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 service = something('foo'); | |
service.error(function (error) { | |
next(error) | |
}); | |
service.client(function (client){ | |
// do stuff with client | |
}); |
This file contains hidden or 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
%lex | |
%% | |
\n+ { process.stdout.write('[ENDLINE(S)]\n'); return 'ENDLINE'; } | |
<<EOF>> { process.stdout.write('[EOF]'); return 'EOF'; } |
This file contains hidden or 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
app.configure(function(){ | |
app.use(express.cookieParser()); | |
app.use(express.session({ secret: 'keyboard cat' })); | |
app.use(function (req, res, next) { res.locals.session = req.session; next();}); | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'ejs'); | |
//app.use(express.logger()); | |
app.use(express.bodyParser()); |