Skip to content

Instantly share code, notes, and snippets.

View bcattle's full-sized avatar

bcattle bcattle

View GitHub Profile
@bcattle
bcattle / draw-color-test-image.py
Created June 9, 2015 03:14
Script that generates solid-color test images for when RGBA should really be BGRA...
#! /usr/bin/env python
"""
draw-color-test-image.py
Bryan Cattle
Draws a solid color test image using the supplied parameters
"""
import click
from PIL import Image
@bcattle
bcattle / boot2docker-ansible-setup.sh
Last active July 21, 2016 22:32
Bootstrap script to setup Boot2Docker to be run from Ansible
#!/bin/bash
# boot2docker-setup.sh
# Bryan Cattle
# 6/2/2015
# Configures boot2docker to run ansible scripts
if [[ $(boot2docker status) != "running" ]]; then
echo "Starting Boot2Docker"
boot2docker up
else
@bcattle
bcattle / gist:7613362
Created November 23, 2013 11:13
Cassandra links
http://www.youtube.com/watch?v=HdJlsOZVGwM&noredirect=1
http://planetcassandra.org/blog/post/cassandra-summit-2013-buy-it-now-cassandra-at-ebay-by-jay-patel
http://www.slideshare.net/planetcassandra/cassandra-21172880
http://www.ebaytechblog.com/2012/07/16/cassandra-data-modeling-best-practices-part-1/
http://www.ebaytechblog.com/2012/08/14/cassandra-data-modeling-best-practices-part-2/
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
@bcattle
bcattle / gist:2344020
Created April 9, 2012 14:52
Testing of user creation, includes session
class AnonymousSessionTestCase(TestCase):
def setUp(self):
# Initialize session
# see https://code.djangoproject.com/ticket/10899
# Apaprently, need to do this because nobody's logged in
# http://www.gregaker.net/2011/aug/29/testing_django_views_that_rely_on_session_variables/
# https://code.djangoproject.com/ticket/11475
from django.conf import settings