Skip to content

Instantly share code, notes, and snippets.

Avatar
🦉

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
garthhumphreys / randomCountry.py
Created Oct 31, 2012
Print to screen a random country
View randomCountry.py
#!/usr/bin/python -tt
import random
def main():
"""
This script randomly prints to screen a soverign country from a list of 206 countries
"""
try:
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]
View pdf2swfBatch-poly2bitmap.sh
#!/usr/bin/env bash
# Requirements:
# pdf2swfBatch-poly2bitmap.sh needs to be installed in order to use this, see http://www.swftools.org/
# This is the advanced version of converting pdf to swfs by flattening pages to bitmap.
#
# Copyright (C) 2012 Garth Humphreys, http://garthhumphreys.com, http://konec.ky
#
# 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.