Skip to content

Instantly share code, notes, and snippets.

View snopoke's full-sized avatar

Simon Kelly snopoke

View GitHub Profile
#!/bin/bash
# Simple script for simulating document conflicts in Cloudant / CouchDB
DEST="conflict_test"
DOC="doc_with_conflicts"
USERNAME="my-username"
read -s -p "Enter Password: " PASSWORD
HOST="$USERNAME.cloudant.com"
@snopoke
snopoke / creole_md.py
Created February 5, 2015 15:31
Creole to Markdown
import functools
import re
import sys
def header_repl(matchobj):
return "{} {}".format(len(matchobj.group(1)) * '#', matchobj.group(2))
def list_repl(matchobj, ordered=True):
@snopoke
snopoke / excel-query.png
Last active August 29, 2015 14:03
commcare-export demo
excel-query.png
@snopoke
snopoke / gitconfig
Last active December 29, 2015 08:39
gitconfig
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = red reverse
local = blue
remote = green
@snopoke
snopoke / find_view_references.sh
Last active December 21, 2015 01:38
Find usage count of CouchDB views
#!/bin/bash
# Basic script to find all references to CouchDB views in code.
# 1. Find all 'map.js' files
# 2. Based on some assumptions about the structure they are in
# generate the CouchDB view name.
# 3. Look for all references of that name in all ".py" files.
#
# Output saved to 'view_usage.csv'
OUTPUT=view_usage.csv
@snopoke
snopoke / index.html
Created February 21, 2013 07:02 — forked from darwin/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">A Comix Sample</tspan>
</label>
<actor t="translate(131,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|-6,79|-1,59">