Skip to content

Instantly share code, notes, and snippets.

View kmcelwee's full-sized avatar
🌱

Kevin McElwee kmcelwee

🌱
View GitHub Profile
#!/usr/bin/env python
# pip install google-cloud-vision
# Follow quick start instructions to set up access to the API and authentication
# https://pypi.org/project/google-cloud-vision/
import glob
import io
import os
#!/bin/sh
# usage:
# $ export GITHUB_TOKEN=[token]
# $ rename-master-to-main.sh [org] [repo]
# generate GITHUB_TOKEN at https://github.com/settings/tokens/new with "repo" privileges
ORG="$1"
REPO="$2"
rm -rf $REPO
@dlyapun
dlyapun / gist:b06d4622ec7c34d4025b102a4ecb6d5c
Created November 22, 2017 15:20
Test Django admin actions save_model save_related
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.admin.sites import AdminSite
from gloodny.models import *
from django.forms.models import model_to_dict
class ChangeHistoryTests(TestCase):
fixtures = ['init_gloodny.json']
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE