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.utils import timezone | |
import pygeoip | |
import pytz | |
db_loaded = False | |
db = None | |
def load_db(): |
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
<key>LSEnvironment</key> | |
<dict> | |
<key>DYLD_INSERT_LIBRARIES</key> | |
<string>/path/to/dylib/skype-poll-fix.dylib</string> | |
</dict> | |
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
GcsManager | |
Robot | |
WitInterface | |
WitResponse | |
XmppReporter | |
cjson | |
cloudsql | |
cloudsql.beans | |
cloudsql.dao | |
cloudsql.dao.dialogdao |
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.utils import translation | |
class LocaleByDomainMiddleware(): | |
def process_request(self, request): | |
host = request.META['HTTP_HOST'].lower() | |
locales = dict(settings.LOCALE_DOMAINS) | |
if not host in locales: |
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 celery import shared_task | |
from celery.contrib.methods import task_method | |
from django.core.mail.backends.smtp import EmailBackend as BaseEmailBackend | |
class FakeLock(object): | |
__enter__ = lambda x: None | |
__exit__ = lambda a, b, c, d: 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
Git hook post-merge and post-checkout for sync modification time to last commit time. | |
You can download scripts manually and install them yourself, or you can install it with command | |
> curl -s https://gist.githubusercontent.com/phpdude/9464925/raw/install | sh | |
This command will download post-merge script, chmod it, and create post-checkout symlink to post-merge hook. | |
You can also start this script manually with environment variable $GIT_MERGE_LIMIT=100 to updated timestamp of last 100 commits for example. |
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
var system = require("system"); | |
var url = system.args[1]; | |
require('./phantom-full-load')(phantom, url, function (page, logs) { | |
logs.forEach(function (i) { | |
console.log('> ' + i); | |
}); | |
result = page.evaluate(function () { | |
return $('body *').attr('class'); |
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/bash | |
usage () | |
{ | |
cat <<UsageHERE | |
boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host | |
Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT | |
or boot2docker-fwd -d RULE_NAME | |
or boot2docker-fwd -l | |
or boot2docker-fwd -A |
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
location ~* ^/s3/(.*) { | |
set $bucket '<REPLACE WITH YOUR S3 BUCKET NAME>'; | |
set $aws_access '<REPLACE WITH YOUR AWS ACCESS KEY>'; | |
set $aws_secret '<REPLACE WITH YOUR AWS SECRET KEY>'; | |
set $url_full "$1"; | |
set_by_lua $now "return ngx.cookie_time(ngx.time())"; | |
set $string_to_sign "$request_method\n\n\n\nx-amz-date:${now}\n/$bucket/$url_full"; | |
set_hmac_sha1 $aws_signature $aws_secret $string_to_sign; | |
set_encode_base64 $aws_signature $aws_signature; |
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
Adds Django full subdomains urls upport for urlpatterns and reverse resolving. | |
Requires installation into settings.py | |
Allows you route and generate views various urls. | |
''' | |
Example: | |
'domain.com' -> '' | |
'domain.com/doc' -> 'doc' |
OlderNewer