$ 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 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 | |
"""Download events form Sentry as CSV | |
https://gist.github.com/millerdev/3d0a541f90b9817c3be5dd9bffed288e | |
""" | |
import sys | |
import csv | |
from argparse import ArgumentParser | |
import requests |
This file contains 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 | |
# coding: utf-8 | |
""" | |
DEPRECATED moved to | |
https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/couch_sql_migration/management/commands/couch_domain_report.py | |
Categorize CommCare HQ domains needing couch -> sql migration of forms and cases | |
This script requires a domains.csv file, which can be obtained by following | |
these steps: |
This file contains 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 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
/* | |
Gnome 3 - based on https://blog.samalik.com/make-your-gnome-title-bars-smaller/ | |
https://securitronlinux.com/bejiitaswrath/how-to-make-the-title-bars-in-gnome-shell-much-thinner-than-the-default/ | |
sizes tweaked to make the close button bigger on 20.04 (not tested on earlier versions) | |
Copy or symlink to ~/.config/gtk-3.0/gtk.css | |
To change titlebar font from Bold to normal (maybe there is CSS for this too?): | |
$ gsettings get org.gnome.desktop.wm.preferences titlebar-font | |
'Ubuntu Bold 12' |
This example upgrades PostgreSQL 9.4 to 9.6. Substitute the versions you're upgrading to/from as needed below.
Run the following command to make a backup of all postgres data in a local file:
docker exec -i hqservice_postgres_1 pg_dumpall -U commcarehq | gzip > pg-backup.sql.gz
This file contains 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
# Pratt Parser in Python | |
# https://journal.stuffwithstuff.com/2011/03/19/pratt-parsers-expression-parsing-made-easy/ | |
# | |
# Works with input like `a + b`. | |
# The lexer does not support numbers (yet). | |
# | |
# https://gist.github.com/millerdev/03d881620dd0879d4347b0e971ff0be5 | |
from dataclasses import dataclass | |
OlderNewer