Skip to content

Instantly share code, notes, and snippets.

View BigBlueHat's full-sized avatar
🎩
building Web things

BigBlueHat BigBlueHat

🎩
building Web things
View GitHub Profile
@davidjrice
davidjrice / README.md
Created June 6, 2012 17:00
Vagrantfile for an Ubuntu lucid 32 or 64 bit VM with couchbase 2.0.0.dp4.1

Install Virtualbox

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

Install vagrant

gem install vagrant --no-ri --no-rdoc
@davidjrice
davidjrice / Vagrantfile
Created June 6, 2012 12:46
Ubunutu Lucid 64bit with Couchbase Server 2.0.0.dp4
# -*- 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"
@rnewson
rnewson / gist:2387973
Created April 14, 2012 21:31
CouchDB Future Feature List - Round 2
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.
@wickman
wickman / README.md
Created April 12, 2012 22:55
Python development in Pants (tutorial)

Python development using Pants

brian wickman - @wickman

[TOC]

Why use Pants for Python development?

Pants makes the manipulation and distribution of hermetically sealed Python environments

@troy
troy / send_remote_syslog.php
Last active April 6, 2023 18:19
Send UDP remote syslog message from PHP (RFC 3164)
# 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) ->
@melanke
melanke / README.md
Created January 17, 2012 17:32 — forked from eligrey/object-watch.js
watch the changes of some object or attribute
@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

@dustin
dustin / couch-clone.py
Created June 18, 2011 22:17
Make a couch have all the stuff another couch has.
#!/usr/bin/env python
import sys
import couchdb
if __name__ == '__main__':
srcurl, desturl = sys.argv[1:]