wget http://download.virtualbox.org/virtualbox/4.1.16/VirtualBox-4.1.16-78094-OSX.dmg
open VirtualBox-4.1.16-78094-OSX.dmg
# double click .pkg to install
gem install vagrant --no-ri --no-rdoc
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
MIRROR = "http://packages.couchbase.com/releases/2.0.0-developer-preview-4" | |
VERSION = "couchbase-server-community_x86_64_2.0.0-dev-preview-4.deb" | |
# Vagrant: http://vagrantup.com | |
Vagrant::Config.run do |config| | |
# Use 64bit Ubuntu Lucid 10.04 | |
config.vm.box = "lucid64" |
A list of features that we want to see in CouchDB. Needs to be voted on so that it can become a priority queue. | |
User Facing Features | |
==================== | |
1. Conflicts are the rule, not the exception | |
All previous versions of CouchDB hide conflicts by default (selecting | |
an arbitrary but consistent winning revision). Expert users can find | |
and resolve conflicts. |
# replace PAPERTRAIL_HOSTNAME and PAPERTRAIL_PORT | |
# see http://help.papertrailapp.com/ for additional PHP syslog options | |
function send_remote_syslog($message, $component = "web", $program = "next_big_thing") { | |
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); | |
foreach(explode("\n", $message) as $line) { | |
$syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line; | |
socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, PAPERTRAIL_HOSTNAME, PAPERTRAIL_PORT); | |
} | |
socket_close($sock); |
<?php | |
if($currentCall->initialText) { | |
_log("*** User sent: " . $currentCall->initialText . " ***"); | |
$result = ask("", array("choices" => "[ANY]")); | |
} | |
else { | |
call($numberToCall, array("timeout" => 60, "channel" => "TEXT", "network" => "SMS")); | |
$result = ask("Respond with a digit, any digit.", array("choices" => "[1 DIGIT]")); | |
} |
#!/usr/bin/env coffee | |
Couchstore = require './couchstore' | |
db = new Couchstore 'cstest.couch' | |
create = (cb) -> | |
docset = ((db.newdoc 'doc' + x, {testkey: 'testval' + x}) for x in [1..20]) | |
db.save_multi docset, (err) -> | |
cb?() | |
dump = (fin) -> |
WOW! WatchJS became so popular that I've been pushed to migrate it to GitHub
https://github.com/melanke/Watch.JS
Just kidding
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
#!/usr/bin/env python | |
import sys | |
import couchdb | |
if __name__ == '__main__': | |
srcurl, desturl = sys.argv[1:] |