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
""" | |
Distributor ID: Ubuntu | |
Description: Ubuntu 10.04 LTS | |
Release: 10.04 | |
Codename: lucid | |
Author: Adelein Rodriguez, adeleinr@gmail.com | |
Note: This is an adaptation from a fabric script presented here: | |
http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p.html | |
Summary: This script: |
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 fabric.api import env | |
env.use_ssh_config = True | |
env.forward_agent = True | |
env.roledefs = { | |
# key # hostname from config | |
'foo': ['foo.production'], | |
} |
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
{ | |
"directory": "src/_lib", | |
"json": "bower.json" | |
} |
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
class ThriftConnection(object): | |
def __init__(self, service, host, port): | |
socket = TSocket.TSocket(host, port) | |
self.transport = TTransport.TFramedTransport(socket) | |
protocol = TBinaryProtocolAccelerated(self.transport) | |
self.client = service.Client(protocol) | |
self.transport.open() | |
self.open_time = time.time() | |
self.access_time = self.open_time | |
self.pid = os.getpid() |
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 unittest | |
import functools | |
def check(sub, sup): | |
try: | |
if len(sub) == 1 and sup.index(sub[0]) >= 0: | |
return True | |
return check(sub[1:], sup[sup.index(sub[0]) + 1:]) | |
except: | |
return False |
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 flask import Flask, request, session, g, redirect, url_for | |
from flask import abort, render_template, flash | |
app = Flask(__name__) | |
app.config.from_object(__name__) | |
hosts = { | |
'b': "https://code.google.com/p/android/issues/" | |
's': "https://android.googlesource.com/", | |
'r': "https://android-review.googlesource.com/", |
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.sessions.backends.base import SessionBase, CreateError | |
from django.conf import settings | |
from django.utils.encoding import force_unicode | |
import redis | |
class SessionStore(SessionBase): | |
""" Redis store for sessions""" | |
def __init__(self, session_key=None): | |
self.redis = redis.Redis( |
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 re | |
import simplejson | |
from django.http import HttpResponse | |
from django.conf import settings | |
class JSONResponse(HttpResponse): | |
def __init__(self, request, data): | |
indent = 2 if settings.DEBUG else None |
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
/* Border & Vignette Setup */ | |
figure{ | |
position: relative; | |
display: block; | |
line-height: 0; | |
width: 500px; | |
height: 333px; | |
margin-bottom: 2em; | |
border: 1em solid #fff; |
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 logging | |
from optparse import make_option | |
from django.core.management.base import BaseCommand, CommandError | |
class Command(BaseCommand): | |
help = ("Invalidates portions of the queryset cache based on the app names" | |
" or models provided as arguments to the command. If no arguments " | |
"are provided, nothing is done. To clear the entire queryset " |
OlderNewer