Fork of Mike Bostock's simplification demo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (push element) | |
(lambda (stack) | |
(list '() (cons element stack)))) | |
(define (pop) | |
(lambda (stack) | |
(let ((element (car stack)) | |
(new-stack (cdr stack))) | |
(list element new-stack)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
push = (element) -> (stack) -> | |
newStack = [element].concat stack | |
{value: element, stack: newStack} | |
pop = (stack) -> | |
element = stack[0] | |
newStack = stack.slice 1 | |
{value: element, stack: newStack} | |
bind = (stackOperation, continuation) -> (stack) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset=utf-8 /> | |
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script> | |
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } | |
#map { position:relative; width:960px;height:500px; } | |
</style> | |
<body> | |
<div id='map'></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
font: 10px sans-serif; | |
margin: 0; | |
padding: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Base | |
### | |
Provides default options, mixins, and custom events. | |
### | |
defaults: {} | |
constructor: (options) -> | |
@setOptions options |
Run like so:
node gist-clone-all.js username
You'll want to replace "username" with your own username.
This script clones using the push URL, so you should probably be the owner of the gists. You could also use this to clone someone else's gists, but in that case you may wish to edit the code to use gist_pull_url
instead.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SimpleHTTPServer | |
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def send_head(self): | |
"""Common code for GET and HEAD commands. | |
This sends the response code and MIME headers. | |
Return value is either a file object (which has to be copied | |
to the outputfile by the caller unless the command was HEAD, | |
and must be closed by the caller under all circumstances), or |
Drop in replace functions for setTimeout
and setInterval
that make use of requestAnimationFrame
.
See overview article and Paul Irish's earlier post.
Courtesty of Joe Lambert
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
OlderNewer