Skip to content

Instantly share code, notes, and snippets.

View cpb's full-sized avatar
🏠
Working from home

Caleb Buxton cpb

🏠
Working from home
View GitHub Profile
@joeldrapper
joeldrapper / fingerprinting.rb
Created January 10, 2024 14:30
Rails request fingerprinting concern
# frozen_string_literal: true
module Fingerprinting
def full_fingerprint
generate_fingerprint(
ip_fingerprint,
browser_fingerprint
)
end
@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