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
/tmp/homebrew-flusspferd-0.9-gMPE/flusspferd-0.9/vendor/arabica/include/DOM/Simple/DocumentFragmentImpl.hpp:45: error: ‘construct_from_utf8’ is not a member of ‘Arabica::SAX::Taggle<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Arabica::default_string_adaptor<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >’ | |
make[3]: *** [plugins/xml/CMakeFiles/xml_PLUGIN.dir/parser.cpp.o] Error 1 | |
make[3]: *** Waiting for unfinished jobs.... | |
/usr/local/include/boost/fusion/container/vector/vector.hpp: In function ‘void __static_initialization_and_destruction_0(int, int)’: | |
/usr/local/include/boost/fusion/container/vector/vector.hpp:147: note: ‘<anonymous>.boost::fusion::vector<boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>::vec’ was declared here | |
make[2]: *** [plugins/xml/CMakeFiles/xml_PLUGIN.dir/all] Err |
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
Get(/^\/myroute/, function(request) { | |
... | |
}); | |
Post(/^\/myroute/, function(request) { | |
... | |
}); | |
Head(/^\/myroute/, function(request) { | |
... |
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 sys = require("sys"); | |
// read from stdin | |
process.stdio.open(); | |
process.stdio.addListener("data", function (data) { | |
sys.debug(data); | |
}); | |
process.stdio.addListener("close", function () { | |
sys.debug("closing"); |
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 tcp = require("tcp"), | |
http = require("http"), | |
sys = require("sys"); | |
http.createServer(function (req,res) { | |
sys.debug("from http server: connect"); | |
res.sendHeader(200, {}); | |
res.sendBody("hi"); | |
for (var i in req.headers) { | |
res.sendBody("\nHEADER "+i+": "+req.headers[i]+"\n"); |
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 sys = require("sys"), sax = require("../sax-js/lib/sax"); | |
parser = sax.parser(false); | |
sax.EVENTS.forEach(function (ev) { | |
parser["on" + ev] = function (n) { sys.puts(ev + " " + sys.inspect(n)); }; | |
}); | |
parser.write("<span>Welcome,</span> to monkey land").close(); | |
/* | |
$ node sax-test.js | |
opentag { |
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
Object.deepCreate = function deepCreate (o) { | |
var n = Object.create(o); | |
for (var i in o) if (o.hasOwnProperty(i) && typeof o[i] === "object" && o[i]) { | |
n[i] = Object.deepCreate(o[i]); | |
} | |
return n; | |
}; | |
o = {foo:{bar:1}}; | |
n = Object.deepCreate(o); |
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
commit d7ad45c231b369289f2b7ee20e494ae2b693fafb | |
Author: isaacs <[email protected]> | |
Date: Thu Feb 18 20:50:43 2010 -0800 | |
Setting to undefined does not remove in-ness. Delete the stat watcher so that it won't be found upon trying to re-stablish a watch. | |
Otherwise, this fails: | |
process.watchFile("/etc/passwd", function () {}); | |
process.unwatchFile("/etc/passwd"); |
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 when (p, cb) { | |
if (p instanceof Promise) p.addCallback(function (d) { cb(d) }); | |
else cb(p); | |
} | |
function AJSGItoEJSGI (app) { return function (req) { | |
var res = app(req); | |
when(res, function (res) { | |
if (res.body.forEach) { |
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
// regular-style javascript | |
function foo (a,b,c,d) { | |
if (a > c) throw new Error("c must be teh greetest"); | |
return a * b * c * d; | |
} | |
function b (d,e) { | |
if (e === d) throw new Error("must not be equal"); | |
return e - d; | |
} |
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( request, response ) { | |
/* Determine Encoding */ | |
var isGzip = /gzip/.test( request.headers['accept-encoding'] ) ? true : false; | |
/* Extract Scope */ | |
var sandbox = /\.+(.+)\.sb+/.exec( request.headers.host ); | |
if ( sandbox !== null ) { | |
var scope = sandbox[1]; |