Skip to content

Instantly share code, notes, and snippets.

View startling's full-sized avatar

Lizzie Dixon startling

View GitHub Profile

TLDR version, if you have homebrew

xcode-select --install ; brew tap homebrew/versions ;   brew tap homebrew/dupes \
brew install apple-gcc42 ; brew link apple-gcc42 

NB: the xcode-select --install is how you (re)install the mavericks xcode 5 CLI tools, you HAVE to do that. Either way, you should make sure you have CLI tools installed.

NB: apple-gcc42 is quite old, but doesn't require a build from source (so it can work right away). Those who have a bit more patience and want a more modern GCC can use brew install gcc48 or the like (though the build may take a while)

@startling
startling / data.py
Created July 28, 2012 04:24
dictionary
topics = { "Spell" : ["Love", "Revenge", "Etc"],
"Prayer" : ["Zeus", "Legba", "Circe"] }
choice = raw_input().rstrip()
print topics[choice]
@startling
startling / program.py
Created April 25, 2012 22:31 — forked from els-pnw/error
program.py
products = {
"sam": "Subscription Asset Manager - Subscription Management",
"headpin": "Headpin - Open Source Subscription Management",
"katello", "Katello - Open Source Systems Management"
}
class Page(object):
"Base class for all Pages"
def __init__(self, testsetup):
"Initializer."
class Looper(object):
def __init__(self, function):
function(self)
@Looper
def my_looper(self):
self.height = 130
self.width = 120
# This is the API everything inherits from
class GenericApplicationConfigurationClass(object):
def __init__(self):
self.looper = Looper()
# And the small, configuration-only script I intend to write for each specific case
class MyClass(object):
def __init__(self, c):
c.width = self.calculate_width()
c.height = self.calculate_height()
def calculate_width(self):
return 10
def calculate_height(self):
return 20
#include <glib.h>
typedef struct {
GSList *stack;
} MachineState;
static void machine_push (MachineState *state, int v);
static int machine_pop (MachineState *state);
/* pushes an operand onto the operand stack */
def test():
for x in range(10):
def func():
print x
yield func
for f in test():
f()