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 | |
require 'mysql2' | |
require 'mechanize' | |
require 'parallel' | |
require 'byebug' | |
require 'awesome_print' | |
require 'colorize' | |
require 'csv' |
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
require 'sinatra' | |
set :port, 8080 | |
set :bind, '0.0.0.0' | |
get "/" do | |
erb :index | |
end | |
get '/get_exif' do |
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
#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') |
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
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) |
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
$(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')); |
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
// 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 = [ |
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/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 = { |
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
# 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 |
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
find . -size +1M | while read file_name; do sips $file_name --resampleWidth 900 ; done |
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
#!/bin/bash | |
QUERY=$* | |
# Split Alfred query into parts: | |
SOURCE_LANGUAGE=`echo "$QUERY" | awk '{ print $1; }' ` | |
DESTINATION_LANGUAGE=`echo "$QUERY"| awk '{ print $2; }' ` | |
# Transform the text to something Google translate understands | |
set +o histexpand |