Skip to content

Instantly share code, notes, and snippets.

View jazzido's full-sized avatar
💭
𝄢

Manuel Aristarán jazzido

💭
𝄢
View GitHub Profile
@jazzido
jazzido / README.md
Last active August 29, 2015 14:19 — forked from mbostock/.block
Argentina province grid
@jazzido
jazzido / schema.groovy
Last active August 29, 2015 14:13
schema creation + data insertion
conf = new BaseConfiguration()
conf.setProperty("storage.backend","cassandra")
conf.setProperty("storage.hostname", "localhost")
conf.setProperty("schema.default", "none")
conf.setProperty("cache.db-cache", true)
conf.setProperty("index.search.backend", "elasticsearch")
conf.setProperty("index.search.hostname", "localhost")
g = TitanFactory.open(conf)
mgmt = g.getManagementSystem()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(function(){function i(c,a,b){return g(c,a,b)}function g(c,a,b,j){j=j||{};a&&!n(a)&&(b=a,a=void 0);a=a||new Date;b=b||o;b.formats=b.formats||{};var i=a.getTime(),h=j.timezone,e=typeof h;if(j.utc||e=="number"||e=="string")a=p(a);if(h){if(e=="string")var k=h[0]=="-"?-1:1,q=parseInt(h.slice(1,3),10),r=parseInt(h.slice(3,5),10),h=k*(60*q+r);e&&(a=new Date(a.getTime()+h*6E4))}return c.replace(/%([-_0]?.)/g,function(c,e){var d;if(e.length==2){d=e[0];if(d=="-")d="";else if(d=="_")d=" ";else if(d=="0")d=
"0";else return c;e=e[1]}switch(e){case "A":return b.days[a.getDay()];case "a":return b.shortDays[a.getDay()];case "B":return b.months[a.getMonth()];case "b":return b.shortMonths[a.getMonth()];case "C":return f(Math.floor(a.getFullYear()/100),d);case "D":return g(b.formats.D||"%m/%d/%y",a,b);case "d":return f(a.getDate(),d);case "e":return f(a.getDate(),d==null?" ":d);case "F":return g(b.formats.F||"%Y-%m-%d",a,b);case "H":return f(a.getHours(),d);case "h":return b.shortMonths[a.getMonth()];case "I":return f(l(a),
d)
@jazzido
jazzido / gist:dc5cc9b5126943ae82ea
Created October 26, 2014 17:05
ipython notebook - transporte publico bahía blanca
{
"metadata": {
"name": "",
"signature": "sha256:c6a9ad4d028cadcae6537cdf79e30b9c8ee62ea42be736ab4927fadb9925329e"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
# coding: utf-8
module IndecScraper
class TableExtractor
attr_reader :extractor
DEFAULT_INDEX_PAGE = 3
PAGE_NUMBER_RE = /.*?(\d+)$/
def initialize(pdf_file)
import sys
import os
import re
from datetime import datetime
import urlparse
import json
from multiprocessing import Pool
from bs4 import BeautifulSoup
import requests
require 'tabula'
pdf_file_path = "mineriafinal.pdf"
outfilename = "mineriafinalv3.csv"
out = open(outfilename, 'w')
extractor = Tabula::Extraction::ObjectExtractor.new(pdf_file_path, :all)
top, left, bottom, right = [104.46,13,580.54,820.82]
import sys
import mechanize
import logging
import unicodecsv
from datetime import datetime
from bs4 import BeautifulSoup
logger = logging.getLogger("mechanize")
logger.addHandler(logging.StreamHandler(sys.stderr))
logger.setLevel(logging.INFO)
@jazzido
jazzido / index.html
Last active October 5, 2021 07:11
Webcam barcode reading (zbar, emscripten)
<!DOCTYPE html>
<html>
<head>
<title>JS in-browser barcode reader</title>
<style type="text/css">
body > div {
position: relative;
width: 320px; height: 240px;
}
video { position: absolute; top: 0; left: 0; width: 320px; height: 240px; }