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
# Prevent pip from doing anything unless you're inside an activated virtualenv. | |
PIP=/usr/local/bin/pip | |
function pip { | |
if [ "x$VIRTUAL_ENV" = 'x' ]; then | |
echo "No virtualenv activated; bailing." | |
else | |
$PIP -E `basename $VIRTUAL_ENV` "$@" | |
fi | |
} |
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
#!/bin/sh | |
# Allows you to use both VirtualBox and KVM virtualization on the same machine. | |
# I replaced the commands to start both VB and KVM with this script. | |
# you'll also need to disable both services from starting automatically. | |
# sudo update-rc.d qemu-kvm disable | |
# sudo update-rc.d vboxdrv disable | |
case "$1" in |
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
The answer to the Ultimate | |
Question is {{ everything.universe.answer }}. | |
Among our weapons are:{% for weapon in weapons %} | |
{{ weapon }}{% endfor %} |
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 types import MethodType | |
from django.http import CompatCookie, HttpRequest | |
def _set_cookie(self, key, value='', max_age=None, expires=None, path='/', | |
domain=None, secure=False): | |
self._resp_cookies[key] = value | |
self.COOKIES[key] = value | |
if max_age is not 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
from django.db.models.manager import Manager | |
class PassThroughManager(Manager): | |
''' | |
Inherit from this Manager to enable you to call any methods from your | |
custom QuerySet class from your manager. Simply define your QuerySet | |
class, and return an instance of it from your manager's `get_query_set` | |
method. | |
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
{# ICanHaz templates #} | |
{% icanhaz %} | |
{# inside here all occurrences of "[[" will become "{{" and "]]" will be "}}" #} | |
<script type="text/html" id="contributor_row"> | |
<select name=role_for_[[ id ]]"> | |
{% for role in roles %} | |
<option value="{{ role.id }}">{{ role.name }}</option> |
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.conf import settings | |
from django.http import HttpResponsePermanentRedirect | |
class EnforceHostnameMiddleware(object): | |
""" | |
Enforce the hostname per the ENFORCE_HOSTNAME setting in the project's settings | |
The ENFORCE_HOSTNAME can either be a single host or a list of acceptable hosts | |
""" | |
def process_request(self, request): |
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 zlib | |
from base64 import b64decode, b64encode | |
from django.db import models | |
# django-jsonfield | |
from jsonfield import JSONField | |
class CompressedJSONField(JSONField): |
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
Index: includes/prefetch.php | |
=================================================================== | |
--- includes/prefetch.php (revision 108075) | |
+++ includes/prefetch.php (working copy) | |
@@ -198,15 +198,8 @@ | |
if($parsed_path == '/firefox') { | |
// Redirect mobile devices (Android, Maemo, iPhone) | |
$is_mobile_redirected = mobile_redirect('/mobile/', 'iphone|ipad'); | |
- // Bug 767985 - Special redirects for Firefox Native Android launch | |
- if($is_mobile_redirected) { |
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
{"bugzilla_url":"https://bugzilla.mozilla.org/show_bug.cgi?id=719170%2C257398%2C288329%2C333418%2C352047%2C363711%2C384806%2C401399%2C425764%2C433509%2C433617%2C434182%2C435894%2C452659%2C459291%2C467717%2C467912%2C473886%2C474390%2C475817%2C484672%2C507315%2C514793%2C537305%2C547766%2C559543%2C562256%2C566315%2C585709%2C601858%2C610150%2C611028%2C619904%2C628958%2C634848%2C634999%2C658354%2C658871%2C663678%2C670512%2C673821%2C691766%2C692844%2C692850%2C692853%2C693285%2C697655%2C699545%2C703817%2C724518%2C724835%2C736851%2C737302%2C738026%2C749644%2C755285%2C767325%2C780216%2C780677%2C780740%2C781003%2C782951%2C783884%2C784206%2C785195%2C778504%2C771006%2C777361%2C612926%2C767724%2C750848%2C202522%2C247591%2C700259%2C726982%2C742123%2C749313%2C547448%2C340697%2C344912%2C374463%2C409848%2C454967%2C487089%2C507885%2C672807%2C733799%2C783446%2C676122%2C698427%2C781551%2C785212%2C785214%2C785216%2C785218%2C697714%2C741661%2C426183%2C698069%2C665084%2C679405%2C718522%2C429286%2C343653%2C702702%2C629932%2C7864%2C1 |
OlderNewer