Skip to content

Instantly share code, notes, and snippets.

View RyanBalfanz's full-sized avatar
🎯
Focusing

Ryan Balfanz RyanBalfanz

🎯
Focusing
View GitHub Profile
@anandkunal
anandkunal / list_predicates.py
Created March 8, 2010 07:07
Python List Predicates
from types import FunctionType
from UserList import UserList
class PredicateList(UserList):
def Exists(self, predicate):
"""Returns true if the predicate is satisfied by at least one list member."""
if type(predicate) is FunctionType:
for item in self.data:
if predicate(item):
return True
@onyxfish
onyxfish / fabfile.py
Created February 9, 2010 23:05
Chicago Tribune News Applications fabric deployment script
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"