View pega.rb
#!/usr/bin/ruby
#require 'mysql2'
require 'mechanize'
require 'parallel'
require 'byebug'
require 'awesome_print'
require 'colorize'
require 'csv'
require 'json'
View gera.sh
convert -density 220 in.pdf to_img_.jpg
mogrify -trim to_img_*.jpg
convert -append to_img_*.jpg out.jpg
rm to_img_*
View scrap.rb
#!/usr/bin/ruby
require 'mysql2'
require 'mechanize'
require 'parallel'
require 'byebug'
require 'awesome_print'
require 'colorize'
require 'csv'
View read_exif.rb
require 'sinatra'
set :port, 8080
set :bind, '0.0.0.0'
get "/" do
erb :index
end
get '/get_exif' do
View inspect-torrents-folder.coffee
#author: Rafael Polo
#language: CoffeeScript
#todo:
# remover repetidos
# considerar possíveis Peers vindos da DHT | distributed hash table
# parametrizar listar apenas com mais de 1 seed
# consultar outros Trackers usando API do torrentz.eu
Torrent = require('nt')
Tracker = require('node-tracker')
View get_content_from_page.rb
def db # connects to old database
Mysql2::Client.new(host: 'localhost', username: 'root', database: 'eti')
end
def select(from)
puts '='*20
exec = "SELECT * from #{from}"
puts exec
puts '='*20
db.query(exec)
View app.js
$(document).ready(function() {
$(".item[cert='{{cert}}']").css('border', '5px solid #FFBD09');
$('.item').hover(
function(){
icon = $(this).children().children();
icon.attr('off', icon.attr('src'));
icon.attr('src', '/static/img/scary.svg');
},
function(){
icon.attr('src', icon.attr('off'));
View zeitbank.db.js
// this is the zeitbank database #1
// filled during the gütermarkt #3
// to do:
// - server-side script to serve this file - the people database
// - show last_updated_ago
// - cliente-side script to read it and render as a CNN news style
// - convert type face to web version // ask jolanda
people = [
View dataviz.rb
#!/usr/bin/env ruby
#encoding: utf-8
#comment: Convert Jeff's .XLS into a .DOT Graph file
# configurations
file = "kenya.xls"
# columns to export as graph nodes
columns = ["Project", "Platform", "Developer", "Organization", "Funder", "Category", "Type"]
# how columns connect to each other
relations = {
View category_itens_per_col.rb
# backend
def category_itens_per_col(total)
return case total
when 0..3 then 1
when 4..6 then 2
when 7..9 then 3
else 4
end
end