Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
@dch
dch / gist:2224339
Created March 28, 2012 06:42 — forked from amedeo/gist:820412
CouchDB and multiple tags

CouchDB and multiple tags

The problem

Given a set of documents, each associated with multiple tags, how can I retrieve the documents tagged with an arbitrary set of tags?

My solution

@dch
dch / couchdocs.md
Created April 17, 2012 21:23
Setting up Couchbase API documentation generator
@dch
dch / couch_windows_roadmap.md
Created April 19, 2012 12:37
CouchDB Windows Roadmap

This is where I'm thinking of going, in no particular order:

Underway

  • enable JS and ETAP test framework on Windows

Getting there

  • Makefile target for a trimmed OTP + Couch build & upx compression
  • MSI support (thanks in advance to Wohali!!)
  • add a GeoCouchified version with erica + kanso support built in
  • performance improvements c/- Microsoft's PGO
#!/usr/bin/env perl
use Modern::Perl;
use Mojo::UserAgent;
my $api = "https://api.github.com";
my $repo = "$api/repos/apache/couchdb";
################################################################################
# TODO
# modify AUTHORS directly
@dch
dch / erlgeom
Created May 30, 2012 06:27
geos nif compilation command
cl.exe
-LD -MD -Zi -Wall
-Ic:/erlang/lib/erl_interface-3.7.7/include
-Ic:/erlang/usr/include
-Iz:/source/erlgeom/deps/geos/include
..\c_src\erlgeom.c
-link
-LIBPATH:c:/erlang/lib/erl_interface-3.7.7/lib
-LIBPATH:c:/erlang/usr/lib
-LIBPATH:z:/source/erlgeom/deps/geos/lib
@dch
dch / gist:2891528
Created June 7, 2012 21:06 — forked from danfairs/gist:2891161
couchapp dispatch
def get_or_create_db(self, db_name, designs=ALL_DESIGNS):
from couchapp import dispatch
couchapp_dir = os.path.join(
settings.PROJECT_DIR, '..', '..', 'couchdb', 'tweet_counts'
)
server = couchdbkit.Server(uri=settings.COUCHDB_SERVER_URI,
resource_class=couchdb.RequestsResource)
db = server.get_db(db_name)
try:
db.info()
@dch
dch / rebar.config
Created June 8, 2012 13:38
rebar.config snippet to support Microsoft Windows Visual C++ without cygwin or msys shell presence
{port_env, [
%% add MS Visual C++ support to rebar on Windows
{"win32", "CC", "cl.exe"},
{"win32", "CXX", "cl.exe"},
{"win32", "LINKER", "link.exe"},
{"win32", "DRV_CXX_TEMPLATE",
"$CXX /c $CXXFLAGS $DRV_CFLAGS $PORT_IN_FILES /Fo$PORT_OUT_FILE"},
{"win32", "DRV_CC_TEMPLATE",
"$CC /c $CFLAGS $DRV_CFLAGS $PORT_IN_FILES /Fo$PORT_OUT_FILE"},
@dch
dch / t.erl
Created June 13, 2012 06:21 — forked from jlouis/t.erl
Percept example
-module(t).
-export([start/0, go/0, analyze/0, server/0]).
start() ->
percept:profile("test.dat", {t, go, []}, [procs]).
go() ->
Led = led:start(1),
Led1 = led:start(1),
@dch
dch / README
Created June 15, 2012 09:50 — forked from mojombo/README
Another mustache.erl example, this time showing off lists and asking for context in one of the view functions.
@dch
dch / bulk_docs.json
Created June 25, 2012 08:33
reducing doc.fields into an array using map keys
{
"all_or_nothing": true,
"docs": [
{
"_id": "doc1",
"device_id": "wub"
},
{
"_id": "doc2",
"device_id": "wub"