Skip to content

Instantly share code, notes, and snippets.


Emelia Smith ThisIsMissEm

View GitHub Profile
View index.html
<!DOCTYPE html>
<script src=""></script>
<script src=""></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.item, .item-selected {
ThisIsMissEm / requireDir.js
Created Jul 4, 2012 — forked from TheDeveloper/requireDir.js
Node.js require directory
View requireDir.js
var fs = require('fs');
var Path = require('path');
function requireDir(dir){
var modules = {};
return Path.join(dir, name);
return fs.statSync(path).isFile();
ThisIsMissEm / naf.js
Created Jul 2, 2012 — forked from getify/naf.js
requestNextAnimationFrame() and cancelNextAnimationFrame()
View naf.js
// requires raf.js (polyfil)
var ids = {};
function requestId(){
var id;
while (!id || ids.hasOwnProperty(id)){
id = Math.floor(Math.random() * 1E9);
ThisIsMissEm / domTrees.js
Created Apr 28, 2011 — forked from jed/bookmarklet.js
dom tree caching performance: array v. linked list
View domTrees.js
function Node1(node) {
this.node = node;
var children = node.childNodes,
i = this.length = children.length;
while (i--) this[i] = new Node1(children[i]);
Node1.prototype.count = function() {
View slow.js
var fs = require('fs');
var s = fs.WriteStream("/tmp/__blah");
for (var i = 0; i < 1024 * 1024; i++) {
View stream.js = function (pathname, files, buffer, res, callback) {
(function streamFile(files, offset) {
var file = files.shift();
if (file) {
// Stream the file to the client
fs.createReadStream(path.join(pathname || '.', file), {
flags: 'r',
encoding: 'binary',
View gist:650822


We’re very happy to announce today the Async CTP for Visual Basic and C#.

Async CTP homepage:
Async discussion forums:
Asynchronous programming is something that helps make your UI more responsive, especially in applications that interact with databases or network or disk. It’s also used to make ASP servers scale better.

Until now, asynchronous programming has also been prohibitively hard, “not worth the investment”-hard. But with the Async CTP we’ve made asynchronous programming easy enough that developers should routinely consider asynchrony for most of their applications.

View gist:604007
// HOWTO: load LABjs itself dynamically!
// inline this code in your page to load LABjs itself dynamically, if you're so inclined.
(function (global, oDOC, handler) {
var head = document.getElementsByTagName("head")
, sOnLoad = "onload"
, sReadyState = "readyState"
, sDomContentLoaded = "DOMContentLoaded"
, sLoaded = "loaded"
, sComplete = "complete"
View gist:525784
var sys = require("sys")
, fs = require("fs")
, path = require("path")
, http = require("http")
, ws = require('../lib/ws');
var server = http.createServer(function(req, res){
if( req.url.indexOf("favicon") > -1 ){
sys.log("HTTP: "+req.socket.remotePort+", inbound request, served nothing, (favicon)");
View gist:525776
<!doctype html>
<%= title %>
<link href="//,300,400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/stylesheets/generic.css" type="text/css" />
<link rel="stylesheet" href="/stylesheets/visualize.css" type="text/css" />
<script src=""></script>