Skip to content

Instantly share code, notes, and snippets.

bpt-dmz 0 ~/node/stdin_issue > cat sub.js
var sys = require("../lib/sys");
process.stdio.open();
process.stdio.addListener("data", function (data) {
sys.puts("child: " + data);
});
bpt-dmz 0 ~/node/stdin_issue > cat test.js
var sys = require("../lib/sys");
var path = require('path');
var sub = path.join(path.dirname(__filename), 'sub.js');
function loadConfig() {
return posix
.cat('config.json')
(true, function(config) {
return (config instanceof Error)
? posix.cat('configuration.json')
: config;
})
(function() {
return JSON.parse(config);
function loadConfig() {
return posix.cat('config.json')(function(error, config) {
return posix.cat('configuration.json')
})(function(error, config) {
if (error) {
sys.puts("Can't load config");
// if there is an error then it has to be returned
// otherwise the error is thrown
return error;
}
process.mixin(require("./common"));
var tcp = require("tcp"),
sys = require("sys"),
http = require("http");
var PORT = 2143;
var errorCount = 0;
var eofCount = 0;
posix.cat('config.json')(function(error, config) {
sys.puts(config);
});
@ry
ry / promise.js
Created February 21, 2010 21:22
var events = require('events');
exports.Promise = function () {
exports.EventEmitter.call(this);
this._blocking = false;
this.hasFired = false;
this._values = undefined;
};
process.inherits(exports.Promise, events.EventEmitter);
@ry
ry / output
Created February 26, 2010 21:50
exports.constants =
[ [ 1, 'frameMethod' ]
, [ 2, 'frameHeader' ]
, [ 3, 'frameBody' ]
, [ 4, 'frameOobMethod' ]
, [ 5, 'frameOobHeader' ]
, [ 6, 'frameOobBody' ]
, [ 7, 'frameTrace' ]
, [ 8, 'frameHeartbeat' ]
, [ 200, 'replySuccess' ]
{}
open cb
create table callback{}
CPU ID FUNCTION:NAME
0 24835 sqlite3_prepare_v2:entry sqlite3_prepare_v2
0 24667 sqlite3_mutex_enter:entry sqlite3_mutex_enter
0 24667 sqlite3_mutex_enter:entry sqlite3_mutex_enter
0 24669 sqlite3_mutex_leave:entry sqlite3_mutex_leave
0 24667 sqlite3_mutex_enter:entry sqlite3_mutex_enter
0 24669 sqlite3_mutex_leave:entry sqlite3_mutex_leave
commit 47d65f65e879565e3f9038738e14da9d8812283c
Author: Micheil Smith <micheil@brandedcode.com>
Date: Tue Apr 13 02:27:32 2010 +1000
Moving the http.js, net.js FreeList to being standalone.
diff --git a/lib/freelist.js b/lib/freelist.js
new file mode 100644
index 0000000..a09fb4b
--- /dev/null
From ba3c0162d3d84ed293b7b667f99a034839ea7382 Mon Sep 17 00:00:00 2001
From: Ryan Dahl <ry@tinyclouds.org>
Date: Thu, 15 Apr 2010 12:19:24 -0700
Subject: [PATCH] unref gc_idle watcher
---
lib/http.js | 2 +-
src/node.cc | 20 +++++++++++++++++---
2 files changed, 18 insertions(+), 4 deletions(-)