This file contains 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
# encoding: UTF-8 | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
start = 'C.A._Penarol' | |
target = 'Philosophy' | |
visited = [] |
This file contains 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
subject do | |
User.new.tap do |user| | |
user.password = "something" | |
user.password_confirmation = user.password | |
user.email = "[email protected]" | |
end | |
end |
This file contains 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' | |
require 'sinatra/namespace' | |
set :foo, 42 | |
namespace '/foo' do | |
get '/bar' do | |
settings.respond_to?(:foo).to_s | |
end | |
end |
This file contains 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
# encoding: UTF-8 | |
require 'open-uri' | |
years = %w{1997 1994 1989 1967 1952 1942 1934 1918 1830} | |
i = years.last | |
file = open("http://www0.parlamento.gub.uy/constituciones/const#{i.slice(1..-1)}.htm").read | |
t = file.encode('UTF-8', 'ISO-8859-1', universal_newline: true) |
This file contains 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
git clone git://github.com/federomero/ti.git ~/Code/ti | |
git clone git://github.com/federomero/ti-plugins.git ~/.ti | |
ln -s ~/Code/ti/ti /usr/local/bin/ti | |
echo "export NRTT_PREFIX='NeonRoots'" >> ~/.bashrc |
This file contains 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 'alexa' | |
key = "…" | |
secret = "…" | |
client = Alexa::Client.new(access_key_id: key, secret_access_key: secret) | |
STDIN.each_line do |l| | |
url = l.rstrip | |
rank = client.url_info({ |
This file contains 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 'json' | |
require 'open-uri' | |
access_token = "…" | |
begin | |
urls_file = File.open('./urls.txt', 'w') | |
likes_file = File.open('./likes.txt', 'w') | |
STDIN.each_line do |l| | |
url = l.rstrip |
This file contains 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(){ | |
var toggle = $('<div id="pomelo-toggle"><a href="#">⌽</a></div>') | |
toggle.css({ | |
position: 'fixed', | |
'font-size': '30px', | |
right: '10px', | |
top: '10px', | |
'z-index': '1001', | |
height: '24px', | |
}); |