Skip to content

Instantly share code, notes, and snippets.

View ejherran's full-sized avatar

Edison Javier Herran Cortes ejherran

View GitHub Profile
@ejherran
ejherran / genPrimos
Last active August 29, 2015 14:16
Generador de números primos. Entrega el logaritmo natural, el logaritmo base 10 y el numero primo separados por comas; ideal para crear listas en formato csv.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Use: python genPrimos.py > primos.csv
#
import math
prim = []
@ejherran
ejherran / testSort
Last active August 29, 2015 14:16
Caso de prueba para comparar los algoritmos de ordenamiento Radix y Bubble.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Use:
# python testSort.py [size] [space] {view}
# size: Tamaño de la muestra.
# space: Limite máximo de los numero aleatorios a generar.
# view: Bandera (1: True, 0: False) que controla la impreesión paso a paso.
#
@ejherran
ejherran / login.tmpl
Created March 5, 2015 16:46
Login chilli.
<style type="text/css">
#pop
{
color: blue;
font-weight: bold;
cursor: pointer;
}
#popCont
{
@ejherran
ejherran / config-local.sh
Created March 5, 2015 16:50
Chilli Config
#!/bin/sh
# Copyright (C) 2009-2012 David Bird (Coova Technologies) <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@ejherran
ejherran / get_submanga.py
Created July 14, 2015 01:04
Script para descargar y compilar capítulos de manga en formato pdf. Probado con el servidor de submanga.com, aunque en teoría debería funcionar con cualquier lista indexada de ficheros jpg.
#
# Javier Herran ([email protected])
# V 1.0 (2015-07-13)
# Ejemplo de uso (descarga el primer episodio de Air Gear):
# python3 get_submanga.py http://omg.submanga.com/pages/4/6/678935f
#
import subprocess as sub
import shlex as lex
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
class Test(QtWidgets.QWidget):
def __init__(self):
super(Test, self).__init__()
self.setObjectName("self")
self.resize(400, 41)
@ejherran
ejherran / go.py
Last active May 30, 2016 19:16
Go Test
import subprocess as sp
def genMat(r, c, v):
mat = []
row = [v]*c
for i in range(r):
mat.append(row[:])
return mat
@ejherran
ejherran / qrzip.py
Created June 14, 2016 18:18
Generar multiples códigos QR en formato PDF, comprimir el contenido en un fichero ZIP y descargarlo en modo web con DJango - Python 3
# -*- coding: utf-8 -*-
# Python 3.5
# Django 1.9.7
from reportlab.pdfgen import canvas
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.barcode.qr import QrCodeWidget
from reportlab.graphics import renderPDF
from io import BytesIO, StringIO
from zipfile import ZipFile, ZIP_DEFLATED
@ejherran
ejherran / PI_G3.py
Last active February 4, 2017 05:07
Simulación del valor de PI por medio del método montecarlo - Con TK
# -*- coding: utf-8 -*-
#
# Simulación del valor de PI por el método montecarlo
# Javier Herran ([email protected])
# UPC - 2017
#
#
import random
from tkinter import Tk, Frame, Canvas, BOTH, W, Text, END, NORMAL, DISABLED
@ejherran
ejherran / FDragon.java
Created February 8, 2017 05:03
Fractal: Curva Del Dragón - JAVA
/*
*
* Fractal: Curva Del Dragon
* Javier Herran ([email protected])
* UPC - 2017
*
*/
import javax.swing.JFrame;
import javax.swing.JPanel;