Skip to content

Instantly share code, notes, and snippets.

@vitorbaptista
vitorbaptista / newschallenge-2015-teams-countries.csv
Last active October 2, 2015 17:40
The NewsChallenge 2015 teams' countries
url country
https://www.newschallenge.org/challenge/data/entries/improve-openrefine-s-extensibility-with-data-repository-and-processing-services Canada
https://www.newschallenge.org/challenge/data/entries/microfilm-digitization USA
https://www.newschallenge.org/challenge/data/entries/crime-needs-a-new-box-score USA
https://www.newschallenge.org/challenge/data/entries/beautiful-map UK
https://www.newschallenge.org/challenge/data/entries/open-referral USA
https://www.newschallenge.org/challenge/data/entries/checking-up-on-the-fiscal-health-of-california-cities-counties-and-special-districts-a-tool-for-concerned-residents USA
https://www.newschallenge.org/challenge/data/entries/open-source-election-results-public-vote-counting USA
https://www.newschallenge.org/challenge/data/entries/designing-data-inclusion-mapping-detroit-s-data-ecosystem-to-catalyze-connectivity-engagement-and-impact-for-all USA
https://www.newschallenge.org/challenge/data/entries/tracking-gender-based-violence-while-protecting-privacy Congo
@vitorbaptista
vitorbaptista / generate-data.sh
Last active August 29, 2015 14:26
Generates CSV with name, id, email and image of the politicians on https://github.com/everypolitician/everypolitician-data
#!/bin/bash
echo "name,id,email,image"
for file in `find . -name ep-popolo-v1.0.json`
do
cat $file | jq -r ".persons[] | [\"$file\", .id, .email, .image] | @csv"
done
@vitorbaptista
vitorbaptista / error.log
Created July 26, 2015 11:08
Full log of the error with using knitr + changing OutDec options to ",". I filed the issue on https://github.com/yihui/knitr/issues/1081
processing file: teste.Rnw
|
| | 0%
|
|...................... | 33%
ordinary text without R code
@vitorbaptista
vitorbaptista / ping-iax2.pl
Last active August 29, 2015 14:24
Ping IAX2 server
#!/usr/bin/perl -w
# udp ping tool
# http://www.voip-info.org/wiki/index.php?page_id=2654&comments_page=1
use IO::Socket;
$target = shift; #"192.168.0.255";
$target_port = shift; # 4569
socket(PING, PF_INET, SOCK_DGRAM, getprotobyname("udp"));
@vitorbaptista
vitorbaptista / Makefile
Last active August 29, 2015 14:08
Gera CSV com parlamentares eleitos a partir dos dados do TSE
# Baixa resultados do TSE desde 1989 e cria um CSV com os parlamentares eleitos com colunas:
# ano, uf, nome, cargo, situação, partido
ANOS_UF := 1989 1990
ANOS_MUNZONA := 1994 1996 1998 2000 2002 2004 2006 2008 2010 2012 2014
ARQUIVOS_UF := $(patsubst %, VOTACAO_CANDIDATO_UF_%.ZIP, $(ANOS_UF))
ARQUIVOS_MUNZONA := $(patsubst %, votacao_candidato_munzona_%.zip, $(ANOS_MUNZONA))
ARQUIVOS_MUNZONA_DEPENDENCIES := $(patsubst %, votacao_candidato_munzona_%_SP.txt, $(ANOS_MUNZONA))
ARQUIVOS_UF_DEPENDENCIES := $(patsubst %, VOTACAO_CANDIDATO_UF_%, $(ANOS_UF))
@vitorbaptista
vitorbaptista / gist:4063793
Created November 13, 2012 03:38
Decaptcher.org API in Ruby
require 'net/http'
require 'uri'
require 'base64'
require 'pry'
KEY = "YOUR API KEY"
class Decaptcher
def initialize(file_name)
@file_name = file_name
@vitorbaptista
vitorbaptista / bundle exec cucumber --no-profile
Created August 11, 2012 00:37
Errors running allourideas.org's tests
"redis/dist_redis" is deprecated. Require "redis/distributed" and replace DistRedis for Redis::Distributed. (in /home/vitor/Projetos/allourideas.org/vendor/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require')
Disabling profiles...
Cannot find or read /home/vitor/Projetos/allourideas.org/config/newrelic.yml
New Relic Agent not running.
Feature: Activating and deactivating choices
In order to prevent unwanted choices from appearing
As a question admin
I should be able to activate and deactivate a choice
@vitorbaptista
vitorbaptista / gist:3299632
Created August 8, 2012 23:12
Maven output for lexml-parser-pl/parser-projeto-lei
vitor@luna:/tmp/lexml-parser-pl/parser-projeto-lei/trunk$ svn log
------------------------------------------------------------------------
r6343 | fragomeni | 2012-05-14 19:37:44 -0300 (Mon, 14 May 2012) | 1 line
Importação.
------------------------------------------------------------------------
vitor@luna:/tmp/lexml-parser-pl/parser-projeto-lei/trunk$ mvn test
[INFO] Scanning for projects...
@vitorbaptista
vitorbaptista / #thacker.log
Created August 2, 2012 00:45
I Reunião do Hub OKFn
--- Log opened Wed Aug 01 20:00:36 2012
[20:00] < danielabsil> | pessoal, vou transcrever pra cá
[20:00] < danielabsil> | porque o hangout não tá funcionando pra gnete
[20:00] < danielabsil> | ok?
[20:00] < Nitai> | deve ser a rede de voces
[20:00] < Nitai> | pesada
[20:01] < danielabsil> | pra registrar, o Pedro Markun tá aqui contando o que é a Open Knowledge Foundation e como foi que a gente entrou em contato com eles
[20:01] < danielabsil> | participando com a THacker no Consegi, ano passado, a gente conheceu o Rufus Pollock dessa fundação e começou a pensar em trazer a OKFN pro Brasil
[20:01] < danielabsil> | uma das coisas que a gente acha que dá pra fazer com essa história da OKFn pro Brasil, era pensar num braço de ação mais business
[20:03] < danielabsil> | a gente sabe que a Transparência Hacker tem muita redundância com essa nova ação de uma Open Knowledge Foundation cuidado de dados abertos no Brasil. Mas a THacker é uma comunidade de ativismo, de certa forma, e talvez a OKFn possa se
@vitorbaptista
vitorbaptista / Gemfile.lock
Created July 18, 2012 18:37
Errors running pairwise-api's tests
GEM
remote: http://rubygems.org/
remote: http://gems.github.com/
specs:
actionmailer (2.3.14)
actionpack (= 2.3.14)
actionpack (2.3.14)
activesupport (= 2.3.14)
rack (~> 1.1.0)
activerecord (2.3.14)