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/bin/env python | |
"""Replacement for htpasswd. | |
Original author: Eli Carter | |
source (rev 6551): | |
http://trac.edgewall.org/browser/trunk/contrib/htpasswd.py | |
""" | |
import os |
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/bin/env python3 | |
from datetime import datetime | |
from wsgiref.simple_server import make_server | |
def my_application(environ, start_response): | |
path = environ['PATH_INFO'] | |
method = environ['REQUEST_METHOD'] | |
print("received a HTTP request. path: %s, method: %s" % (path, method)) |
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.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 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
# Ubuntu 14.04: requires pkg 'imagemagick'. | |
convert -resize 50% -delay 100 -loop 0 *.png myimage.gif |
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/bin/env bash | |
# Tools: | |
# - aws-cli version 1.11.143 | |
# - jp version 0.1.3 | |
# https://github.com/jmespath/jp | |
# Notes: | |
# - 'sed' pattern | |
# https://stackoverflow.com/questions/13610639/tr-command-how-to-replace-the-string-n-with-an-actual-newline-n/13611446#13611446 |
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
{% load admin_static %}{% load url from future %}<!DOCTYPE html> | |
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> | |
{% comment %} | |
This template is almost a copy (with indentation corrections and modifications listed below) of | |
'django/contrib/admin/templates/admin/base.html' and overrides it by living in directory | |
'/templates/admin/', as instructed in documentation: | |
"For those templates that cannot be overridden in this way, you may still override them for | |
your entire project. Just place the new version in your templates/admin directory." | |
https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#overriding-admin-templates |
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
{ | |
"Región de los Ríos": [ | |
"Panguipulli", | |
"Corral", | |
"Paillaco", | |
"La Unión", | |
"Los Lagos", | |
"Río Bueno", | |
"Futrono", | |
"Lago Ranco", |
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
# For commits, prefer full hash | |
# https://pip.pypa.io/en/stable/reference/pip_install/#git | |
-e git+ssh://git@github.com/fyntex/lib-cl-sii-python.git@995af20f289c41c690d47c35720a6005b93287ba#egg=cl-sii | |
-e git+ssh://git@github.com/fyntex/lib-cl-sii-python.git@master#egg=cl-sii | |
-e git+ssh://git@github.com/fyntex/lib-cl-sii-python.git@v1.5#egg=cl-sii | |
-e git+ssh://git@github.com/fyntex/lib-cl-sii-python.git@refs/pull/123/head#egg=cl-sii |
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 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 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 python | |
# coding: utf-8 | |
"""Generate a 50-char random string, adequate for Django's ``SECRET_KEY``. | |
source: part of | |
https://github.com/django/django/blob/1.8.5/django/utils/crypto.py | |
""" | |
from __future__ import absolute_import, print_function, unicode_literals |