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
CoinsVote.find( {} ,"name vote ip submitted" , function (err, data) {
if (err) {
console.error(err);
return;
}
if (data === null) {
console.log("No results");
return;
}
'use strict';
var Promise = require('bluebird'),
Deque = require('double-ended-queue');
module.exports = Queue;
function Queue(opts) {
opts = opts || { };
[kris.re@krisre foo]$ node bar
double queue 100000 29
double queue 200000 54
reverse queue 100000 18
reverse queue 200000 64
queue 100000 38
queue 200000 49
'use strict';
var Transform = require('stream').Transform,
inherits = require('util').inherits;
var noBuf = new Buffer(0);
module.exports = factory;
function factory(start, end) {
function Thing(opts) {
opts = opts || { };
Duplex.call(this, opts);
// not object mode on write (?)
this._readableState.objectMode = true;
this.upstream = false;
this.downstream = false;
function Thing(socket) {
this.socket = socket;
this.socket.once('end', this.cleanup.bind(this));
this.handlers = [ ];
}
Thing.prototype.onDisconnect = function (cb) {
this.handlers.push(cb);
}
Thing.prototype.cleanup = function () {
'use strict';
var Promise = require('bluebird');
module.exports = function (app) {
var c = app.config, log = app.log;
return Promise.promisify(app.listen)(
c.get('port'),
c.get('ip')
diff --git a/lib/interface.js b/lib/interface.js
index 83b5c3d..a3263fc 100644
--- a/lib/interface.js
+++ b/lib/interface.js
@@ -21,12 +21,6 @@ Target.prototype._formatQuery = function(sql, bindings, tz) {
return SqlString.format(sql, bindings, true, tz);
};
-// Create a new instance of the `Runner`, passing in the current object.
-Target.prototype.then = function(onFulfilled, onRejected) {
1 failing
1) Integration Tests Dialect: sqlite3 Inserts should handle simple inserts:
Error
at QueryBuilder_SQLite3.Target.(anonymous function) (/home/local/DARKSIDE/kris.re/knex/lib/interface.js:9:5689)
at QueryBuilder_SQLite3.qb.then (/home/local/DARKSIDE/kris.re/knex/test/integration/logger.js:63:37)
at QueryBuilder_SQLite3.qb.then (/home/local/DARKSIDE/kris.re/knex/test/integration/logger.js:71:35)
at QueryBuilder_SQLite3.qb.then (/home/local/DARKSIDE/kris.re/knex/test/integration/logger.js:71:35)
at QueryBuilder_SQLite3.qb.then (/home/local/DARKSIDE/kris.re/knex/test/integration/logger.js:71:35)
var foo = new Thing(),
bar = new Thing();
foo.process(function (stream) {
return {
date: stream.splice('<div class="date">', '</div>'),
city: stream.splice('<h3 class="city">', '</h3>'),
url: stream.splice('<div class="item">', '</div>')
.match(/<a href="(.*?)">(.*?)<\/a>/)
}