Skip to content

Instantly share code, notes, and snippets.

Daniel Miller millerdev

Block or report user

Report or block millerdev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

error_on_load column loader strategy for marking column properties that should not be loaded.

It is similar to the deferred loader strategy, but causes an exception to be raised if a column would be loaded by a subsequent (deferred) query. Use error_on_load(k) instead of defer(k) to construct a query option that will cause an exception if an attempt is made to load column k.

This is handy when constructing a query with deferred columns (to optimize load time). It will cause an exception to be raised in your program instead of causing dramatic slowdown due to many deferred-load queries when you accidentally marked a column as deferred that should be loaded eagerly. Fail early.

millerdev / lis.txt
Last active Aug 29, 2015
Lis - lisp dialect with semantic whitespace
View lis.txt
define sum term a next b
define iter a result
> a b
next a
term a
millerdev / git-pr
Last active Aug 29, 2015
git pr - Fetch GitHub pull request to a new branch
View git-pr
#! /bin/bash
if [ -z "$1" ]; then
echo "Fetch GitHub pull request to a new branch"
echo ""
echo "usage: git pr PULL_REQUEST_NUMBER [BRANCH_NAME]"
if [ -z "$2" ]; then
millerdev / FogBugz_Timesheet_Hours.user.js
Last active May 31, 2017
A Greasemonkey script to calculate and display hours logged on FogBugz timesheet popup.
View FogBugz_Timesheet_Hours.user.js
// ==UserScript==
// @name FogBugz Timesheet Hours
// @namespace fb-ts-hours
// @description Calculate and display hours worked on FogBugz timesheet popup.
// @include*
// @include*
// @version 1
// @grant none
// @run-at document-start
from dimagi.ext.couchdbkit import (
class BlobMeta(DocumentSchema):
content_type = StringProperty()
millerdev /
Last active Apr 22, 2017
Fix broken python and pdb interactive prompts in virtualenv with MacPorts python (using libedit instead of readline)
# Problem: borked readline in virtualenv
# Sample python interactive session:
# $ python
# Python 3.5.1 (default, Dec 29 2015, 10:15:41)
# [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
# Type "help", "copyright", "credits" or "license" for more information.
# >>> "type an expression and press enter"
# >>> 'type an expression and press enter'
millerdev / git-flake8
Last active Nov 8, 2017
Run fake8 on lines changed in current branch
View git-flake8
#! /bin/bash
# Usage: git flake8 [refname]
CURRENT=$(git rev-parse --abbrev-ref HEAD)
git diff $BRANCH...$CURRENT | flake8 --diff 1>&2
#! /usr/bin/env python3
# filter postgres logs to remove parameters of very large queries
import gzip
import re
import signal
import sys
# HACK prevent "BrokenPipeError: [Errno 32] Broken pipe" output on stderr
millerdev /
Last active Jan 3, 2018
Check for distinct replicas on riak cluster nodes for a given n_val
#! /usr/bin/env python
Check for replicas on distinct nodes within a riak cluster for a given n_val
import re
from argparse import ArgumentParser
from subprocess import check_output
millerdev /
Last active Jul 6, 2018
Generate XLSX file containing CommCare locations
#! /usr/bin/env python
"""Generate XLSX file containing CommCare locations
Requires: pip install openpyxl==2.2.5
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
You can’t perform that action at this time.