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
def convert_to_utf8(filename): | |
# gather the encodings you think that the file may be | |
# encoded inside a tuple | |
encodings = ('windows-1253', 'iso-8859-7', 'macgreek') | |
# try to open the file and exit if some IOError occurs | |
try: | |
f = open(filename, 'r').read() | |
except Exception: | |
sys.exit(1) |
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 python | |
# -*- coding: utf-8 -*- | |
import os, sys | |
# sys.path+=[os.path.split(os.path.split(os.path.abspath(__file__))[0])[0]] | |
os.environ['DJANGO_SETTINGS_MODULE']='settings' | |
from django.core.management import execute_manager | |
from django.db import transaction | |
import imp | |
try: |
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
.----------------. .----------------. .-----------------. .----------------. .----------------. .----------------. | |
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | | |
| | ____ ____ | || | ____ | || | ____ _____ | || | ____ | || | ___ ____ | || | _____ _____ | | | |
| ||_ \ / _|| || | .' `. | || ||_ \|_ _| | || | .' `. | || | |_ ||_ _| | || ||_ _||_ _|| | | |
| | | \/ | | || | / .--. \ | || | | \ | | | || | / .--. \ | || | | |_/ / | || | | | | | | | | |
| | | |\ /| | | || | | | | | | || | | |\ \| | | || | | | | | | || | | __'. | || | | ' ' | | | | |
| | _| |_\/_| |_ | || | \ `--' / | || | _| |_\ |_ | || | \ `--' / | || | _| | \ \_ | || | \ `--' / | | | |
| ||_____||_____|| || | `.____.' | || ||_____|\____| | || | `.____.' | || | |____||____| | || | `.__.' | | | |
| | | || | | || | |
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
[ | |
{ | |
nombre: 'Ruta1', | |
puntos: [ | |
{ | |
lat: 0, | |
long: 0 | |
}, | |
{ | |
lat: 0, |
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
<dsProductosSeleccionados> | |
<Pedido> | |
<Nota> | |
salsa teriyaki extra y wasabi, es solo para 2 personas pero safari no sirve bien para pedir esto | |
</Nota> | |
<NumPersonas>4</NumPersonas> | |
<PedidoID>9045</PedidoID> | |
<direccion>carrera 10 numero 93b 53 apto 302</direccion> | |
<nombre>victor castillo</nombre> | |
<telefono>6353162</telefono> |
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 datetime import date, timedelta | |
hoy = date.today() | |
if hoy.month == 1: | |
min_prev_invoice_date = hoy - timedelta(days=31) | |
else: | |
try: | |
min_prev_invoice_date = hoy.replace(month=hoy.month-1) | |
except: | |
min_prev_invoice_date = hoy.replace(day=1) |
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
Array.prototype.intersect = | |
function() { | |
if (!arguments.length) | |
return []; | |
var a1 = this; | |
var a = null; | |
var res = [] | |
var n = 0; | |
var b = {}; | |
for(var i =0; i<a1.length;i++){ |