Skip to content

Instantly share code, notes, and snippets.

View aitor's full-sized avatar
👊
Working!

Aitor García Rey aitor

👊
Working!
View GitHub Profile
- Una presentación sobre nada
"nothing happens on the show. You see, it's just like life. You know, you eat, you go shopping, you read.. You eat, you read, You go shopping." (Seinfield)
- The Lunar Society
"The Lunar Society of Birmingham was a dinner club and informal learned society of prominent industrialists, natural philosophers and intellectuals who met regularly between 1765 and 1813 in Birmingham, England."
- John Snow - The Ghost Map
"John Snow (15 March 1813 – 16 June 1858) was a British physician and a leader in the adoption of anaesthesia and medical hygiene. He is considered to be one of the fathers of epidemiology, because of his work in tracing the source of a cholera outbreak in Soho, England, in 1854."
- Historias individuales intricadas en un marco histórico
Hello Spanish Fans of 48 Hour Magazine,
First, thanks for your interest in our little project! Getting
requests for the magazine from abroad has been incredibly gratifying.
We've been contacted by dozens of people from all over Europe. As we
all now know, our print-on-demand provider, Magcloud, does not ship to
your country. We could send you each a copy, but that seems both
expensive for you and time-consuming for us. So, what we're trying to
do is find bookstores (or companies or people) in Madrid and
Barcelona, willing to buy at least 10 copies of the magazine and then
@aitor
aitor / client.rb
Created May 29, 2010 16:24 — forked from tobi/client.rb
STDOUT.sync = true
require 'queue'
start_time = Time.now.to_i
msg = 0
queue = Queue.new("testing")
queue.subscribe do |obj|
msg += 1
# Export your Wordpress posts to Tumblr (also allows to delete some.)
# Author: Alexandre Solleiro <[email protected]>
# How-to:
# 1. Export your Wordpress posts (http://en.blog.wordpress.com/2006/06/12/xml-import-export/)
# 2. Edit the information below to match your settings
# 3. To import, type "ruby wordpress2tumblr.rb --run" in the command line
# 4. To delete some posts, type "ruby wordpress2tumblr.rb --delete 1,2,3,4" where 1,2,3,4 are post numbers. (Be careful not to use spaces between IDs)
# Edit these
WP_EXPORT_PATH = "./wordpress.2009-09-14.xml" # path to the Wordpress Export file
// Set the date for urls like
// http://0.0.0.0:3000/09-04-2012/08:24(+8)
// [date] [hour] [offset]
url = document.location;
var match = /http(s)?:\/\/(www.)?([^\/]+)\/(\d{2})-(\d{2})-(\d{4})\/(\d{2}):(\d{2})\(([-+]?\d+)\)/i.exec(url);
specific_date = { day: match[4], month: match[5] - 1, year: match[6] }
specific_time = { hours: parseInt(match[7], 10), minutes: match[8] }
specific_offset=parseInt(match[9], 10)
@aitor
aitor / wadus.rb
Created July 2, 2010 10:53 — forked from porras/wadus.rb
def wadus(wadus = nil, options = {})
puts "wadus = #{wadus.inspect}"
puts "options = #{options.inspect}"
end
wadus
# wadus = nil
# options = {}
# OK
#!/usr/bin/env ruby
require 'open-uri'
require 'rubygems'
require 'nokogiri'
uri = "http://whatthecommit.com"
doc = Nokogiri::HTML.parse(open(uri).read)
puts doc.at("//div[@id='content']/p").inner_html
A backup from http://sites.google.com/site/redcodenl/creating-shazam-in-java-1 just in case
----
Creating Shazam in Java
A couple of days ago I encountered this article: How Shazam Works
This got me interested in how a program like Shazam works… And more importantly, how hard is it to program something similar in Java?
# How to make this more legible?
# n and m are any natural number
n=1; m=12
(n..m).map{|i|[sprintf("%02d", i),i]}
#=> [["01", 1], ["02", 2], ["03", 3], ["04", 4], ["05", 5], ["06", 6], ["07", 7], ["08", 8], ["09", 9], ["10", 10], ["11", 11], ["12", 12]]
@aitor
aitor / notification_flood.rb
Last active January 26, 2017 17:32 — forked from mort/Fighting notification flood with the alea gem
Fighting notification flood with the alea gem
# Activity streams' notifications to third parties are cool because they bring
# a feeling of a shared public space and increase the chance serendipitous findings
# But too much information quickly becomes noise, and relevant bits of news can
# disappear among a tsunami of irrelevant (to me) "x did y with z'
# What we're trying to do here is going from deterministic notifications
# (stuff happens, stuff gets broadcasted) to stochastic ones (stuff happens,
# stuff may gets broadcasted)