Skip to content

Instantly share code, notes, and snippets.

View rckclmbr's full-sized avatar

Joshua Braegger rckclmbr

View GitHub Profile
# Download and extract the image
# This image can be any one of:
# https://developers.google.com/android/nexus/images
curl "https://dl.google.com/dl/android/aosp/occam-kot49h-factory-02e344de.tgz" | tar -xz
cd occam-kot49h
unzip image-occam-kot49h.zip
# Download simg2img.py, for creating a mountable image from system.img
FROM ubuntu:14.04
RUN apt-get -qq update; \
apt-get install -q -y python-dev python-pip python-flup python-setuptools \
supervisor git-core libpq-dev supervisor \
libmemcached-dev python-pylibmc \
libgeos-c1 python-gdal curl \
libgd3 libgeoip1 libxslt1.1 \
software-properties-common python-gevent; \
add-apt-repository ppa:nginx/development; \
FROM ubuntu:14.04
MAINTAINER Josh Braegger "josh@gaiagps.com"
RUN apt-get -qq update
RUN apt-get install -q -y python-dev python-pip python-flup python-setuptools \
supervisor git-core libpq-dev supervisor \
libmemcached-dev python-pylibmc \
libgeos-c1 python-gdal curl \
libgd3 libgeoip1 libxslt1.1 \
software-properties-common python-gevent; \

Keybase proof

I hereby claim:

  • I am rckclmbr on github.
  • I am rckclmbr (https://keybase.io/rckclmbr) on keybase.
  • I have a public key whose fingerprint is F1C2 F2CE 478F 623A B403 4823 25DE A61F 4B93 D467

To claim this, I am signing this object:

def env_var(key, default=None):
"""Retrieves env vars and makes Python boolean replacements"""
val = os.environ.get(key, default)
if val == 'True':
val = True
elif val == 'False':
val = False
elif val == 'None':
val = None
return val
@rckclmbr
rckclmbr / index.html
Created August 27, 2012 20:47
I recently saw a post on Facebook that had close to 1 million posts from people about how many squares were in a grid (the one programmed here). Only 15% of people got the number of squares contained correct. So I programmed this to help show them.
<div id="boxes_count"></div>
<div id="wrapper">
<canvas width="400" height="400" id="canvas"></canvas>
</div>
@rckclmbr
rckclmbr / gist:3783292
Created September 25, 2012 17:26
Backs up a Google AppEngine database to S3 in daily, weekly, and monthly increments
#!/usr/bin/env python
# Prereqs:
#
# * appcfg.py (appengine) -- https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python
# * boto
#
# Usage:
#
@rckclmbr
rckclmbr / mkappenginevenv.sh
Created September 25, 2012 17:54 — forked from rmyers/mkappenginevenv.sh
Setup virtual env for appengine
#!/bin/bash
#
# Build a virtual environment suitable for running appengine.
# This uses virtualenvwrapper to make the virtual environment.
# Which you can activate with 'workon appengine'
#
# Everyone loves one-liners!
# Mac one-liner:
# $ curl -s https://raw.github.com/gist/3783418 | bash
#
#!/usr/bin/env python
import requests
import json
COLUMNS = [
{
"id":154418878,
"name":"Case Number",
"dataTypeName":"text",
#!/usr/bin/env python3
import csv
import gzip
import os.path as path
from time import time, sleep
from urllib.request import urlretrieve
from geopy.distance import vincenty
import pyflightdata