Skip to content

Instantly share code, notes, and snippets.

View bcattle's full-sized avatar

bcattle bcattle

View GitHub Profile
@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
"""
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: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/
@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 / 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
TWTRComposer *twitterComposer = [TWTRComposer new];
[twitterComposer setText:[NSString stringWithFormat:@"%@ #koowalla", self.taglineField.text]];
// TODO: this needs to be cropped to portrait
[twitterComposer setImage:self.videoThumbnail.image];
[twitterComposer setURL:[NSURL URLWithString:[videoUpload getShareURL]]];
if (twitterComposer != nil) {
[twitterComposer showFromViewController:self completion:^(TWTRComposerResult result){ // <- Attempt to present Exception here
// Main queue?
NSLog(@"");
}];
Bryans-Mac-2:~ bryan$ mediastreamvalidator https://s3-us-west-2.amazonaws.com/co.koowalla.oregon.video.published/fc909588-4cbc-4882-9f1c-6d879cd35dd4/160/hls.m3u8
mediastreamvalidator: Beta Version 1.1(140602)
Validating master playlist https://s3-us-west-2.amazonaws.com/co.koowalla.oregon.video.published/fc909588-4cbc-4882-9f1c-6d879cd35dd4/160/hls.m3u8
--------------------------------------------------------------------------------
https://s3-us-west-2.amazonaws.com/co.koowalla.oregon.video.published/fc909588-4cbc-4882-9f1c-6d879cd35dd4/160/hls.m3u8
--------------------------------------------------------------------------------
Playlist Syntax:
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
alias ls='ls -G'
alias ll='ls -Gl'
alias la='ls -Ga'
alias grep='grep --color'
source $HOME/z.sh
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
alias ls='ls -G'
alias ll='ls -Gl'
alias la='ls -Ga'
alias grep='grep --color'
@bcattle
bcattle / carthage_2015011018_134951_P7jK.sample.txt
Created November 18, 2015 21:57
Carthage 0.10.0, output of `sample` while process hung during build
Analysis of sampling carthage (pid 73423) every 1 millisecond
Process: carthage [73423]
Path: /usr/local/Cellar/carthage/0.10/bin/carthage
Load Address: 0x102c3d000
Identifier: carthage
Version: 0
Code Type: X86-64
Parent Process: bash [39865]
Date/Time: 2015-11-18 13:49:51.562 -0800