Skip to content

Instantly share code, notes, and snippets.

View garbados's full-sized avatar

DFB garbados

View GitHub Profile
@garbados
garbados / banana.md
Created March 1, 2018 04:59
Think you know how to eat a banana?

Think you know how to eat a bånånå? Think you're an experienced prø? Yéahhh . . . abou †hat. Scientists have something to tell you. Not to, uh, ruin ¥our day. But people are talking about you . . . about how you're eating ßananas the wrong way. They're whispering about this. Haven't you ever realized that? A lingering star∑ at the end of a con√ersation . . . peering around çorners at your office, or dorm, or empty hallways of a government building.

PEOPLE KNOW ALL ABOUT YOU. No one wants to have lunch with you because of this. Thousands of people are aware that you are eating bananas wrong now, and have been eating bananas wrong your entire life. Turned down by a cute boy or girl? It's because of this. Day after day passes with no information about your future? You cannot, or choose not to, eat bananas the right way. Why can't you just apologize?

THERE'S NO EXCUSE. Scientists announced this change a while ago. God, when was it? Weeks, moπths now? Where have you been while this information disseminated? Were

@toddbluhm
toddbluhm / app.js
Created July 11, 2013 06:09
This is a modified version of the Cloudant reverse-proxy solution for setting up a CORS Couchdb request. The version uses the nano framework instead of request framework which allows for the use of cookie authentication rather than just hardcoded basic auth. This solution was tested using Pouchdb in the browser, reverse-proxied back through a no…
var forward = require('./middleware/forward.js'); //reverse proxy
var nano = require('connect-nano');
// instantiate `app` et al
//After app.use(express.cookieParser());
app.use(nano('https://username.cloudant.com')),
app.use(forward(/\/db\/(.*)/));
@dplepage
dplepage / gist:2024129
Created March 12, 2012 19:26
Subclassing Flask
import flask
class HelloApp(flask.Flask):
def __init__(self, import_name):
super(HelloApp, self).__init__(import_name)
self.route("/hello")(self.hello)
def hello(self):
return "Hello, world!"
@max-mapper
max-mapper / readme.md
Created September 28, 2011 02:01
SLEEP - syncable.org

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