Skip to content

Instantly share code, notes, and snippets.

View natevw's full-sized avatar

Nathan Vander Wilt natevw

View GitHub Profile
[error] [<0.16764.1>] function_clause error in HTTP request
[info] [<0.16764.1>] Stacktrace: [{couch_httpd_external,
parse_external_response,
[{json,
<<"{\"json\": {\"allows_originals\": false, \"ok\": true}}">>}]},
{couch_httpd_external,
send_external_response,2},
{couch_db_frontend,do_db_req,2},
{couch_httpd,handle_request_int,6},
{mochiweb_http,headers,5},
diff --git a/test/test.js b/test/test.js
index 1a3fe00..3b1f7f5 100644
--- a/test/test.js
+++ b/test/test.js
@@ -1,13 +1,11 @@
/*jslint forin: true, onevar: true, immed: true */
(function () {
- process.env['NODE_PATH'] += ':' + __dirname + "/../lib";
-
@natevw
natevw / gist:1221349
Created September 16, 2011 06:22
Flickr upload sample
var pic = require('fs').readFileSync(FILE);
var f = require('fermata'), r = require('fermata/plugins/flickr');
f.registerPlugin('flickr', r);
f.flickr(CREDS).post({'Content-Type':"multipart/form-data"}, {photo:{name:"Helloworld.", type:"image/jpeg", data:pic}}, function (e,d) { console.log(e,d); });
import sys, json
class External(object):
def run(self):
line = sys.stdin.readline()
while line:
try:
response = self.process(json.loads(line.decode('utf_8')))
except Exception, e:
response = {'code':500, 'json':{'error':True, 'reason':"Internal error processing request (%s)" % e}}
@natevw
natevw / index.html
Created November 29, 2011 04:00
Hacked up version of <https://github.com/natevw/Metakaolin> polygon editor progress for <http://bl.ocks.org/1403349>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Metakaolin — Edit "{{ title }}"</title>
<script src="https://raw.github.com/mbostock/d3/817358a7b270c5fa80a317910eba20ff06555d4e/d3.min.js"></script>
<script src="https://raw.github.com/andyet/fermata/master/fermata.js"></script>
<script src="https://raw.github.com/simplegeo/polymaps/master/polymaps.min.js"></script>
<style>
@natevw
natevw / nosql outline.txt
Created November 30, 2011 23:02
"Why NoSQL"
"Why NoSQL" talk
(<!doctype society> developers meetup, half hour talk given 2011-Nov-30 @ 6:30pm)
How many of you have used a NoSQL data store?
How many of you have used SQL?
You can store pretty much anything in a SQL database, right? Except for files?
The relational model is very sound in theory, but in practice we're limited by things like: disk performance, memory size, server capacity, network reliability...
@natevw
natevw / gist:1681582
Created January 26, 2012 07:48
Sample geocreature "drawing" data for https://github.com/simplegeo/polymaps/issues/111
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": null,
"geometry": {
"type": "GeometryCollection",
"geometries": [
{
@natevw
natevw / gist:1805312
Created February 12, 2012 00:31
Failed replication from Couchbase "Single Serving" 2.0.0-dev4 into TouchDB TouchServ
Marker - Feb 11, 2012 4:28:48 PM
[info] [<0.20420.3>] Replication `"40f5bbc5079f2d2d754d458c23c7d2a7"` is using:
4 worker processes
a worker batch size of 500
20 HTTP connections
a connection timeout of 30000 milliseconds
socket options are: [{keepalive,true},{nodelay,false}]
[info] [<0.7674.2>] restarting replication `40f5bbc5079f2d2d754d458c23c7d2a7` at <0.20420.3> (`loctest` -> `http://localhost:59840/loctest/`)
[error] [emulator] Error in process <0.20429.3> with exit value: {function_clause,[{couch_api_wrap,'-update_docs/4-fun-1-',[400,[{"Content-Length","0"},{"Connection","close"},{"Date","Sun, 12 Feb 2012 00:28:50 GMT"},{"Accept-Ranges","bytes"}],null,[<<143554 bytes>>]]},{couch_replicator_worker,flush_docs,2},{couch_replicator_worker...
@natevw
natevw / manual_import.py
Created February 21, 2012 05:06
manual shutterstem import
# cd /Users/natevw/Library/Application\ Support/CouchbaseServer/ShutterStem/_attachments/scripts
#! /usr/bin/python
DB = "http://localhost:5984/photos"
SRC_ID = 'imgsrc-c393ded1a81e71d11859e937dd002ccd'
FOLDER = "/Volumes/FUJIFILM/DCIM"
from importer import Importer
@natevw
natevw / gist:1878200
Created February 21, 2012 19:06
build-couchdb fail on EC2
[ec2-user@ip-XX-XX-XX-XX ~]$ cat build-couchdb/nohup.out
(in /home/ec2-user/build-couchdb)
/home/ec2-user/build-couchdb/tasks/couchdb.rake:36: warning: (...) interpreted as grouped expression
autoconf2.13
env /home/ec2-user/build-couchdb/dependencies/spidermonkey/js/src/configure --prefix=/home/ec2-user/build-couchdb/build --without-x --disable-tests
Build CouchDB commit: 106ba9ded5ae939fe03d806d302c664ae7499466
creating cache ./config.cache
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu