This file contains 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 events = require('events'); | |
var Queue = function () { | |
var self = this; | |
this.array = Array.prototype.slice.call(arguments); | |
this.offset = 0; | |
this.lock = false; | |
this.process = function () { | |
// Do some processing here... |
This file contains 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 executeEventQueue() { | |
eventEmitter.emit(LISTENERS.executeApplicationEvents); | |
process.nextTick(executeEventQueue); | |
} | |
executeEventQueue(); |
This file contains 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
Buffer.prototype.view = Buffer.prototype.slice; | |
Buffer.prototype.slice = function (start, end) { | |
var buffer = new Buffer(end - start); | |
this.copy(buffer, 0, start, end); | |
return buffer; | |
}; |
This file contains 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
#include <v8.h> | |
using namespace v8; | |
static Handle<Value> Do (const Arguments &args) { | |
HandleScope scope; | |
Local<Function> callback = Local<Function>::Cast(args[0]); | |
callback->Call(Context::GetCurrent()->Global(), 0, NULL); |
This file contains 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/buffer.js b/lib/buffer.js | |
index ecb25b7..f4d03bb 100644 | |
--- a/lib/buffer.js | |
+++ b/lib/buffer.js | |
@@ -328,3 +328,18 @@ Buffer.prototype.slice = function (start, end) { | |
return new Buffer(this.parent, end - start, +start + this.offset); | |
}; | |
+ | |
+// indexOf(code|char, start, end) |
This file contains 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
#include <v8.h> | |
#include <string.h> | |
#include <node_buffer.h> | |
using namespace v8; | |
using namespace node; | |
static Handle<Value> FindDelimiter (const Arguments &args) { | |
HandleScope scope; |
This file contains 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
#include <v8.h> | |
#include <node_buffer.h> | |
using namespace v8; | |
using namespace node; | |
static Handle<Value> FindDelimiter (const Arguments &args) { | |
HandleScope scope; | |
Local<Object> buffer_obj = args[0]->ToObject(); |
This file contains 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
#include <v8.h> | |
#include <node_buffer.h> | |
#include <string.h> | |
#include <stdio.h> | |
using namespace v8; | |
using namespace node; | |
static unsigned int pos = 0; |
This file contains 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 orm = require('biggie-orm'); | |
orm.connect(); | |
var Deck = orm.model('Deck', { | |
name: {type: 'string'}, | |
has_many: ['slides'], | |
indexes: ['name'] | |
}); |
This file contains 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
#!/usr/bin/env node | |
var stdin = process.openStdin(), | |
path = require('path'), | |
code = ''; | |
__dirname = process.cwd(); | |
__filename = 'stdin'; | |
module.filename = path.join(__dirname, __filename); |