This file contains hidden or 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.core.urlresolvers import is_valid_path | |
from django.http import HttpResponsePermanentRedirect | |
from django.middleware.locale import LocaleMiddleware | |
from django.utils import translation | |
from django.utils.cache import patch_vary_headers | |
class UpdatedLocaleMiddleware(LocaleMiddleware): | |
def process_response(self, request, response): |
This file contains hidden or 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 run, local, task | |
@task(alias='hd') | |
def heroku_deploy(scale='yes', runtime='no', runtime_version=None): | |
""" | |
Deploys heroku app | |
Usage examples: |
This file contains hidden or 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
// check if paths are in href | |
$('#nav a').ajaxlinks({ | |
ignore: ['.no-al', '.no-ajax', '#logo'], | |
ignore_paths: ['/accounts/', '/__debug__/'] | |
}); | |
// Or wildcard paths if it's not too hard to parse | |
$('#nav a').ajaxlinks({ | |
ignore: ['.no-al', '.no-ajax', '#logo'], | |
ignore_paths: ['*/accounts/*', '*/__debug__/'] |
This file contains hidden or 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
echo "Kill processes containing '$1'" | |
ps aux | grep $1 | grep -v grep | awk '{print$2}' | xargs kill -9 |
This file contains hidden or 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
{ | |
"response": { | |
"status": "success", | |
"meta": {}, | |
"data": { | |
"checkin": { | |
"time": 6, | |
"id": null, | |
"user": { | |
"username": "yy", |
This file contains hidden or 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
{ | |
"response": { | |
"meta": {}, | |
"data": { | |
"distance": 0, | |
"name": "北京", | |
"lat": 111, | |
"lng": 111, | |
"checkins": [ | |
{ |
NewerOlder