I hereby claim:
- I am jdriscoll on github.
- I am jdriscoll (https://keybase.io/jdriscoll) on keybase.
- I have a public key whose fingerprint is AFDB 03DF A37F 194A B15B FEB6 A478 146D 9D51 5207
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#import <Foundation/Foundation.h> | |
void logIt(NSSet *set) { | |
NSLog(@"set: %@", set); | |
for (id object in set) { | |
NSLog(@"element with hash: %lu", (unsigned long)[object hash]); | |
} | |
} | |
int main(int argc, char *argv[]) { |
void arrayDiff(NSArray *array1, NSArray *array2, NSSet **objectsToAdd, NSSet **objectsToRemove, NSSet **objectsInBoth) { | |
if (array1 == nil) { | |
*objectsToAdd = [NSSet setWithArray:array2]; | |
*objectsToRemove = [NSSet set]; | |
*objectsInBoth = [NSSet set]; | |
} | |
else if (array2 == nil) { | |
*objectsToAdd = [NSSet set]; | |
*objectsToRemove = [NSSet setWithArray:array1]; |
#!/usr/bin/env sh | |
if git diff-index --quiet HEAD --; then | |
agvtool next-version -all | |
if [ $# -eq 1 ] | |
then | |
agvtool new-marketing-version "$1" | |
fi | |
-- all_things | |
SELECT * FROM things | |
-- thing_with_id | |
SELECT * FROM things WHERE id = :id |
# Unit testing for AppEngine | |
import os | |
import sys | |
import unittest | |
# Path to AppEngine library (platform specific) | |
SDK_PATH = os.path.realpath('/usr/local/google_appengine/') | |
EXTRA_PATHS = [ | |
SDK_PATH, |
from django.contrib.sites.models import Site | |
from django.core.urlresolvers import set_script_prefix | |
class ScriptPrefixMiddleware(object): | |
""" Sets up url resolvers to return absolute urls | |
""" | |
def process_request(self, request): | |
set_script_prefix("http://%s" % Site.objects.get_current().domain) |
import sys | |
import time | |
import urllib | |
import urllib2 | |
from django.core.management import setup_environ | |
# Make we're actually importing and activating the correct settings file here | |
import settings | |
setup_environ(settings) |
*.pbxproj -crlf -diff -merge |
from django.db import models | |
from imagekit.models import ImageModel | |
class Photo(ImageModel): | |
name = models.CharField(max_length=100) | |
original_image = models.ImageField(upload_to='photos') | |
num_views = models.PositiveIntegerField(editable=False, default=0) | |
class IKOptions: | |
# This inner class is where we define the ImageKit options for the model |