Skip to content

Instantly share code, notes, and snippets.

View craiga's full-sized avatar
🤓

Craig Anderson craiga

🤓
View GitHub Profile
#!/usr/bin/env python
"""Get images from PhotoPrism and label them."""
import json
import logging
import tempfile
import time
from pprint import pformat
import boto3
@craiga
craiga / dice_girls.py
Last active May 10, 2022 15:29
Roll a bunch of dice a bunch of times.
"""
Roll a bunch of dice a bunch of times.
"""
import random
if __name__ == "__main__":
results = {i: 0 for i in range(5, 51)}
iterations = 0
@craiga
craiga / gist:7afd21ae23bce021788f4b1a345c0b16
Created August 4, 2020 12:47
Get an Ubuntu (or any other Linux) shell really quickly
docker run -it --rm ubuntu
@craiga
craiga / .tm_properties
Created December 18, 2019 11:33
Useful .tm_properties
excludeDirectories = "{$excludeDirectories,node_modules}"
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
pytest = "*"
pytest-mock = "*"
@craiga
craiga / historical_rolls.json
Created September 26, 2018 14:54
Rolls on Will of the Prophets before and including 10th September 2018
[
{
"model": "will_of_the_prophets.roll",
"pk": 7,
"fields": {
"created": "2018-06-29T12:30:17.330Z",
"modified": "2018-06-29T12:30:17.345Z",
"number": 1,
"embargo": "2018-02-19T00:00:00Z"
}

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@craiga
craiga / everything_installed_on_my_mac.sh
Last active April 23, 2018 15:05
An attempt at finding everything installed on my Mac. Required for a client's PCI compliance audit.
#!/usr/bin/env bash
echo "Applications manually installed by `whoami`:"
find /Applications -maxdepth 1 -user `whoami` | sed 's#/Applications/##'
echo ""
echo "Applications downloaded from App Store:"
# Adapted from http://osxdaily.com/2013/09/28/list-mac-app-store-apps-terminal/
find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 4 -print | sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##'
echo ""
@craiga
craiga / .coveragerc
Last active February 26, 2018 16:55
Coverage.py configuration for new Django projects
[run]
source = .
omit = manage.py, */wsgi.py, */migrations/*.py
@craiga
craiga / setup.cfg
Last active February 26, 2018 16:55
pycodestyle and pydocstyle configuration for new Django projects
[pycodestyle]
show-pep8 = 1
exclude = migrations
[pydocstyle]
match = (?!\d{4}_).*\.py