Skip to content

Instantly share code, notes, and snippets.

jmgibson71 /
Created February 15, 2021 14:40
Google vision document find
from pathlib import Path
from datetime import datetime
from import vision
LOG_PATH = Path("/home/me/logs")
PATH_TO_IMAGES = Path("/data/Pictures/Takeout")
client = vision.ImageAnnotatorClient()
halberom / 00_play.yml
Last active October 17, 2017 23:16
ansible - copy module returns different keys depending on change status - inconsistent
- hosts: localhost
gather_facts: False
connection: local
foo: bar
- name: first time - dest is changed, 'dest' is returned in results
# yes I'm using template, not copy, but the template action plugin calls the copy module...
rshk /
Created August 29, 2016 17:40
# Version tag needs to be dependent on all the files that will affect
# the generated image. Currently, only the dockerfile and Python
# requirements.
VERSION_TAG="$( sha1sum Dockerfile requirements/*.txt | sha1sum | cut -d' ' -f1 )"
echo "Image version: ${VERSION_TAG}"
echo "Commit SHA1: ${CIRCLE_SHA1}"
kosiara / setup_howto.txt
Last active April 21, 2017 03:42
Setup Facebook React-native sample (empty) project on Ubuntu
# author:
# @Bartosz Kosarzycki
sudo apt-get install npm
sudo npm install -g react-native-cli
sudo ln -s /usr/bin/nodejs /usr/bin/node
cd /home/user/your/project/path
react-native init AwesomeProject
cd AwesomeProject
bitmand / gist:c6b7332214d858130c52
Last active December 20, 2017 13:51
Salt Stack state for creating a uniq 2048-bit diffie hellman group
# Create a unique 2048 Diffie Hellman group
- name: openssl dhparam -out /etc/ssl/dhparams.pem 2048
- unless: test -f /etc/ssl/dhparams.pem
tobiasmcnulty /
Last active October 27, 2020 15:12
Django management command to generate factory-boy boilerplate factory definitions for all the models in a given app. The code is not intended to be usable right off the bat, it just provides a few sane defaults based on the structure of your models.
from import BaseCommand, CommandError
from django.db.models import get_models, get_app, fields
from django.db.models.fields import related
class Command(BaseCommand):
help = """Generate factory-boy factories for the given app"""
def handle(self, *args, **options):
assert len(args) == 1, 'Must specify app name as first and only argument'