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
def test_recipe_ref_creation(self): | |
# There are 7 recipes in the fixtures plus 3 cookbooks containing 3, 2 | |
# and 1 recipes, respectively, which adds up to 15 initial | |
# RecipeReferences (because two those cookbook recipes belong to | |
# another user'saccount, which leads to one RecipeReference under that | |
# cookbook and one under the AccountRef for that account, plus one | |
# more reference for a recipe duplicated in two cookbooks). | |
refs = cookbook_models.RecipeReference.all().fetch(1000) | |
self.failUnlessEqual(len(refs), 15) |
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
""" | |
Code for solving the Greplin Challenge | |
http://challenge.greplin.com/ | |
""" | |
from itertools import chain, combinations | |
# Level one | |
def palindrome(s): | |
"""Find the largest palindrome in the given string.""" |
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
;;; fic-mode.el --- Show FIXME/TODO/BUG/KLUDGE in special face only in | |
;;; comments and strings | |
;;-------------------------------------------------------------------- | |
;; | |
;; Copyright (C) 2010, Trey Jackson <bigfaceworm(at)gmail(dot)com> | |
;; Original source: http://www.emacswiki.org/emacs/fic-mode.el | |
;; | |
;; Minor modifications by Will McCutchen <[email protected]> | |
;; | |
;; This file is NOT part of Emacs. |
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
@with_appcfg | |
def prep_local_shell(): | |
"""Prepares a local shell by adjusting the datastore paths according to | |
the settings and setting up the appropriate stubs.""" | |
import settings | |
args = dev_appserver_main.DEFAULT_ARGS.copy() | |
# If a custom datastore directory is requested, modify the args for each | |
# of the datastore paths | |
if hasattr(settings, 'DATASTORE_DIR'): | |
ddir = settings.DATASTORE_DIR |
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
Wilbur - | |
It's 2010 now. People are twatting left and right. We have telephones that | |
can plot traffic in real time. So HTML email, while not thematically true to | |
the to it's DARPANET precursor, is now the defacto standard. I don't plan to | |
be quitting it any more than I'm planning on cutting off my fingers with a | |
butcher knife. | |
W |
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
"""Generates a giant Daily Drop Cap poster. Get the images into the dropcap/ | |
subdir with something like: | |
curl -O http://jhische.com/dailydropcap/[A-Z]-[1-12].jpg | |
Depends on pictogrid and PIL. | |
""" | |
import glob | |
import re |
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
GAE=~/lib/google-app-engine | |
DJANGO=~/lib/django | |
WEBTEST=~/lib/WebTest | |
export PYTHONPATH=$GAE:$GAE/lib/antlr3:$GAE/lib/yaml/lib:$GAE/lib/webob:$GAE/lib/ipaddr:$GAE/lib/fancy_urllib:$DJANGO:$WEBTEST:~/workspace:$PYTHONPATH |
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: "James Barker" <[email protected]> | |
To: <[email protected]> | |
Subject: Free heroin shipping! | |
Date: Tue, 5 Apr 2011 10:00:42 -0800 | |
FREE HEROIN SHIPPING! | |
1. Heroin, in liquid and crystal form. | |
2. Rocket fuel and Tomohawk rockets (serious enquiries only). | |
4. New shipment of cocaine has arrived, buy 9 grams and get 10th for free. |
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
Subject: Re: Message from Tax Data Systems Web Service Contact Page | |
From: Will McCutchen <[email protected]> | |
To: Tax Data Systems Support <[email protected]> | |
I'm sorry to bug you, but are there any other avenues of support for | |
your products? So far, the "send an email and wait" method of suport | |
leaves something to be desired, especially for a product on which we | |
will be spending thousands of dollars. | |
Thanks, |
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 os | |
from google.appengine.ext import db | |
def fixkey(key): | |
"""Takes a db.Key (or its string form) and checks to see if it is tied to | |
the current application. If not, the key is recreated for the current | |
application and returned as a string. | |
""" | |
app_id = os.environ.get('APPLICATION_ID') | |
if isinstance(key, basestring): |