Skip to content

Instantly share code, notes, and snippets.

View jazzido's full-sized avatar
💭
𝄢

Manuel Aristarán jazzido

💭
𝄢
View GitHub Profile
@jazzido
jazzido / nanodw.rb
Last active October 21, 2015 17:58
A Nano datawarehouse-like datastore
# coding: utf-8
require 'sequel'
require 'logger'
module NanoDW
Sequel.datetime_class = DateTime
DB = Sequel.connect(ENV['DATABASE_URL'])
log = Logger.new(STDERR)
log.progname = 'NanoDW::Models'
# +files+ es un string con nombres de archivo, uno por línea
files = <<-FILES
~/Dropbox/Indec-informa/pdf/iijul12[1].pdf
~/Dropbox/Indec-informa/pdf/iiago12[1].pdf
~/Dropbox/Indec-informa/pdf/iifeb09.pdf
~/Dropbox/Indec-informa/pdf/iidic11[1].pdf
~/Dropbox/Indec-informa/pdf/iiene12[1].pdf
~/Dropbox/Indec-informa/pdf/iioct11[1].pdf
FILES
WITH votos_summary AS
(SELECT ve.mesa_desde,
ve.mesa_hasta,
SUM(total) AS total_parcodigo,
ve.vot_parcodigo,
ve.dne_distri,
ve.dne_seccio,
row_number() over(partition BY ve.mesa_desde,ve.mesa_hasta
ORDER BY sum(total) DESC) AS rk
FROM votos_establecimiento_octubre ve
@jazzido
jazzido / lanacion_scraper.rb
Last active December 25, 2015 17:19
La Nacion tags scraper
# -*- coding: utf-8 -*-
require 'json'
require 'logger'
require 'date'
require 'mechanize'
# remove the byte order mark
def remove_BOM(str)
str.force_encoding('utf-8').gsub("\xEF\xBB\xBF".force_encoding('utf-8'), '')
@jazzido
jazzido / LICENSE.md
Last active December 16, 2016 04:42
Linked Micromaps Plots

Copyright (C) 2012-2013 Manuel Aristarán jazzido@jazzido.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all

@jazzido
jazzido / index.html
Last active January 10, 2022 03:52
Glowing text effect with CSS3
<html>
<head>
<style type="text/css">
.glow {
-webkit-animation-duration: 1s;
-webkit-animation-name: glow;
-webkit-animation-direction: alternate;
-webkit-animation-iteration-count: infinite;
animation-duration: 1s;
animation-name: glow;
# Para hacer los thumbnails de los mapitas
CROP_BOX = (24, 330, 24+401, 330+861)
THUMBNAIL_SIZE = (103, 103)
import selenium, time, string
from selenium import webdriver
from PIL import Image
browser = webdriver.Firefox()
browser.get('http://localhost:8000')
;; esto va en el .emacs
; auto syntax check
(require 'flymake)
(require 'flymake-clang-c)
(add-hook 'c-mode-hook 'flymake-clang-c-load)
;; ~/.site-lisp/flymake-clanc-c.el
;; lo único que habría que hacer es setear los "-I" de acuerdo a elisp variable.
(defun flymake-clang-c-init ()
/************************************** subsystem.c **************************************/
#define METHOD(x) typeof(x) *x;
typedef enum {
BOOT,
SURVIVAL,
MISSION
} mode_t;
/* opaque pointer ? */
@jazzido
jazzido / afip.user.js
Created February 7, 2012 00:49
Arreglar AFIP en Firefox, Chrome, etc
// ==UserScript==
// @name AFIP-navigate
// @namespace http://www.nerdpower.org/
// @description Arregla el sitio de AFIP para poder imprimir constancias de Monotributo, entre otras cosas
// @include https://*.afip.gov.ar/*
// @include http://*.afip.gov.ar/*
// ==/UserScript==
// esto lo saque de aca: https://gist.github.com/1143845
window.unsafeWindow || (