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
CoinsVote.find( {} ,"name vote ip submitted" , function (err, data) { | |
if (err) { | |
console.error(err); | |
return; | |
} | |
if (data === null) { | |
console.log("No results"); | |
return; | |
} | |
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 Promise = require('bluebird'), | |
Deque = require('double-ended-queue'); | |
module.exports = Queue; | |
function Queue(opts) { | |
opts = opts || { }; | |
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
[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 |
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 Transform = require('stream').Transform, | |
inherits = require('util').inherits; | |
var noBuf = new Buffer(0); | |
module.exports = factory; | |
function factory(start, end) { |
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 Thing(opts) { | |
opts = opts || { }; | |
Duplex.call(this, opts); | |
// not object mode on write (?) | |
this._readableState.objectMode = true; | |
this.upstream = false; | |
this.downstream = false; | |
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 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 () { |
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 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') |
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
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) { |
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
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) |
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 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>/) | |
} |