$ mkvirtualenv test
$ python
Python 3.7.7 (default, Mar 18 2020, 09:44:23)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
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 | |
# https://gist.github.com/millerdev/e25014e4b886a5c619419d56b778a423 | |
# | |
# Usage: git flake8 [refname] [flake8 options] | |
if [ "${1:0:1}" = "-" ]; then | |
BRANCH=origin/master | |
else | |
BRANCH=${1:-origin/master} | |
shift | |
fi |
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.ext.couchdbkit import ( | |
Document, | |
DocumentSchema, | |
DictProperty, | |
IntegerProperty, | |
StringProperty, | |
) | |
class BlobMeta(DocumentSchema): | |
content_type = StringProperty() |
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
// ==UserScript== | |
// @name FogBugz Timesheet Hours | |
// @namespace fb-ts-hours | |
// @description Calculate and display hours worked on FogBugz timesheet popup. | |
// https://gist.github.com/millerdev/96c9b824b8902d4a5c19 | |
// @include http://manage.dimagi.com/* | |
// @include https://manage.dimagi.com/* | |
// @version 1 | |
// @grant none | |
// @run-at document-start |
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 | |
if [ -z "$1" ]; then | |
echo "Fetch GitHub pull request to a new branch" | |
echo "" | |
echo "usage: git pr PULL_REQUEST_NUMBER [BRANCH_NAME]" | |
exit; | |
fi | |
pr_num="$1" | |
if [ -z "$2" ]; then |
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
define sum term a next b | |
define iter a result | |
if | |
> a b | |
result | |
iter | |
next a | |
+ | |
term a | |
result |
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.
NewerOlder