I hereby claim:
- I am tapmodo on github.
- I am khallman (https://keybase.io/khallman) on keybase.
- I have a public key ASCZaySVvMgIlUktbO90VOlMrP4SSIf6JeBk1Ya5K2bkxQo
To claim this, I am signing this object:
var mongoose = require('mongoose'); | |
var _ = require('underscore'); | |
mongoose.connect('mongodb://localhost/mydatabase'); | |
/** | |
* Define a schema and model (using schema) | |
*/ | |
var userSchema = mongoose.Schema({ |
server.get('/queue/pending',function(req,res,next){ | |
var page = req.params.page || 1; | |
page = page - 1; | |
var per_page = req.params.per_page || 50; | |
pool.getConnection(function(err,db){ | |
async.series([ | |
function(done){ | |
db.query( | |
'SELECT COUNT(*) AS total FROM '+ | |
'(SELECT DISTINCT event, venue, event_time FROM import_queue '+ |
// Array.map polyfill | |
if (Array.prototype.map === undefined) { | |
Array.prototype.map = function(fn) { | |
var rv = []; | |
for(var i=0, l=this.length; i<l; i++) | |
rv.push(fn(this[i])); | |
return rv; |
// map function | |
function array_map(arr,fn) { | |
var rv = []; | |
for(var i=0, l=arr.length; i<l; i++) | |
rv.push(fn(arr[i])); | |
return rv; | |
}; |
var _ = require('lodash'); | |
var debug = require('debug')('influx:batch'); | |
var SeriesWriter = function(db,options){ | |
this.db = db; | |
this.setOptions(options); | |
this.sending = false; | |
this.timer = null; | |
this.queue = []; | |
}; |
var es = require('event-stream'); | |
var fs = require('fs'); | |
var ldif = require('ldif'); | |
var Streamer = function(stream,options){ | |
var chain = stream, self = this; | |
options = ldif._extend({},Streamer.defaults,options); | |
// Normalize pipeline array | |
if (!Array.isArray(options.pipeline)) |
@import '../../bower_components/foundation-sites/scss/foundation'; | |
@include foundation-everything; | |
.container { | |
@include grid-row(16) { | |
.sidebar { @include grid-column(5); } | |
.main-content { @include grid-column(11); } | |
} | |
} | |
I hereby claim:
To claim this, I am signing this object:
const collection = [ | |
{ attributeValue: ["RED", "GOLD"] }, | |
{ attributeValue: ["16G", "32G", "64G"] }, | |
{ attributeValue: ["PLUS"] } | |
] | |
function cartesian(data) { | |
const f = (a,b) => [].concat(...a.map(d => b.map(e => [].concat(d, e)))) | |
const recurse = (a, b, ...c) => (b? recurse(f(a, b), ...c): a) | |
return recurse(...data) |