Julian Amaya julian-amaya

View clean_utf8.py
1 2 3 4 5 6 7 8 9 10
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)
View gist:3194056
1 2 3 4 5 6 7 8 9 10
#!/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:
View gist:3091264
1 2 3 4 5 6 7 8 9 10
 
.----------------. .----------------. .-----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
| | ____ ____ | || | ____ | || | ____ _____ | || | ____ | || | ___ ____ | || | _____ _____ | |
| ||_ \ / _|| || | .' `. | || ||_ \|_ _| | || | .' `. | || | |_ ||_ _| | || ||_ _||_ _|| |
| | | \/ | | || | / .--. \ | || | | \ | | | || | / .--. \ | || | | |_/ / | || | | | | | | |
| | | |\ /| | | || | | | | | | || | | |\ \| | | || | | | | | | || | | __'. | || | | ' ' | | |
| | _| |_\/_| |_ | || | \ `--' / | || | _| |_\ |_ | || | \ `--' / | || | _| | \ \_ | || | \ `--' / | |
| ||_____||_____|| || | `.____.' | || ||_____|\____| | || | `.____.' | || | |____||____| | || | `.__.' | |
| | | || | | || |
View gist:2906737
1 2 3 4 5 6 7 8 9 10
[
{
nombre: 'Ruta1',
puntos: [
{
lat: 0,
long: 0
},
{
lat: 0,
View example.xml
1 2 3 4 5 6 7 8 9 10
<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>
View mes.py
1 2 3 4 5 6 7 8 9 10
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)
View intersect.js
1 2 3 4 5 6 7 8 9 10
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++){
Something went wrong with that request. Please try again.