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
//load modules | |
//var app = require('express')(); | |
var http = require('http'); | |
//var server = new http.Server(); | |
var zlib = require('zlib'); | |
var JsonLoader = require('./index'); | |
var server = http.createServer(function (req, res) { | |
function next(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
'use strict'; | |
var child_process = require('child_process'); | |
var Promise = require('bluebird'); | |
module.exports = Promise.method(function spawn(command, args, cwd) { | |
if (!command || !cwd) { | |
throw new Error("Both command and working directory must be given, not " + command + " and " + cwd); | |
} | |
if (args && !args.every(function (arg) { |
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
{ penguinfrk: 784, | |
piper: 720, | |
Chew: 710, | |
goonerJimmy: 673, | |
Chopin: 664, | |
Blitz: 579, | |
shinanai: 522, | |
YaoHe: 485, | |
sonic: 480, | |
yida9900: 470, |
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
setup complete. npm loves you! | |
npmE is now up and running! | |
[root@npm1 etc]# npme start | |
-bash: /usr/bin/npme: No such file or directory |
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 Promise = require('bluebird'); | |
var db = ... pg connection ... | |
var bcrypt = require('bcrypt'); | |
Promise.promisifyAll(db, { suffix: '$' }); | |
Promise.promisifyAll(bcrypt, { suffix: '$' }); | |
function hashPassword(plaintext) { | |
return bcrypt.genSalt$(10) |
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
https://github.com/Reactive-Extensions/RxJS/blob/v2.3.18/dist/rx.all.js#L9048 | |
https://github.com/CSSLint/parser-lib/blob/v0.2.5/release/node-parserlib.js#L905 | |
https://github.com/CSSLint/parser-lib/blob/v0.2.5/release/node-parserlib.js#L417 | |
/home/myndzi/backitup/node_modules/rx/dist/rx.all.js:9048 | |
throw e; | |
^ | |
Error | |
at /home/myndzi/backitup/node_modules/parserlib/lib/node-parserlib.js:417:25 | |
at Object.<anonymous> (/home/myndzi/backitup/node_modules/parserlib/lib/node-parserlib.js:905:3) | |
at Module._compile (module.js:460:26) |
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
'use strict'; | |
var Rx = require('rx'), | |
PassThrough = require('stream').PassThrough; | |
var helpers = require('./helpers'); | |
var pt = new PassThrough(); | |
var select = require('./rx-select'); |
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
resource.get('/attributes', { | |
summary: 'Returns all Attributes', | |
queryParams: { 'locale': 'string' }, | |
returns: ['Attribute'] | |
}, function (params, response) { | |
return attrs.fetchAll(params); | |
}); |
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
cinema.locations = function () { | |
return parse.locationIds() | |
.map(function (locationId) { | |
return Promise.props({ | |
postCode: parse.postCode(locationId), | |
movies: parse.movies(locationId) | |
}); | |
}); | |
}; |
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
module.exports = function (app) { | |
if (!app.config.get('app.logRequests')) { return; } | |
var mountPaths = app.config.get('swag.mountPaths'); | |
var apiRE = new RegExp('^'+mountPaths.api.replace('/', '\\/')+'\\/'); | |
app.use(function (req, res, next) { | |
if (!apiRE.test(req.url)) { return next(); } | |
var start = process.hrtime(); |