Skip to content

Instantly share code, notes, and snippets.

View joyrexus's full-sized avatar

J. Voigt joyrexus

View GitHub Profile
@joyrexus
joyrexus / README.md
Last active August 29, 2015 14:07 — forked from max-mapper/index.js
Prototype vs object style

Prototype style

function Person(first, last) {
    this.first = first;
    this.last = last;
}

Person.prototype.greet = function () {
@joyrexus
joyrexus / README.md
Last active April 27, 2022 00:49 — forked from tristanwietsma/auth.go
golang web examples
@joyrexus
joyrexus / README.md
Last active August 29, 2015 14:01 — forked from max-mapper/index.js
Load and render a remote CSV
@joyrexus
joyrexus / README.md
Last active August 29, 2015 14:00 — forked from mbostock/.block
Convert images to thumbnails

Finds PNG images in the source folder, and saves corresponding thumbnails to the target folder.

Use with gistup to create gists (and blocks) from the command line. The directory containing your gist files gets initialized as a git repo. See this tutorial for a quick overview.

For additional tips on generating block thumbnails, see this HOWTO.

@joyrexus
joyrexus / README.md
Last active December 29, 2015 08:29 — forked from max-mapper/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 remote source deletes a bunch of data,

@joyrexus
joyrexus / README.md
Last active February 19, 2024 17:15 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@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
@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
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 / 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: