Skip to content

Instantly share code, notes, and snippets.

View albertochiwas's full-sized avatar

Alberto Pacheco albertochiwas

View GitHub Profile
@albertochiwas
albertochiwas / search_box.html
Created October 15, 2016 20:26
Version derivada de Ivan para realizar busquedas
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Buscador</title>
</head>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
# DROPPING BLOCKS AS YOU WALK
from mcpi.minecraft import Minecraft
from time import sleep
mc = Minecraft.create()
flower = 38
while True:
x, y, z = mc.player.getPos()
@albertochiwas
albertochiwas / FilterCamera.py
Last active October 14, 2016 00:15
OpenCV + Processing + Python: Imagen de cámara y filtro en tiempo real
# Reconoce rostro y filtra en tiempo real imagenes de video tomadas de la camara
add_library('video')
add_library('opencv_processing')
video, opencv, ancho, alto, fp = None, None, 640, 480, 12
def setup():
global opencv, video, ancho, alto, fp
size(ancho, alto)
@albertochiwas
albertochiwas / adivina.py
Created October 13, 2016 07:55
Juego adivina
# Filename: adivina.py, alberto@acm.org, Oct'09
import random
def num_azar(m): return random.randint(1,m)
def leer(s): return int(input(s))
oculto = num_azar(1000)
print "\n* JUEGO: ADIVINA NUMERO 1-1000 *"
@albertochiwas
albertochiwas / draw_star.py
Last active October 13, 2016 07:04
Processing + Python
poly = [(10,40),(40,40),(50,10),(60,40),(90,40),
(65,60),(75,90),(50,70),(25,90),(35,60),(10,40)]
tam = len(poly)
w, h, g, inc, s = 400, 400, 0, 1, None
def setup():
global w, h, tam, poly, s
size(w,h)
frameRate(4)
strokeWeight(4);
@albertochiwas
albertochiwas / diccionarios.py
Created October 13, 2016 01:59
Taller de Python - Ejemplo de Diccionarios
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Recomendación: Editor Atom http://atom.io
import string
excel = { 'A': ['JUAN', 6, 8, 7, 9], 'B': ['RITA', 8, 9, 7, 9] }
print
print 'REPORTAR HOJA ELECTRONICA'
for key,row in excel.iteritems(): # cada renglon
for num,col in enumerate(row): # cada columna
print "%s%d[%s] " % (key,num,str(col)),
@albertochiwas
albertochiwas / electro-2016.html
Created October 2, 2016 03:21
ver. final - plantilla completa. Pendiente: insertar datos de cada conferencia para todos los días.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Programa Técnico Electro 2016</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<style>
@albertochiwas
albertochiwas / electro-acordeon.html
Last active October 1, 2016 20:28
Ver. 3 - Acordeon. Pote: Sala con horario completo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Programa Tecnico Electro</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
@albertochiwas
albertochiwas / electro-jquery-v2.js
Created October 1, 2016 19:27
Version 2 - Collapsable
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Programa Tecnico Electro</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<script type="text/javascript">
@albertochiwas
albertochiwas / electro-jquery.js
Created October 1, 2016 18:11
ver. 1 usando listviews. Pote: Collapsibles
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Programa Tecnico Electro</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<script type="text/javascript">