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.utils.datastructures import MultiValueDict | |
| class SessionStorage(object): | |
| """Custom SessionStorage class. Removed all the functionality that dealt | |
| with files. | |
| Based in Django-1.4's: | |
| `django.contrib.formtools.wizard.storage.base.BaseStorage` | |
| `django.contrib.formtools.wizard.storage.session.SessionStorage` |
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
| import copy | |
| import logging | |
| import re | |
| from django.forms import ValidationError | |
| from django.views.generic import TemplateView | |
| from django.utils.datastructures import MultiValueDict | |
| from django.contrib.formtools.wizard.forms import ManagementForm |
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
| #!/usr/bin/env sh | |
| # Uses curl to connect to www.isup.me, a website that checks if a given domain | |
| # is up or not. The response will contain "It's just you" if the domain is up. | |
| # If not, it will contain "It's not just you". | |
| test $# -lt 1 && (echo "Usage: $0 domain [domain2] [domain3] ..."; exit 1;) | |
| for domain in "$@"; do | |
| echo -n "$domain: " |
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 urllib2 import urlopen | |
| from django.utils.simplejson import loads | |
| from oauth2 import Token | |
| from social_auth.backends.utils import build_consumer_oauth_request | |
| from social_auth.backends.twitter import TwitterAuth | |
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
| import base64 | |
| import pickle | |
| from django.contrib.sessions.models import Session | |
| from django.utils.encoding import force_unicode | |
| def decode_session_data(session_key): | |
| """Decode the data in a session object stored under ``session_key``. |
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
| /* Estructura y Datos de las Regiones, Provincias */ | |
| /* y Comunas de Chile. */ | |
| /* */ | |
| /* Fecha: Julio 2010 */ | |
| /* Autor: Juan Pablo Aqueveque - juque.cl */ | |
| -- | |
| -- Comunas | |
| -- | |
| DROP TABLE IF EXISTS `comunas`; |
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
| { | |
| "Región de los Ríos": [ | |
| "Panguipulli", | |
| "Corral", | |
| "Paillaco", | |
| "La Unión", | |
| "Los Lagos", | |
| "Río Bueno", | |
| "Futrono", | |
| "Lago Ranco", |
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
| [ | |
| { | |
| "pk": 6, | |
| "model": "lu_base.region", | |
| "fields": { | |
| "codigo": "15", | |
| "orden_geo": 1, | |
| "nombre_corto": "Arica y Parinacota", | |
| "nombre_largo": "" | |
| } |
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
| sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev | |
| wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz | |
| tar xz Python-2.7.3.tgz | |
| cd Python-2.7.3 | |
| ./configure | |
| make | |
| sudo make altinstall | |
| python2.7 |
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
| import redis | |
| redis_host = 'ec2-xxx.amazonaws.com' | |
| value = raw_input() | |
| r = redis.StrictRedis(host=redis_host, password=value) | |
| r.set('foo', 'hellooo') | |
| r.get('foo') |
OlderNewer