Skip to content

Instantly share code, notes, and snippets.

Avatar

J. Voigt joyrexus

View GitHub Profile
@igstan
igstan / state-monad.coffee
Created Apr 22, 2011
State Monad in CoffeeScript
View state-monad.coffee
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) ->
@joelambert
joelambert / README
Created Jun 1, 2011
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
View README
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@maxogden
maxogden / readme.md
Created Sep 28, 2011
SLEEP - syncable.org
View readme.md

Your API does REST, but can it SLEEP?

SLEEP (Syncable Lightweight Event Emitting Persistence) is an emerging standard for distributed data sync using HTTP and JSON. A generalized version of CouchDB's much lauded built-in replication, SLEEP extends the REST architecture to define a way in which databases can offer syncable JSON APIs that foster open data innovation by allowing developers to replicate entire databases over the net.


SLEEP comes from the Apache CouchDB project which is now widely known for it's multi-master streaming HTTP + JSON replication. This is possible in part because of the CouchDB _changes feed, which is a particular API that lets you see if there have been any changes made to the database since last time you synchronized. CouchDB can efficiently implement the _changes feed because of one subtle difference between it and most other databases: it stores a history of all changes that happen to the database, including deletes.

If you synchronize data from a remote source and then the

@btoone
btoone / curl.md
Last active Oct 24, 2020
A curl tutorial using GitHub's API
View curl.md

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@enjalot
enjalot / cors_server.py
Created Jun 10, 2012
Allow CORS with python simple http server
View cors_server.py
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
@ryanflorence
ryanflorence / Base.coffee
Created Sep 9, 2012
Base CoffeeScript Class, surprisingly useful.
View Base.coffee
################################################################################
# script: Base.coffee
# author: Ryan Florence <rpflorence@gmail.com>
# license: MIT-Style License
#
# A surprisingly useful base class for CoffeeScript. Inspired by my old
# friend, MooTools Class. Provides default options, mixins, and custom events.
class Base
defaults: {}
@mbostock
mbostock / .block
Last active Jun 30, 2020
The Gist to Clone All Gists
View .block
license: gpl-3.0
@mbostock
mbostock / .block
Last active Jun 16, 2019
Creating Thumbnails with GraphicsMagick
View .block
license: gpl-3.0
@dswwsd
dswwsd / mobile-meta-links.html
Created Nov 20, 2012
iOS Web App Configuration
View mobile-meta-links.html
View leap.json
{
"hands": [
{
"direction": [
0.187837,
0.097272,
-0.976745
],
"id": 3,
"palmNormal": [
You can’t perform that action at this time.