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
set nolist | |
color darkblue | |
"Functions | |
let g:pep8 = 1 | |
function! Toggleg:pep8() | |
if g:pep8 == 1 | |
let g:pep8 = 0 | |
pep8Clear | |
else |
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
#!/usr/local/bin/python | |
""" | |
If we apply a way like this to add functions to parse the strings, not only for | |
subjects but for other types we can have a lot more flexibility to decide our | |
parsing functions and to apply different parsings more easily and decide wich | |
is better | |
""" | |
import string | |
import re |
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
def sender(request): | |
if not request.is_ajax(): | |
raise Http404 | |
#import ipdb; ipdb.set_trace() | |
images = Image.objects.filter(is_available=True).order_by('last_update') | |
if images: | |
image = images[0] | |
image.is_available = 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
def get_status(self): | |
status = self.NOT_AVAILABLE | |
try: | |
status = getattr(self, 'get_%s_status' % self.shipper.lower()) | |
except Exception, exc: | |
logging.warning('caught tracking exception with %s %s: %s' % (self.shipper, self.number, exc)) | |
return status | |
def get_redirect_url(self): | |
return getattr(self, 'get_%s_redirect_url' % self.shipper.lower(), '') |
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
function retrieve_A(){ | |
//do stuff for A | |
} | |
function retrieve_B(){ | |
//do stuff for B | |
} | |
function append_onereceipt(web_case){ | |
info = window['retrieve_' + web_case](); |
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 difflib import SequenceMatcher | |
from mturk.models import Hit | |
from message.models import Email | |
email_ids = [m.email_id for m in Hit.objects.all()] | |
emails = [e.subject for e in Email.objects.filter(id__in=email_ids)] | |
res = {} | |
for e in emails[:100]: | |
f = 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
#!/bin/sh | |
if test "$(git diff --name-only HEAD@{1} | ack '500|404|home.html|static-content')" | |
then | |
echo "running ./manage.py generatemedia to update files" | |
python myproject/manage.py generatemedia --nodebug | |
git add -A myproject/_generated_media/* | |
git add -A static-content/* | |
git commit -m "updating media (automatic update by git merge hook)" | |
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
#To be able to use this, please do a symbolic link into project root: | |
#cd yourproject | |
#ln -s environments/my_own_fabfile.py fabfile.py | |
from fabric.api import env, local, run, cd, sudo | |
from fabric.decorators import hosts | |
env.project_root = '~/WebSites/PROJECT' | |
#from fabric.contrib import django | |
env.user = "USER" |
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
#user nobody; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
#access_log /var/log/nginx/access.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 300; |
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
""" | |
WSGI config for fitvaina project. | |
This module contains the WSGI application used by Django's development server | |
and any production WSGI deployments. It should expose a module-level variable | |
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover | |
this application via the ``WSGI_APPLICATION`` setting. | |
Usually you will have the standard Django WSGI application here, but it also | |
might make sense to replace the whole Django WSGI application with a custom one |
OlderNewer