Skip to content

Instantly share code, notes, and snippets.

View myndzi's full-sized avatar

Kris Reeves myndzi

  • Sigma Bold
  • Olympia, WA
View GitHub Profile
var toServer = csp.chan();
var throttled = throttle(toServer);
csp.go(function* () {
var msg;
while (true) {
msg = yield csp.take(toServer);
if (msg === csp.CLOSED) { return; }
console.log(msg);
var items = [huge array];
var concurrency = 5, i = items[0], x = items.length;
return Promise.map(new Array(concurrency), function next(val) {
if (i === items.length) { return; }
return getData(items[i++]).then(next);
});
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#################
#### MODULES ####
async.auto({
get_data: function(callback){
callback(null, 'data', 'converted to array');
},
make_folder: function(callback){
callback(null, 'folder');
},
write_file: ['get_data', 'make_folder', function(callback, results){
callback(null, 'filename');
}],
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();
cinema.locations = function () {
return parse.locationIds()
.map(function (locationId) {
return Promise.props({
postCode: parse.postCode(locationId),
movies: parse.movies(locationId)
});
});
};
resource.get('/attributes', {
summary: 'Returns all Attributes',
queryParams: { 'locale': 'string' },
returns: ['Attribute']
}, function (params, response) {
return attrs.fetchAll(params);
});
'use strict';
var Rx = require('rx'),
PassThrough = require('stream').PassThrough;
var helpers = require('./helpers');
var pt = new PassThrough();
var select = require('./rx-select');
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)
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)