Skip to content

Instantly share code, notes, and snippets.

View willwhite's full-sized avatar

Will White willwhite

View GitHub Profile
@willwhite
willwhite / index.html
Created October 8, 2011 19:59
Modest Maps layer switcher demo
<html>
<head>
<!-- NOTE: Do not use these URLs in production. If they ever change your site will break.
Instead, download the files to your web server and host them there. -->
<script src='https://raw.github.com/mapbox/wax/v3.0.8/ext/modestmaps.min.js' type='text/javascript'></script>
<script src='https://raw.github.com/mapbox/wax/v3.0.8/dist/wax.mm.js' type='text/javascript'></script>
<script src='http://code.jquery.com/jquery-1.6.4.min.js' type='text/javascript'></script>
</head>
<body>
<h3>Choose a layer</h3>
@willwhite
willwhite / parallel.js
Last active December 28, 2015 19:19
Simple async in JavaScript
(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);
}
<!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>
<!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 December 12, 2015 03:48
Add branding with MapBox.js
<!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; }
@willwhite
willwhite / inbox0.md
Created December 10, 2012 20:05 — forked from yhahn/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.
<!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>
<!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>
<!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>
<!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 {