Skip to content

Instantly share code, notes, and snippets.

View mranney's full-sized avatar

Matt Ranney mranney

View GitHub Profile
@mranney
mranney / emoji_sad.txt
Created January 30, 2012 23:05
Why we can't process Emoji anymore
From: Chris DeSalvo <chris.desalvo@voxer.com>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <AE459007-DF2E-4E41-B7A4-FA5C2A83025F@voxer.com>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
var sys = require('sys');
function swap32(src) {
return (
((src & 0xFF000000) >> 24) +
((src & 0x00FF0000) >> 8) +
((src & 0x0000FF00) << 8) +
((src & 0x000000FF) << 24)
);
}
GNU grep compiled on my MacBook Pro as "ggrep":
mranney-C02N31E1FD57:~$ time ggrep -E '^a(b|c)?' /usr/share/dict/words > /dev/null
real 0m0.020s
user 0m0.016s
sys 0m0.003s
mranney-C02N31E1FD57:~$ time grep -E '^a(b|c)?' /usr/share/dict/words > /dev/null
real 0m0.106s
Lately, I've been telling my kids about "yes, and..." and how that's funny.
Tonight, after a long and very drawn-out bedtime procedure, I laid down the law.
"OK guys, time to go to sleep."
"But daddy, we didn't get a bedtime drink."
I'm getting really frustrated at this point.
"Jesus, really?! It's 9:00. Come on.", I blurt out, more profane than I was intending.
http://hello.processing.org/display/#7965389
diff --git a/http_server/http_server.js b/http_server/http_server.js
index 505efad..368083c 100644
--- a/http_server/http_server.js
+++ b/http_server/http_server.js
@@ -442,7 +442,7 @@ function HTTP_Server(options) {
if (options.proxy_proto) {
this.server_type = "proxy";
// this.server = http.Server(new_client_wrapper);
- this.server = spdy.createServer(http.Server, { plain: true }, new_client_wrapper);
+ this.server = spdy.createServer(http.Server, { plain: true, timeout: 12 * 60 * 1000 }, new_client_wrapper);
mjr@mjr-01:~$ npm install sse4_crc32
npm http GET https://registry.npmjs.org/sse4_crc32
npm http 200 https://registry.npmjs.org/sse4_crc32
npm http GET https://registry.npmjs.org/sse4_crc32/-/sse4_crc32-1.1.3.tgz
npm http 200 https://registry.npmjs.org/sse4_crc32/-/sse4_crc32-1.1.3.tgz
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings
npm http 200 https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/nan/-/nan-0.6.0.tgz
dtrace -n 'syscall::writev:entry /execname == "node" && arg2 > 16/ { printf("iovcnt: %d", arg2); }' -n 'syscall::writev:return /execname == "node" && arg1 == -1 && errno == 22/ { printf("%s %s %d\\n", curpsinfo->pr_psargs, probefunc, errno); jstack(100, 8000); }'
1 10260 writev:entry iovcnt: 57
1 10261 writev:return node --nouse-idle-notification /voxer/server/node_router/node_router.js /voxer/ writev 22\n
libc.so.1`__writev+0x15
node`uv__write.part.5+0x18f
node`uv_write2+0x1b9
node`uv_write+0x35
node`_ZN4node10StreamWrap6WritevERKN2v89ArgumentsE+0x678
node`_ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE+0x157
<< internal code >>
@mranney
mranney / gist:7834019
Created December 6, 2013 23:38
Using DTrace to catch a really tricky bug in production
dtrace -n 'syscall::writev:entry /execname == "node" && arg2 > 3/ { printf("iovcnt: %d", arg2); }' -n 'syscall::writev:return /execname == "node" && arg1 == -1 && errno == 22/ { printf("%s %s %d\\n", curpsinfo->pr_psargs, probefunc, errno); jstack(100, 8000); }'
dtrace: description 'syscall::writev:entry ' matched 1 probe
dtrace: description 'syscall::writev:return ' matched 1 probe
1 10260 writev:entry iovcnt: 57
1 10261 writev:return node --nouse-idle-notification /voxer/server/node_router/node_router.js /voxer/ writev 22\n
libc.so.1`__writev+0x15
node`uv__write.part.5+0x18f
node`uv_write2+0x1b9
node`uv_write+0x35
node`_ZN4node10StreamWrap6WritevERKN2v89ArgumentsE+0x678
background(117,177,220);
stroke(31,134,46);
fill(31,134,46);
rect(450, 5, 10, 100);
rect(50, 200, 10, 100);
fill(56,42,237);