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 request = require('request'); | |
var zlib = require('zlib'); | |
var websiteRequest = request('http://oliverjash.me/', { | |
headers: { | |
'Accept-Encoding': 'gzip,deflate' | |
} | |
}); | |
// Request, `http.ClientRequest` – writable stream, emits a `response` event |
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
/* | |
Usage: | |
Set a global/default layout with: | |
app.set('view layout', 'foo'); | |
Set a layout per-render (overrides global layout) with: | |
res.render('foo', { layout: 'bar' }); | |
Or disable a layout if a global layout is set with: | |
res.render('foo', { layout: false }); | |
If no layout is provided using either of the above methods, | |
then the view will be rendered as-is like normal. |
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
// First: `npm install agent-base streamsearch iconv-lite` | |
var http = require('http'), | |
net = require('net'), | |
EventEmitter = require('events').EventEmitter, | |
HTTPParser = process.binding('http_parser').HTTPParser, | |
parsers = http.parsers; | |
var agentBase = require('agent-base'), | |
StreamSearch = require('streamsearch'), |
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
// loc_parser: functions to parse the textual part of a LOC record | |
// stored in our DNS. The key function here is parseLOCString which | |
// should be passed a dns.LOC and a string containing the latitude, | |
// longitude etc. | |
// | |
// This is an implementation of RFC 1876. Read it for background as | |
// the format in a dns.LOC is slightly unusual. | |
// | |
// Copyright (c) 2014 CloudFlare, Inc. |
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
#!/bin/bash | |
replacements=( | |
"NanAsyncWorker/Nan::AsyncWorker" | |
"NanAsyncQueueWorker/Nan::AsyncQueueWorker" | |
"NanCallback/Nan::Callback" | |
"NanSetInternalFieldPointer/Nan::SetInternalFieldPointer" | |
"NanGetInternalFieldPointer/Nan::GetInternalFieldPointer" | |
"NanNewBufferHandle\\(([^;]+);/Nan::NewBuffer(\\1.ToLocalChecked();" | |
"(NanNew(<(v8::)?String>)?\\(\"[^\"]*\"\\))/\\1.ToLocalChecked()" |
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
# Doxyfile 1.5.5 | |
# This file describes the settings to be used by the documentation system | |
# doxygen (www.doxygen.org) for a project | |
# | |
# All text after a hash (#) is considered a comment and will be ignored | |
# The format is: | |
# TAG = value [value, ...] | |
# For lists items can also be appended using: | |
# TAG += value [value, ...] |
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 Class = require('./class').Class; // tested with v0.3.0-3-e1e4628 @ http://github.com/visionmedia/class.js | |
var LeafNode = new Class({ | |
constructor: function(order){ | |
this.order = order; | |
this.isLeafNode = true; | |
this.isInternalNode = false; | |
this.parentNode = 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
#! /bin/sh | |
# ------------------------------------------------------------------------------ | |
# SOME INFOS : fairly standard (debian) init script. | |
# Note that node doesn't create a PID file (hence --make-pidfile) | |
# has to be run in the background (hence --background) | |
# and NOT as root (hence --chuid) | |
# | |
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
# INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
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
/* | |
$ node bench.js | |
Threads_a_gogo JS thread -> 3039 (ms) 298607040 | |
Node's main JS thread -> 4677 (ms) 298607040 | |
Ratio: 1.54 times faster than main JS thread | |
New, separate VM -> 3065 (ms) 298607040 | |
Ratio: 1.01 times faster than new VM | |
*/ |
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
# HG changeset patch | |
# Parent 9b5795e98965ab4820a65ceeae0de644d0c5a9bb | |
Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one. | |
diff -r 9b5795e98965 libstdc++-v3/configure.host | |
--- a/libstdc++-v3/configure.host Sun Jul 26 15:42:47 2015 -0400 | |
+++ b/libstdc++-v3/configure.host Sun Jul 26 15:46:09 2015 -0400 | |
@@ -274,6 +274,13 @@ | |
os_include_dir="os/bsd/freebsd" | |
;; |
OlderNewer