Skip to content

Instantly share code, notes, and snippets.

View hsribei's full-sized avatar

Helder S Ribeiro hsribei

View GitHub Profile
# Grep a line in a project's entire network
# (or all the forks you included as remote anyway)
irb(main):001:0> pattern = "task :clear"
irb(main):002:0> `find .git/refs/remotes/ -type f`.split("\n").map{|e| e.gsub(/\.git\/refs\/remotes\//, '')}.each {|e| puts `git grep #{pattern} #{e}`}
@hsribei
hsribei / gist:85300
Created March 25, 2009 05:07
Script para ripar nomes, partidos, estados e votações de deputados federais.
# to read it again every time we're testing the extraction of their
# voting history (which is still buggy)
if File.exists?("legislators.yml")
legislators = File.open("legislators.yml") { |f| YAML::load(f) }
else
page = agent.get('http://www2.camara.gov.br/deputados')
form = page.form('form1')
select = form.fields[5]