This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
[color "branch"] | |
current = red reverse | |
local = blue | |
remote = green |

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from errand_boy.transports.unixsocket import UNIXSocketTransport | |
from subprocess import PIPE | |
form = """<h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns:orx="http://openrosa.org/jr/xforms" xmlns="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:vellum="http://commcarehq.org/xforms/vellum">\n\t<h:head>\n\t\t<h:title>Newborn Treatment</h:title>\n\t\t<model>\n\t\t\t<instance>\n\t\t\t\t<data xmlns:jrm="http://dev.commcarehq.org/jr/xforms" xmlns="http://openrosa.org/formdesigner/1904f15bf570b2e0169690416432f6103621b155" uiVersion="1" version="1" name="Newborn Treatment">\n\t\t\t\t\t<debug>\n\t\t\t\t\t\t<classification_infection_debug/>\n\t\t\t\t\t\t<classification_poids_debug/>\n\t\t\t\t\t\t<classification_occular_debug/>\n\t\t\t\t\t\t<classification_vih_debug/>\n\t\t\t\t\t\t<classification_malnutrition_debug/>\n\t\t\t\t\t\t<alimentation_qc_debug/>\n\t\t\t\t\t\t<alimentation_qd_debug/>\n\t\t\t\t\t\t<alimentation_qf_debug/>\n\t\t\t\t\t\t<a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop function if exists make_new_user(TEXT); | |
create function make_new_user(p_username TEXT, user_id OUT INTEGER ) as $$ | |
begin | |
INSERT INTO users (username, shard, last_updated) VALUES (p_username, (hashtext(p_username)&15), now()) | |
RETURNING users.user_id INTO user_id; | |
end; | |
$$ language plpgsql; | |
drop function if exists get_all_users_with_db(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import datetime | |
import os | |
from datadog import initialize, api | |
from collections import defaultdict | |
options = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dimagi.utils.chunked import chunked | |
from corehq.apps.locations.dbaccessors import user_ids_at_locations | |
from corehq.apps.es.aggregations import * | |
from corehq.apps.es import FormES | |
from corehq.apps.locations.models import * | |
from elasticsearch.exceptions import * | |
from iso8601 import iso8601 | |
domain = 'domain' |
OlderNewer