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 myModule = require('../../../../lib/myModule'); | |
| myModule.doSomething(function (err) { | |
| }); |
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 fetch = function (username, next) { | |
| // get tweets from the twitter API | |
| next(null, tweets); | |
| }; | |
| server.method({ | |
| name: 'twitter.fetch', | |
| method fetch | |
| }); |
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 Hapi = require('hapi'); | |
| var config = { | |
| dbConnection: 'mongodb://db1.example.net,db2.example.net:2500/?replicaSet=test' | |
| }; | |
| var server = new Hapi.Server({ | |
| app: config | |
| }); |
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 Hapi = require('hapi'); | |
| var server = new Hapi.Server(); | |
| server.connection({ | |
| port: 3000 | |
| }); | |
| server.register({ | |
| register: require('myplugin'), |
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
| // not written by me, found at unicredit's spectranet :) | |
| // now I feel a lot safer | |
| function parseBug(m){ | |
| if (m == '08') return '8'; | |
| if (m == '09') return '9'; | |
| return m | |
| } | |
| var dp_y=parseInt(parseBug(v.substring(0,4))); |
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
| [program:PROJECT_NAME] | |
| command=/home/risingstack/.nvm/v0.10.29/bin/node /home/risingstack/PROJECT_NAME/app.js | |
| autostart=true | |
| autorestart=true | |
| environment=NODE_ENV=production | |
| stderr_logfile=/var/log/PROJECT_NAME.err.log | |
| stdout_logfile=/var/log/PROJECT_NAME.out.log |
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
| { | |
| "username": "XXX", | |
| "key": "XXX", | |
| "test_path": "test/angular/protractor.conf.js", | |
| "test_framework": "mocha", | |
| "browsers": [ | |
| { | |
| "browser": "firefox", | |
| "browser_version": "latest", | |
| "os": "OS X", |
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 koa = require('koa'); | |
| var app = koa(); | |
| app.use(function *responseTime(next){ | |
| var start = new Date; | |
| yield next; | |
| var ms = new Date - start; | |
| this.set('X-Response-Time', ms + 'ms'); | |
| }); |
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
| function* naturalNumbers(){ | |
| var n = 1; | |
| while (true){ | |
| yield n++; | |
| } | |
| } | |
| var numbers = naturalNumbers(); | |
| console.log (numbers.next()); |
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
| server.get('/', [ | |
| restify.bodyParser(), | |
| function (req, res, next) { | |
| console.log('done') | |
| res.send('okay ' + req.whatever) | |
| return next() | |
| } | |
| ]); |