This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fritzy=# select * from authors; | |
id | value | |
----+-------------------------- | |
1 | {"name": "Nathan Fritz"} | |
(1 row) | |
fritzy=# select * from books; | |
id | value | |
----+---------------------------------------------------- | |
1 | {"title": "Ham, and Eating It", "author": 1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE document_store (key CHAR(100) PRIMARY KEY, bucket CHAR(100), value JSON); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE pgdown_default(key text, bucket text, value json, indexed json); | |
CREATE OR REPLACE FUNCTION pgdown_replace_row(tname TEXT, bucket TEXT, key TEXT, value TEXT, indexed JSON) RETURNS VOID AS | |
$$ | |
BEGIN | |
LOOP | |
-- first try to update the key | |
EXECUTE 'UPDATE ' | |
|| quote_ident(tname) | |
|| ' SET value = ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util'); | |
var stream = require('stream'); | |
function WriteData() { | |
stream.Writeable.call(this, {highWaterMark: 20, objectMode: true}); | |
} | |
util.inherits(WriteData, stream.Writeable); | |
WriteData.prototype._write = function (obj, _, next) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Exclusive = require('exclusive'); | |
var uuid = require('node-uuid'); | |
function LevelLog(db_, wrap_opts) { | |
function DB() { } | |
//assiging the parent db as the prototype | |
//makes anything not overridden accessable | |
DB.prototype = db_; | |
var db = new DB; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Game(somediv) { | |
this.stage = new PIXI.Stage(0xFFFFFF); | |
this.renderer = PIXI.autoDetectRenderer(800, 600); | |
somediv.appendChild(this.renderer.view); | |
this.lastframe = Date.now(); | |
this.rocket = new Rocket(this); | |
this.update(); | |
} | |
Game.protototype.update = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
brew tap homebrew/nginx | |
brew install nginx | |
brew install lua-nginx-module | |
brew install go | |
brew install etcd | |
git clone [email protected]:fritzy/confd.git | |
cd confd | |
go get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reverseString(sin) { | |
sin = new Buffer(sin); | |
for (var idx = 0, l = sin.length; idx < l; idx++) { | |
sin.writeUInt8(0xFF - sin.readUInt8(idx), idx); | |
} | |
return sin; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var levelup = require('levelup'); | |
var multilevel = require('multilevel'); | |
var net = require('net'); | |
var util = require('util'); | |
var argv = require('optimist') | |
.default({host: 'localhost', port: 8087, listen: 8091}) | |
.usage('Usage: level2riak --host 127.0.0.1 --port 8087 --listen 8091 --bucket somebucket' | |
+ '\n\nlevel2riak uses the riak protocol buffer and pb port (default: 8087)' | |
+ '\nConnect with a multilevel client.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var levelup = require('levelup'); | |
var db = levelup('riak://localhost:8087/somebucket', { db: require('riakdown'), valueEncoding: 'json'}); | |
var multilevel = require('multilevel'); | |
var net = require('net'); | |
net.createServer(function (con) { | |
con.pipe(multilevel.server(db)).pipe(con); | |
}).listen(3000); |