Skip to content

Instantly share code, notes, and snippets.

View jazzido's full-sized avatar
💭
𝄢

Manuel Aristarán jazzido

💭
𝄢
View GitHub Profile
@jazzido
jazzido / gist:1151638
Created August 17, 2011 14:38
Schema de la Db de la app distribuida por el ministerio del interior
manuel@nostromo:~$ mdb-schema '/home/manuel/.wine/drive_c/Elecciones Primarias 2011ARG/DatosBD/ArgentinaP.mdb'
-------------------------------------------------------------
-- MDB Tools - A library for reading MS Access database files
-- Copyright (C) 2000-2004 Brian Bruns
-- Files in libmdb are licensed under LGPL and the utilities under
-- the GPL, see COPYING.LIB and COPYING files respectively.
-- Check out http://mdbtools.sourceforge.net
-------------------------------------------------------------
@jazzido
jazzido / scraper_padron.rb
Created November 28, 2011 23:08
Scraper para el padrón de renunciantes voluntarios a los subsidios de servicios públicos
# script muy mugriento
# el loop termina cuando hay excepción.
# TODO: agregar un parametro para poder empezar el scraping desde un
# id de tramite ne particular, para evitar scanear TODO.
require "watir-webdriver"
require "nokogiri"
require "csv"
pages_per_set = 1
require 'nokogiri'
require 'json'
DISTRICT_DATA_RE = /->([^:]+):(.+)/
def parse_data_table(element)
Hash[*element.xpath('.//td[@bgcolor="#ECC6D5"]').map { |td_bg|
[td_bg.next_element.inner_text, td_bg.next_element.next_element.inner_text]
}.flatten]
end
@jazzido
jazzido / .emacs
Created December 13, 2011 19:34
bare minimum .emacs
(tool-bar-mode -1)
(color-theme-clarity)
(server-start)
(menu-bar-mode -1)
(ido-mode)
(show-paren-mode)
(setq x-select-enable-clipboard t)
@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 || (
/************************************** subsystem.c **************************************/
#define METHOD(x) typeof(x) *x;
typedef enum {
BOOT,
SURVIVAL,
MISSION
} mode_t;
/* opaque pointer ? */
;; 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 ()
@jazzido
jazzido / gifenc.sh
Created October 15, 2015 16:15
Great-looking animated GIF from video files (from: http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html)
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=15,scale=640:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
@jazzido
jazzido / antipopup.js
Last active October 16, 2015 12:58
Para leer lanacion.com sin que te obligue a registrarte
// ==UserScript==
// @name Anti-popup para lanacion.com
// @namespace antipopup
// @description Evita el popup que te "obliga" a registrarte para leer el diario
// @include http://www.lanacion.com.ar/*
// @version 1
// @grant none
// ==/UserScript==
var target = document.querySelector('body');
@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'