Skip to content

Instantly share code, notes, and snippets.

@koichik
koichik / gist:658319
Created November 1, 2010 15:12
node-handlersocket example
var hs = require('../lib/node-handlersocket');
var con = hs.connect();
con.on('connect', function() {
con.openIndex('test', 'EMPLOYEE', 'PRIMARY', [ 'EMPLOYEE_ID', 'EMPLOYEE_NO', 'EMPLOYEE_NAME' ],
function(err, index) {
index.find('=', 1, function(err, results) {
console.log(results[0]);
con.end();
});
@koichik
koichik / gist:700116
Created November 15, 2010 06:55
ECMAScript 5 compatibility test for Node
// http://kangax.github.com/es5-compat-table/
function test(s, expression) {
var result = expression ? 'Yes' : 'No';
console.log(s + ' : ' + result);
}
test('Object.create', typeof Object.create == 'function');
test('Object.defineProperty', typeof Object.defineProperty == 'function');
test('Object.defineProperties', typeof Object.defineProperties == 'function');
@koichik
koichik / gist:756270
Created December 27, 2010 16:35
[PATCH] Fix fs.WriteStream.prototype.end() with data
From 067dd138e9631f55eec9a237949da53030962a2c Mon Sep 17 00:00:00 2001
From: koichik <koichik@improvement.jp>
Date: Thu, 23 Dec 2010 18:37:28 +0900
Subject: [PATCH] Fix fs.WriteStream.prototype.end() with data
---
lib/fs.js | 10 +++++++++-
test/simple/test-fs-write-stream.js | 23 +++++++++++++++++++++++
2 files changed, 32 insertions(+), 1 deletions(-)
@koichik
koichik / gist:756290
Created December 27, 2010 16:58
[PATCH] correct the option's default values in fs docs
From 9fc5855b106046fb6cf6d5ffc44310715b4f92d5 Mon Sep 17 00:00:00 2001
From: koichik <koichik@improvement.jp>
Date: Tue, 28 Dec 2010 01:57:24 +0900
Subject: [PATCH] correct the option's default values in fs docs
---
doc/api/fs.markdown | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown
@koichik
koichik / 0001-fix-emitter.on-addListener-s-check-for-listener-leak.patch
Created January 17, 2011 10:33
[PATCH] fix emitter.on()/addListener()'s check for listener leak
From 843eb784adcb379ae6fc53af558cd94ce2f25f1c Mon Sep 17 00:00:00 2001
From: koichik <koichik@improvement.jp>
Date: Mon, 17 Jan 2011 19:30:43 +0900
Subject: [PATCH] fix emitter.on()/addListener()'s check for listener leak
Because the check is performed before a listener is added to an array,
the warning occurred with the 12th listener not the 11th listener.
example:
@koichik
koichik / 0001-fix-emitter.on-addListener-s-check-for-listener-leak.patch
Created January 17, 2011 12:18
fix emitter.on()/addListener()'s check for listener leak
From 9b36eb9474fb56391f63d5d29b3c4fbebb665541 Mon Sep 17 00:00:00 2001
From: koichik <koichik@improvement.jp>
Date: Mon, 17 Jan 2011 19:30:43 +0900
Subject: [PATCH] fix emitter.on()/addListener()'s check for listener leak
Because the check is performed before a listener is added to an array,
the warning occurred with the 12th listener not the 11th listener.
example:
@koichik
koichik / 0001-corrected-small-typos-http.patch
Created February 5, 2011 11:21
correct small typos for http.markdown
From cb32022a99347507234bf9bd455b2f34b066ad92 Mon Sep 17 00:00:00 2001
From: koichik <koichik@improvement.jp>
Date: Sat, 5 Feb 2011 20:07:28 +0900
Subject: [PATCH] corrected small typos
---
doc/api/http.markdown | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/doc/api/http.markdown b/doc/api/http.markdown
@koichik
koichik / 0001-corrected-small-typos-dgram.patch
Created February 5, 2011 11:22
correct small typos for dgram.markdown
From cb32022a99347507234bf9bd455b2f34b066ad92 Mon Sep 17 00:00:00 2001
From: koichik <koichik@improvement.jp>
Date: Sat, 5 Feb 2011 20:07:28 +0900
Subject: [PATCH] corrected small typos
---
doc/api/dgram.markdown | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/api/dgram.markdown b/doc/api/dgram.markdown
@koichik
koichik / 0001-Reproduce-process.stdout.end-throws-ENOTSOCK-error.patch
Created February 22, 2011 16:22
Fix process.stdout.end() throws ENOTSOCK error.
From 2949f5b7c104b0dae213b2de2c00a8dbf557418c Mon Sep 17 00:00:00 2001
From: koichik <koichik@improvement.jp>
Date: Wed, 23 Feb 2011 12:03:49 +0900
Subject: [PATCH 1/2] Reproduce process.stdout.end() throws ENOTSOCK error.
---
test/disabled/test-tty-stdout-end.js | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
create mode 100644 test/disabled/test-tty-stdout-end.js
@koichik
koichik / 0001-Fix-process.stdout.end-throws-ENOTSOCK-error.patch
Created February 22, 2011 16:30
Fix process.stdout.end() throws ENOTSOCK error.
From 1a8c385beb360b887c636c7500aa91602a37720c Mon Sep 17 00:00:00 2001
From: koichik <koichik@improvement.jp>
Date: Wed, 23 Feb 2011 01:28:09 +0900
Subject: [PATCH] Fix process.stdout.end() throws ENOTSOCK error.
---
src/node.js | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/node.js b/src/node.js