Skip to content

Instantly share code, notes, and snippets.


Garth Humphreys garthhumphreys

View GitHub Profile
View gist:8916205
# Work in progress
# Need to test in virtualbox
sudo apt-get install libxml2-dev libxslt-dev
sudo apt-get install python-lxml
virtualenv --distribute venv
source venv/bin/activate
garthhumphreys /
Created Oct 31, 2012
Print to screen a random country
#!/usr/bin/python -tt
import random
def main():
This script randomly prints to screen a soverign country from a list of 206 countries
View NSLog-format-specifiers.txt
%@ Object
%d, %i signed int
%u unsigned int
%f float/double
%x, %X hexadecimal int
%o octal int
%zu size_t
%p pointer
%e float/double (in scientific notation)
View RGBColor.h
/* rgb color */
#define RGBCOLOR(r,g,b) \
[UIColor colorWithRed:r/256.f green:g/256.f blue:b/256.f alpha:1.f]
/* rgb color with alpha (rgba) */
#define RGBACOLOR(r,g,b,a) \
[UIColor colorWithRed:r/256.f green:g/256.f blue:b/256.f alpha:a]
#!/usr/bin/env bash
# Requirements:
# needs to be installed in order to use this, see
# This is the advanced version of converting pdf to swfs by flattening pages to bitmap.
# Copyright (C) 2012 Garth Humphreys,,
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
You can’t perform that action at this time.