This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pbxproj -crlf -diff -merge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'hpricot' | |
MINUTES_BETWEEN_CHECKS = 15 | |
URLS = ['http://www.amazon.com/Programming-Ruby-1-9-Pragmatic-Programmers/dp/1934356085/', | |
'http://www.amazon.com/Ultimate-Hitchhikers-Guide-Galaxy/dp/0345453743/'] | |
HISTORY_COUNT = 50 | |
CURRENT_PRICE_ELEMENT = '.priceLarge' | |
prices = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
if git diff-index --quiet HEAD --; then | |
agvtool next-version -all | |
agvtool new-marketing-version "$1" | |
buildnum=`agvtool vers -terse` | |
git add . | |
git commit -m "New build: $1 ($buildnum)" | |
if [ "$2" = "--release" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { color: #222; font: normal normal 400 100%/1.5em georgia,serif; margin: 3em auto; padding: 0 3em; max-width: 46em } | |
a:link { color: #3366CC } | |
a:visited { color: #224488 } | |
blockquote,ol,p,ul { display: block; margin: 0 0 1.5em } | |
blockquote { border-left: solid .1em #E4E4E4; color: #919191; padding: 0 1.5em 0 1.4em } | |
code { font: normal normal 87.5%/1.71428571em monospace,sans-serif } | |
img { display: block; margin: 1.5em auto } | |
pre { display: block; font: normal normal 87.5%/1.71428571em monospace,sans-serif; margin: 1.71428571em } | |
h1,h2,h3,h4,h5,h6 { font-weight: 400 } | |
h1 { font-size: 225%; line-height: 1.3334em; margin: 0 0 .1666em } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"binary_file_patterns": | |
[ | |
"*.jpg", | |
"*.jpeg", | |
"*.png", | |
"*.gif", | |
"*.ttf", | |
"*.tga", | |
"*.dds", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)doStuff | |
// Do stuff on main thread | |
dispatch_async(self.queue, ^{ | |
// Do stuff on background thread | |
// self.queue is a serial queue stored as a property on this object | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
// Do stuff on main thread | |
}); |
OlderNewer