Skip to content

Instantly share code, notes, and snippets.

View ryanramage's full-sized avatar

Ryan Ramage ryanramage

View GitHub Profile
@ryanramage
ryanramage / error500-badarg-couch
Created February 2, 2012 21:36
error 500, bad arg
[Thu, 02 Feb 2012 21:17:29 GMT] [info] [<0.6215.0>] 127.0.0.1 - - GET /geo/_design/geo-stories/_show/recorder.jnlp?recording=com.eckoit.recording:1328217408189 200
[Thu, 02 Feb 2012 21:17:29 GMT] [error] [<0.6215.0>] Badarg error in HTTP request
[Thu, 02 Feb 2012 21:17:29 GMT] [info] [<0.6215.0>] Stacktrace: [{erlang,iolist_size,
[{[{<<"headers">>,
{[{<<"Content-Type">>,
<<"application/x-java-jnlp-file">>}]}},
{<<"body">>,
<<"<?xml version=\"1.0\" encoding=\"utf-8\"?><jnlp spec=\"1.5+\" codebase=\"http://localhost:5984/geo/_design/geo-stories/\" href=\"_show/recorder.jnlp?recording=com.eckoit.recording:1328217408189\"><information><title>Couch Audio Recorder</title><vendor>Eckoit Inc</vendor><homepage>http://eckoit.com</homepage><description kind=\"one-line\">A audio recorder for your couch.</description><icon
@ryanramage
ryanramage / error 500, bad arg, base64
Created February 3, 2012 01:21
error 500, bad arg, base64
[Fri, 03 Feb 2012 01:19:29 GMT] [info] [<0.1463.0>] 127.0.0.1 - - GET /geo/com.eckoit.recording%3A1328231965763 304
[Fri, 03 Feb 2012 01:19:29 GMT] [info] [<0.1588.0>] 127.0.0.1 - - GET /geo/_design/geo-stories/_show/recorder.jnlp?recording=com.eckoit.recording:1328231965763 200
[Fri, 03 Feb 2012 01:19:29 GMT] [error] [<0.1588.0>] Badarg error in HTTP request
[Fri, 03 Feb 2012 01:19:29 GMT] [info] [<0.1588.0>] Stacktrace: [{erlang,iolist_size,
[{[{<<"headers">>,
{[{<<"Content-Type">>,
<<"application/x-java-jnlp-file">>}]}},
{<<"base64">>,
<<"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48am5scCBzcGVjPSIxLjUrIiBjb2RlYmFzZT0iaHR0cDovL2xvY2FsaG9zdDo1OTg0L2dlby9fZGVzaWduL2dlby1zdG9yaWVzLyIgaHJlZj0iX3Nob3cvcmVjb3JkZXIuam5scD9yZWNvcmRpbmc9Y29tLmVja29pdC5yZWNvcmRpbmc6MTMyODIzMTk2NTc2MyZ1c2VyPWFkbWluIj48aW5mb3JtY
@ryanramage
ryanramage / Validations.txt
Created November 16, 2012 21:06
Validation Questions
is_numeric_year
is_numeric_month
is_numeric_day
is_valid_time
is_numeric_daysago
confirm_misoprostol
is_numeric_district
is_boolean_list
@ryanramage
ryanramage / gist:5041181
Last active December 14, 2015 06:18
Couch URLs

Couch URLs

A small node module to help deal with an arbitraty url pointing to couchdb.

Why?

The goal of this library is to take one couchdb url, and provide as much information as possible about the couchdb that url is pointing to. It uses with the node 'url' module, and possibly some url probing to determine useful couchdb endpoints. Some information might take time to determine, so those methods will have a callback. Once called though, information will be cached so second and subsequent access will be fast.

@ryanramage
ryanramage / gist:5140063
Created March 12, 2013 03:22
CORS fail/working on alternating requests
[info] [<0.2221.0>] 127.0.0.1 - - GET /dashboard/_design/dashboard/_view/dashboard_assets?reduce=false&include_docs=true 304
[error] [<0.2221.0>] function_clause error in HTTP request
[info] [<0.2221.0>] Stacktrace: [{string,to_lower,
[undefined],
[{file,"string.erl"},{line,468}]},
{couch_httpd_cors,maybe_apply_cors_headers,
2,
[{file,
"/Users/jan/Work/build-couchdb-mac/build-couchdb/git-build/https%3A%2F%2Fgit-wip-us.apache.org%2Frepos%2Fasf%2Fcouchdb.git%3A06c3f351f158f107a8293c7c6c9b2415b942f0e9/src/couchdb/couch_httpd_cors.erl"},
{line,219}]},
@ryanramage
ryanramage / gist:5143964
Created March 12, 2013 15:40
CORS alternating not working/working on the view /dashboard/_design/dashboard/_view/dashboard_assets.
[debug] [<0.148.0>] 'GET' /_session {1,1} from "127.0.0.1"
Headers: [{'Accept',"application/json"},
{'Accept-Charset',"ISO-8859-1,utf-8;q=0.7,*;q=0.3"},
{'Accept-Encoding',"gzip,deflate,sdch"},
{'Accept-Language',"en-US,en;q=0.8"},
{'Connection',"keep-alive"},
{'Content-Type',"application/json"},
{'Host',"localhost:5984"},
{"Origin","http://localhost:8000"},
{'Referer',"http://localhost:8000/"},
@ryanramage
ryanramage / couchdb.rb
Last active December 14, 2015 20:49 — forked from dch/README.md
require 'formula'
class Couchdb < Formula
homepage "http://couchdb.apache.org/"
url 'http://www.apache.org/dyn/closer.cgi?path=/couchdb/1.2.1/apache-couchdb-1.2.1.tar.gz'
sha1 '70dac0304cdc9f4313f524db583170a2c59e265c'
head 'https://git-wip-us.apache.org/repos/asf/couchdb.git'
devel do
@ryanramage
ryanramage / command-line.md
Last active December 15, 2015 05:09
Gardener command-line examples

basic format

gardener url

where url is the top level in the couchdb url space to look.

Examples:

@ryanramage
ryanramage / index.html
Created April 25, 2013 20:27
simple jam based index
<doctype html>
<html>
<div id="thing">
</div>
<script type="text/javascript" src="jam/require.js"></script>
<script type="text/javascript">
require(['jquery'], function($){
$('#thing').html('dsasad')
});
</script>
@ryanramage
ryanramage / live.js
Last active December 17, 2015 16:29
Couchapp Live reload. Simply add <script src="live.js"/> You must have two rewrites defined as follows: { "from": "_db/*" , "to" : "../../*" }, { "from": "_ddoc" , "to" : "" },
(function(){
var currentETag;
onLoad(function pageLoaded() {
console.log('starting live reload');
if (window.EventSource) return eventsource();
else setInterval(polling, 1500);
});