This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ruby19 | |
# encoding: utf8 | |
# author: rafael polo | |
# created_at 23.fev.2010 | |
require 'open-uri' | |
require 'timeout' | |
require 'cgi' | |
class PegaCoda |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ruby19 | |
# encoding: utf8 | |
# author: rafael polo | |
# created_at: 02.mar.2010 | |
require 'open-uri' | |
require 'timeout' | |
class PegaUmquetenha |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ruby19 | |
# encoding: utf8 | |
# author: rafael polo | |
# created_at 11.mar.2010 | |
# updated_at 12.mar.2010 | |
require File.join(File.dirname(__FILE__), 'Entendedor.rb') | |
require 'rubygems' | |
require 'twitter' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ruby19 | |
# encoding: utf8 | |
# author: rafael polo | |
# created_at 11.mar.2010 | |
# updated_at 12.mar.2010 | |
require 'yaml' | |
class Entendedor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# encoding: utf8 | |
# author: Rafael Polo | |
# created_at 12.abr.2010 | |
$KCODE='u' | |
require 'open-uri' | |
require 'timeout' | |
require 'rubygems' | |
require 'hpricot' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Esse script gera um grafo dos semeadores de um dado torrent por país | |
#!ruby19 | |
# encoding: utf8 | |
# author: Rafael Polo | |
# created_at 25.abr.2010 | |
require 'rubygems' | |
require 'rubytorrent' | |
require 'timeout' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emails_pattern = Regexp.new(/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/) | |
emails_list = File.open("arquivao.txt").read.scan(emails_pattern).uniq.sort | |
puts "#{email_list.count} emails encontrados." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ruby19 | |
# encoding: utf8 | |
# author: rafael polo | |
# created_at 11.mar.2010 | |
# updated_at 03.jul.2010 | |
require 'rubygems' | |
require 'twitter' | |
OPTS = [('a'..'z'),('A'..'Z'),('0'..'9')].map{|n| n.to_a }.flatten |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rafael Polo | |
class Tuitero | |
def self.diz(msg) | |
return if ENV['RAILS_ENV'] == 'development' # só diz em produção | |
httpauth = Twitter::HTTPAuth.new('baixo_gavea', '******') | |
client = Twitter::Base.new(httpauth) | |
client.update(msg) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tava precisando de todas as cidades do Brasil pra um pequeno projeto... como isso me parece uma necessidade recorrente, vim compartilhar minha solução. | |
No projeto, fiz: | |
1: | |
./generate scaffold estado sigla:string nome:string | |
./generate scaffold cidade nome:string estado_id:integer | |
2: | |
defini em |
OlderNewer