Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
@vladdu
vladdu / emacs-indent-erlang
Last active August 29, 2015 13:56
Scripts to indent Erlang files from the command line
;;; File: emacs-indent-erlang
;;; adapted from http://www.cslab.pepperdine.edu/warford/BatchIndentationEmacs.html
;; this has to be set to the real path on your system
(add-to-list 'load-path "~/.emacs.d/elpa/erlang-20131025.6")
(load-library "erlang")
;; comment out the call to untabify if you want the mixed tabs and spaces
(defun emacs-indent-function ()
Vagrant.configure("2") do |config|
config.vm.network "forwarded_port", guest: 8091, host: 8091
config.vm.network "forwarded_port", guest: 8092, host: 8092
config.vm.network "forwarded_port", guest: 11210, host: 11210
config.vm.network "forwarded_port", guest: 9091, host: 9091
config.vm.network "forwarded_port", guest: 9200, host: 9200
config.vm.network "forwarded_port", guest: 9300, host: 9300
config.vm.network "forwarded_port", guest: 3133, host: 3133
end
@kafecho
kafecho / gist:2ba793c53f1c0cb15eca
Created July 8, 2014 17:50
Ansible playbook to install CouchDB from source on CentOS 6.5
---
- hosts: cd-servers
gather_facts: no
sudo: true
user: deploy
tasks:
- name: Install Couchdb dependencies
yum: name={{ item }} state=installed
with_items:
- autoconf
$(function() {
//run the accordion plugin, set height of sections to height of content
$("#accordion").accordion({ autoHeight: false });
});
;(function($) {
//write new sammy application
var app = new Sammy.Application(function() {
with(this) {
//corresponds to routes such as #/section/1
get('#/section/:section_id', function() { with(this) {
@anandology
anandology / coucheval.js
Created November 4, 2010 09:39
node.js script to process couchdb output
#!/usr/bin/env node
// Sample usage:
//
// $ curl -s 'http://127.0.0.1:15984/seeds/_all_docs?limit=10&include_docs=true' | coucheval.js 'console.log(JSON.stringify(row.doc));'
//
var carrier = require('carrier');
var stdin = process.openStdin();
@davisp
davisp / couch-node.ini
Created November 5, 2010 23:45
Configuring CouchDB (trunk) to have a node.js handler.
; Just drop this in /etc/couchdb/local.d/ and then
; start CouchDB normally.
; Here couch_node can be anything as long as it's uniq.
[os_daemons]
couch_node = /Users/davisp/tmp/couch-node.js
@jchris
jchris / index.html
Created April 27, 2011 16:54
jQuery CouchDB Hello World - to use this script, create the map view in futon and click Save As, then upload index.html as an attachment to _design document created with the view. browse to index.html to run the app.
<!DOCTYPE html>
<html>
<head><title>Tiny CouchApp</title></head>
<body>
<h1>Tiny CouchApp</h1>
<form id="new_message">
<label for="message">Message:</label>
<input type="text" name="message" value="">
<p><input type="submit" value="Save &rarr;"></p>
</form>
@dch
dch / compact_data.erl
Created June 24, 2011 01:57
useful examples using hovercraft
-module(compact_data).
-author('bob@cloudant.com').
-export([test_id_btree/1, test_db/4, test_view/1, test_view/4]).
-include("couch_db.hrl").
-define(ADMIN_USER_CTX, {user_ctx, #user_ctx{roles=[<<"_admin">>]}}).
test_id_btree(N) ->
@dch
dch / couchdocs_refresh.md
Created November 22, 2011 14:04
CouchDB Doc Refresh

Hi devs,

Over the last two years we've discussed improving our documentation, website, and wiki. We have discussed several designs ad mortem[1]…[5], and while the wiki has evolved substantially, not much else has changed.

This proposal summarises a consensus direction, and puts forward an approach that should allow us to improve docs in incremental stages with the usual peer review process for the actual patches/changes.

@dch
dch / couchdb-ec2-install.sh
Created November 30, 2011 12:30 — forked from msmith/couchdb-ec2-install.sh
Set up CouchDB on EC2
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"