Skip to content

Instantly share code, notes, and snippets.

View tjbrennan's full-sized avatar

Taylor Brennan tjbrennan

  • San Francisco, CA
View GitHub Profile

Shanghai-Style Hong Shao Rou

Ingredients

  • Pork Belly with Skin
  • 1 stick of Cinnamon
  • 3 Star Anise
  • 3 Ginger pieces
  • 2 Bay Leaves
  • About 2 spoonfuls of Dark Soy Sauce
@tjbrennan
tjbrennan / README.md
Last active August 29, 2015 14:15 — forked from milroc/README.md

d3.unconf example gist. Fork it here.

// Long-polling chat server + client.
var chats = [];
require('http').createServer(function(req, res) {
if (/\/c/.test(req.url)) return res.end(chats.join('\n'));
var m = req.url.split('=');
if (m.length > 1) chats.unshift(m[1].replace(/\+/g, ' '));
res.end('<html><body><form><input name="m"></form><pre></pre><script>'
+ 'var r=new XMLHttpRequest;(function e(){r.open("GET","/c",true);r.send();r.onreadystatechange=function(){if(r.readyState==4){document.getElementsByTagName("pre")[0].innerHTML=r.responseText;setTimeout(e,1e3)}}})();document.forms[0].m.focus()'
+ '</script></body></html>')
}).listen(parseInt(process.env.PORT, 10)|| 3000);