Skip to content

Instantly share code, notes, and snippets.

View index.js
var concurrency = 100;
var http = require('http');
http.globalAgent.maxSockets = concurrency;
var AWS = require('aws-sdk');
var s3 = new AWS.S3();
for (var i = 0; i < concurrency; i++) {
s3.listBuckets(callback);
@willwhite
willwhite / parallel.js
Last active Dec 28, 2015
Simple async in JavaScript
View parallel.js
(function load(items, callback) {
var loaded = new Array(items.length);
var error;
items.forEach(function(item, i) {
getWidget(item, function(err, obj) {
error = error || err;
loaded[i] = err || obj;
if (loaded.filter(function(n) { return n; }).length === loaded.length) {
callback(error, loaded);
}
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.ie.css' rel='stylesheet' >
<![endif]-->
<style>
View index.html
<!DOCTYPE HTML>
<html>
<head>
<script src="http://www.webglearth.com/api.js"></script>
<style type="text/css" media="screen">
#earth_div {
width:600px;
height:400px;
border:1px solid gray;
padding:2px;
@willwhite
willwhite / index.html
Last active Dec 12, 2015
Add branding with MapBox.js
View index.html
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.ie.css' rel='stylesheet' >
<![endif]-->
<style>
body { margin:0; padding:0; }
View inbox0.md

inbox 0

game description:

You receive emails in an inbox. You are presented with a set of options for each email. Some options result in further emails being sent by your contacts. You choose options attempting to reach inbox zero.

progression ideas:

  • Emails and contacts get stickier and stickier as levels progress.
  • The metagame evolves from choosing correct responses to more advanced "knowledge management" work tasks, like determining the actual action items and next actions.
View index.html
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
View index.html
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
View index.html
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
View index.html
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.5/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.5/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.marker-popup { background-color: #eee; }
.marker-popup:after {