Skip to content

Instantly share code, notes, and snippets.

View rafapolo's full-sized avatar

Rafael Polo rafapolo

View GitHub Profile
@rafapolo
rafapolo / cidoltube.rb
Created May 23, 2012 23:18
Baixa todos os videos listados.
#encoding: utf-8
#autor: polo
require 'open-uri'
def getvideo(url)
puts "Pegando #{url}"
youtubepath = url
uri = URI.parse(youtubepath)
open(uri) do |file|
@rafapolo
rafapolo / pega_makingoff.rb
Created June 20, 2012 18:30
get all makingoff.org movie collection
#encoding: utf-8
puts "="*40
puts "\t MakingOff Copyfight"
puts "="*40
puts "Carregando..."
require 'rubygems'
require 'mechanize'
def clean(str)
@rafapolo
rafapolo / pega-makingoff.rb
Last active October 6, 2015 09:38
Crawleia torrents e capas do MakingOff.org
#encoding: utf-8
#copyfight extrapolo
#20.jun.2012
puts "="*40
puts "\t MakingOff Copyfight"
puts "="*40
puts "Carregando..."
require 'rubygems'
@rafapolo
rafapolo / pega_sambaderaiz.rb
Created October 29, 2012 15:01
Crawleia organizadamente todos os álbuns do sambaderaiz.net
#encoding: utf-8
#copyfight sambaderaiz
#27.out.2012
puts "Carregando..."
require 'rubygems'
require 'mechanize'
puts "="*40
puts "\t Copyfight SambaDeRaiz"
@rafapolo
rafapolo / schema.rb
Created November 13, 2012 20:32
loja
ActiveRecord::Schema.define(:version => 20111014172203) do
create_table "active_admin_comments", :force => true do |t|
t.integer "resource_id", :null => false
t.string "resource_type", :null => false
t.integer "author_id"
t.string "author_type"
t.text "body"
t.datetime "created_at"
t.datetime "updated_at"
@rafapolo
rafapolo / marcadores.json
Created December 11, 2012 18:19
Acesso webdocgraffiti.com.br/marcadores por AJAX
[{
"bloco_id": null,
"id": 106,
"lat": "-23.532447",
"long": "-46.65035999999998",
"titulo": "Tikka",
"tags": [{
"id": 270,
"name": "boneca",
"urlized": "boneca"
@rafapolo
rafapolo / deploy.rb
Last active December 13, 2015 18:19
deploy sample
#...
namespace :deploy do
desc "restart passenger"
task :restart do
passenger::restart
end
end
namespace :passenger do
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
#
# mini_info.py v0.1
#
# author: Rafael Polo
# updated on 20/05/09.
#
# [email protected]
@rafapolo
rafapolo / build_rails_cloud.sh
Last active June 19, 2016 17:28
Extrapolated script to get a raw debian-based UNIX server properly configured to play a RubyonRails app.
apt-get update
apt-get upgrade
apt-get install autoconf automake bison build-essential curl cmake gcc git git-core htop libc6-dev libcurl4-openssl-dev libffi-dev libgdbm-dev libreadline-dev libreadline6 libreadline6-dev libsqlite3-0 libsqlite3-dev libssl-dev libtool libxml2 libxml2-dev libxslt-dev libyaml-dev locate make ncurses-dev nmap openjdk-9-jre openssl patch python-software-properties rubygems-integration ruby-bundler ruby2.3-dev ruby2.3 sqlite3 vim zlib1g zlib1g-dev software-properties-common mysql-server mysql-client libmysqlclient-dev libmagickwand-dev
sudo ln -s /usr/bin/ruby2.3 /usr/bin/ruby
sudo adduser git
mkdir /home/git/.ssh
chown -R git /home/git/
#encoding: utf-8
namespace :minc do
desc "Crawleia Minc"
task :grab => :environment do
puts
puts "="*70
puts "\t\t\t- Crawleando MinC -"
puts "\t\t\t"+Time.new.strftime("%Y-%m-%d %H:%M:%S")
puts "="*70