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
exports.create = function() { | |
var queue = [], | |
queueIndex = 0; | |
// I don't know if we want to save state, but it is easy to implement. | |
// I am just worried about overhead | |
var cachedValue = null; | |
var enqueue = function enqueue(func) { | |
queue.push(func); |
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 posix = require("posix"); | |
var sys = require("sys"); | |
var continuables = require('continuables'); | |
function writeFile(filename, value, mode) { | |
if (typeof value !== "string") { | |
throw new Error('Value must be a string'); | |
} | |
if (typeof mode === "undefined") { | |
mode = 0600; |
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
From 13ca65a21232b1f14b4b2213803f48884b00bb96 Mon Sep 17 00:00:00 2001 | |
From: Benjamin Thomas <benjamin@benjaminthomas.org> | |
Date: Mon, 22 Feb 2010 06:47:15 +0000 | |
Subject: [PATCH] Fix bug in process.mixin where deep copies would not work at all. | |
Before, doing this: | |
var sys = require("sys"); | |
var obj = { |
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
From c40555b5b2a0269b05ea17753c63567fd890dc26 Mon Sep 17 00:00:00 2001 | |
From: Benjamin Thomas <benjamin@benjaminthomas.org> | |
Date: Thu, 25 Feb 2010 20:38:04 +0000 | |
Subject: [PATCH] Add a 'resolve' method to require that returns the path to the module. | |
--- | |
doc/api.txt | 16 ++++++++++++++++ | |
src/node.js | 29 ++++++++++++++++++++++------- | |
test/simple/test-require-resolve.js | 15 +++++++++++++++ | |
3 files changed, 53 insertions(+), 7 deletions(-) |
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
From b3453495dec74897a36941c2b94f70861dd1deae Mon Sep 17 00:00:00 2001 | |
From: Benjamin Thomas <benjamin@benjaminthomas.org> | |
Date: Sat, 27 Feb 2010 08:32:55 +0000 | |
Subject: [PATCH] Stop sys.inspect from adding extra new lines for deep objects that are elements in an array. | |
A couple other small fixes: | |
If the keys of an object were all numeric they should be quoted. This | |
way, you can now hypothetically copy and paste the output into your code | |
(if the object doesn't contain any circular objects, deeply nested |
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
require "rubygems" | |
require "RMagick" | |
require "rvg/rvg" | |
rvg = Magick::RVG.new(150, 100) do |canvas| | |
canvas.background_fill = 'white' | |
txt = canvas.text(140, 20).styles( | |
:font_size => 28, | |
:text_anchor => "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
From c02c28574aa9ac7ec0b2751b94240e23860b85a4 Mon Sep 17 00:00:00 2001 | |
From: Benjamin Thomas <benjamin@benjaminthomas.org> | |
Date: Tue, 22 Jun 2010 15:27:10 -0600 | |
Subject: [PATCH] Start work on properly sandboxing modules | |
--- | |
lib/connect/index.js | 14 ++++++++------ | |
1 files changed, 8 insertions(+), 6 deletions(-) | |
diff --git a/lib/connect/index.js b/lib/connect/index.js |
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
def render_footnotes() | |
div = Element.new 'div' | |
div.attributes['class'] = 'footnotes' | |
div << Element.new('hr') | |
ol = Element.new 'ol' | |
@doc.footnotes_order.each_with_index do |fid, i| num = i+1 | |
f = self.footnotes[fid] | |
if f | |
li = f.wrap_as_element('li') |
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
From 401d78805122b8edbb56b1d3d54e7e81148cb94a Mon Sep 17 00:00:00 2001 | |
From: Benjamin Thomas <benjamin@benjaminthomas.org> | |
Date: Fri, 27 Aug 2010 02:50:12 -0600 | |
Subject: [PATCH] Fix process.nextTick so thrown errors don't confuse it. | |
If the function for a process.nextTick throws an error, then the | |
splice() never removes that function from the nextTickQueue array. This | |
makes sure the functions that have been run in _tickCallback get removed | |
regardless of errors. |
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
// this has been tested with HEAD node | |
// (http://github.com/ry/node/commit/57642e23497d5698aa4c5b8a44edff7b265c2283) | |
process.on('exit', function() { | |
console.log('hey'); | |
}); |
OlderNewer