Skip to content

Instantly share code, notes, and snippets.

Drop ICE

Jan Lehnardt janl

Drop ICE
View GitHub Profile
View gist:223077
var till = "awesome";
View doppler-1.erl
fun({Doc}) ->
case {proplists:get_value(<<"id">>, Doc)} of
{undefined} ->
{Id} ->
Emit(Id, Doc);
_ ->
View mustache3.js
> rake
(in /Users/jan/Work/mustache.js)
'mustache array_of_strings should generate the correct html' FAILED
expected: "hello world \n",
got: "\n hello world \n" (using ==)
janl / gist:552288
Created August 26, 2010 21:24 — forked from mikeal/gist:552181
View gist:552288

Using CouchDB with node.js

First, get yourself a CouchDB! You can get a free hosted CouchDB in seconds or download a binary from the Couchio downloads page.

Next, install npm because all awesome node packages are in npm :)

Node has better support for HTTP than any language I've ever worked with and coincidentally CouchDB's interface is solely accessible via HTTP. First, let's just talk to CouchDB using an HTTP library and later we'll look at some higher level abstractions.

Talking to CouchDB using request

View gist:1058683
$query = $this->cb->queries("name");
Couchbase_QueryOptions $options = array(
"limit" => false,
"skip" => 0,
"descending" => false,
"stale" => false,
"group" => false,
"group_level" => 0,
"reduce" => true,
janl / gist:1064673
Created July 5, 2011 11:26
CouchDB Meetup Berlin July
View gist:1064673
we are going to meet at on Wednesday July 13th, 19:00.
We don't have a special talk yet, let me (@janl) know if you'd like to present anything.
In lieu of a talk, I'd suggest we'll have an open discussion round. I'm happy to answer any questions you might have around CouchDB or Couchbase.
Also, drinks afterwards!
View gist:1067238
$cb = new Couchbase;
$cb->addServer("localhost", 11211); // BC compat
$view = $cb->getView("ddocname", "viewname"); // returns Couchbase_View
$result = $view->getResult(); // returns Couchbase_ViewResult
foreach($result->rows AS $row) {
echo $row->value;
View gist:1116378
--- lib/gvc/ 2011-06-26 03:07:07.000000000 -0700
+++ lib/gvc/ 2011-06-26 03:07:27.000000000 -0700
@@ -55,7 +55,6 @@ libgvc_C_la_DEPENDENCIES += $(top_build
View gist:1180828
> cat Library/Formula/erlang.rb
require 'formula'
class ErlangManuals < Formula
url ''
md5 '357f54b174bb29d41fee97c063a47e8f'
class ErlangHtmls < Formula
url ''
View gist:1180850
# no args
brew install erlang
# no env var
# Lion
> uname -a
Darwin rose.local 11.0.1 Darwin Kernel Version 11.0.1: Thu Jul 28 02:01:39 PDT 2011; root:xnu-1699.23.4~1/RELEASE_X86_64 x86_64