Skip to content

Instantly share code, notes, and snippets.

View joyrexus's full-sized avatar

J. Voigt joyrexus

View GitHub Profile
@joyrexus
joyrexus / state-monad.scm
Created May 28, 2013 15:45 — forked from igstan/state-monad.scm
State monad in scheme.
(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))))
@joyrexus
joyrexus / state-monad.coffee
Created May 28, 2013 15:46 — forked from igstan/state-monad.coffee
State monad in CoffeeScript
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) ->
@joyrexus
joyrexus / README.md
Last active December 21, 2015 10:49 — forked from mbostock/.block
UP/Munising zoom.
@joyrexus
joyrexus / index.html
Last active December 22, 2015 22:59 — forked from tmcw/index.html
Mapping migratory bird species
<!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>
@joyrexus
joyrexus / index.html
Last active December 23, 2015 20:09 — forked from tmcw/index.html
Unit Trig Circle
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
margin: 0;
padding: 0;
}
@joyrexus
joyrexus / base.coffee
Last active December 25, 2015 00:28 — forked from ryanflorence/Base.coffee
CoffeeScript base class
class Base
###
Provides default options, mixins, and custom events.
###
defaults: {}
constructor: (options) ->
@setOptions options
@joyrexus
joyrexus / README.md
Last active April 14, 2024 14:35 — forked from dergachev/GIF-Screencast-OSX.md
Create a GIF screencast

Convert a screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@joyrexus
joyrexus / README.md
Created October 31, 2013 01:49 — forked from mbostock/.block
The Gist to Clone All Gists

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.

@joyrexus
joyrexus / cors_server.py
Created November 2, 2013 04:39 — forked from enjalot/cors_server.py
Allow CORS with SimpleHTTPServer
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
@joyrexus
joyrexus / README.md
Last active February 1, 2023 08:51 — forked from joelambert/README
RAF replacements for setTimeout and setInterval

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