Skip to content

Instantly share code, notes, and snippets.

@Xpktro
Xpktro / README.md
Created March 19, 2018 18:59
Binary clock

A digital (pure) binary clock using Arduino.

A clock that uses the binary numeric system to display the hour. Reading it is simple once you get the trick, but don't worry, I'm explaining it right here:

The schematics have a horizontal layout for the leds but it can be rearranged as follows (being seconds the led group to the far right):

+----+----+----+----+----+----+----+
|    |    |    | 08 | 04 | 02 | 01 | Hours
|    | 32 | 16 | 08 | 04 | 02 | 01 | Minutes
@Xpktro
Xpktro / day01_part01.py
Last active December 3, 2017 07:10
Advent of code 2017 solutions
captcha = """"""
def is_valid(captcha_to_solve):
def validator(item):
position, number = item
return number == captcha_to_solve[position + 1]
return validator
def solve(captcha_to_solve):
return sum(
@Xpktro
Xpktro / day10_both.py
Last active December 11, 2016 00:29
Advent of code solutions
import re
instructions = """""".split('\n')
robots = {
# '1': (values, low_to, hi_to)
}
outputs = {
# '0': 0
@Xpktro
Xpktro / backend.py
Created October 6, 2016 21:10
Wunderman Phantasia's Backend Developer Job Offer 10/2016
#coding:utf-8
cevag(''.wbva(znc(pue, (68, 101, 98, 101, 115, 32, 101, 110, 118, 105, 97, 114, 32, 116, 117, 32, 67, 86, 32, 97, 32, 109, 111, 105, 115, 101, 115, 46, 99, 97, 99, 104, 97, 121, 64, 119, 117, 110, 100, 101, 114, 109, 97, 110, 46, 99, 111, 109, 32, 101, 120, 112, 108, 105, 99, 97, 110, 100, 111, 32, 108, 111, 32, 113, 117, 101, 32, 104, 105, 99, 105, 115, 116, 101, 32, 112, 97, 114, 97, 32, 101, 110, 99, 111, 110, 116, 114, 97, 114, 32, 101, 115, 116, 101, 32, 116, 101, 120, 116, 111, 32, 121, 32, 101, 108, 32, 102, 117, 110, 99, 105, 111, 110, 97, 109, 105, 101, 110, 116, 111, 32, 100, 101, 32, 101, 115, 116, 101, 32, 115, 110, 105, 112, 112, 101, 116, 46,))))
@Xpktro
Xpktro / sleepsort.js
Created June 10, 2016 01:57
Sleep Sort in JS
function sleepsort(numbers) {
numbers.forEach(function(number) {
setTimeout(function(){console.log(number)}, number)
})
}
sleepsort([2, 1, 3, 4, 6, 5, 7])
@Xpktro
Xpktro / ruc.py
Created May 11, 2016 17:49
SUNAT's RUC lookup using requests, pytesseract, beautifulsoup and pillow
# coding:utf-8
import requests
import pytesseract
from bs4 import BeautifulSoup
from cStringIO import StringIO
from PIL import Image
SUNAT_FORM_URL = 'http://ww1.sunat.gob.pe/cl-ti-itmrconsruc/'
@Xpktro
Xpktro / README.md
Last active June 2, 2016 20:49
Wunderman Phantasia's Backend Developer Job Offer 03/2016

Wunderman Phantasia está en la búsqueda de un desarrollador web Backend con demostrada destreza en al menos dos de los siguientes lenguajes:

  • .net (en C# principalmente)
  • Java (Spring)
  • PHP (Laravel/Codeigniter/Zend)

El salario será definido en base a tu experiencia. Ingresarás a planilla desde el primer momento y tendrás todos los beneficios laborales pertinentes.

Si estás interesado en el puesto, debes resolver un pequeño reto técnico cuya solución será el correo electrónico al cual deberás enviar tus fuentes y tu CV. El código será evaluado y de ser necesario se te preguntará los detalles de la implementación del mismo en el momento de tu entrevista personal.

@Xpktro
Xpktro / wrappers.py
Last active January 2, 2016 01:41
Simple automatic wrappers in Python
class Window(object):
def _draw(self):
print 'parent draw'
def __getattribute__(self, name):
if hasattr(self, '_' + name):
original = object.__getattribute__(self, '_' + name)
new = object.__getattribute__(self, name)
def wrapper(*args, **kwargs):
original(*args, **kwargs)

Sílabo de temas para la Introducción a Django

Introducción a Django

  1. Historia
  2. Propósito
  3. Frameworks Similares

Nuestro primer proyecto - Sistema de Encuestas

  1. Dependencias
  2. Instalación
@Xpktro
Xpktro / ac_pe.pde
Created September 30, 2015 04:26
ArtCoders.pe Processing Logo
/*
* Based on the Generative Typography tutorial from the Creative Application
* http://www.creativeapplications.net/processing/generative-typography-processing-tutorial/
*/
int gridX = 250; // number of horizontal grid points
int gridY = 65; // number of vertical grid points
float waveHeight = 25; // maximum height of each wave (vertex)
float baseHeight = 12; // default base weight of each wave (vertex)
color BACKGROUND_COLOR = color(0); // background color of the sketch