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
""" | |
Works with SOUTH, and output on the same widget an HTML list with the value of the field | |
class MyModel(models.Model): | |
data = JSONField() | |
You will need simplejson installed with pip, Django 1.3+ | |
""" | |
from django.db.models.fields import Field |
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 time | |
import gobject | |
import dbus, dbus.service | |
from dbus.mainloop.glib import DBusGMainLoop | |
dbus_loop = DBusGMainLoop() | |
dbus.set_default_main_loop(dbus_loop) | |
loop = gobject.MainLoop() |
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
""" | |
$ cat source.email | python email_parse.py | |
""" | |
import fileinput | |
import email | |
from email.Utils import parseaddr | |
def parse(): | |
raw_message = ''.join([line for line in fileinput.input()]) |
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 os | |
import subprocess | |
import atexit | |
import signal | |
from optparse import make_option | |
from django.conf import settings | |
from django.core.management.base import BaseCommand | |
from django.core.management.commands.runserver import Command as RunserverCommand |
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.core.management.base import BaseCommand | |
from django.db.models import get_models, get_app | |
from django.contrib.auth.management import create_permissions | |
class Command(BaseCommand): | |
args = '<app app ...>' | |
help = 'Sync new permissions for specified apps with the database, or all apps if no args are specified' | |
def handle(self, *args, **options): |
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
""" | |
Requeriments: | |
$ sudo pip install boto dnspython | |
Edit ~/.boto to use your AWS credentials | |
""" | |
import time | |
import sys |
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
export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pip-cache | |
export AQUIPAGO_ENVIRONMENT=testing | |
make | |
env/bin/pip install -r requirements/base.txt --download-cache=/var/lib/jenkins/pip-cache --use-mirrors --timeout 1 | |
env/bin/pip install -r requirements/project.txt --download-cache=/var/lib/jenkins/pip-cache --use-mirrors --timeout 1 | |
env/bin/python runtests.py || : | |
env/bin/pylint --rcfile=.pylintrc aquipago --ignore=test > reports/pylint.txt || : |
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
""" | |
Formula para el calculo del Aporte Nacional Solidario Laboral | |
Esta es la explicación legal del calculo de la formula: | |
* 10% de la diferencia del total ganado solidario menos Bs. 35.000 de diferencia positiva | |
* 5% de la diferencia del total ganado solidario menos Bs. 25.000 de diferencia positiva | |
* 1% de la diferencia del total ganado solidario menos Bs. 13.000 de diferencia positiva | |
""" |
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
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. | |
Dual MIT/BSD license https://github.com/paulirish/matchMedia.js */ | |
window.matchMedia = window.matchMedia || (function( doc, undefined ) { | |
"use strict"; | |
var bool, | |
docElem = doc.documentElement, | |
refNode = docElem.firstElementChild || docElem.firstChild, | |
// fakeBody required for <FF4 when executed in <head> |
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 os | |
import sys | |
reload(sys) | |
sys.setdefaultencoding("utf-8") | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "crowddeals.settings") | |
def touch_wsgistart_info(): | |
from mercurial import hg, ui | |
import time |
OlderNewer