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
.DS_Store | |
myapp/ |
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
sentinel = 'Rails::Initializer.run do |config|' | |
gsub_file 'config/environment.rb', /(#{Regexp.escape(sentinel)})/mi do |match| | |
"\nrequire 'desert'\n#{match}" | |
end | |
def gsub_file(path, regexp, *args, &block) | |
content = File.read(path).gsub(regexp, *args, &block) | |
File.open(path, 'wb') { |file| file.write(content) } | |
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
# Lighter -- Campfire from the command line | |
# usage: ruby lighter.rb subdomain "Main Room" macournoyer@gmail | |
require "rubygems" | |
require "tinder" | |
require "readline" | |
require "highline/import" | |
class Lighter | |
def initialize(room) | |
@room = room |
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
# Mimic Mac OS X Finder's sort by name. | |
class Array | |
def finder_sort | |
sort { |a, b| a.to_finder_sort <=> b.to_finder_sort } | |
end | |
end | |
class String | |
def to_finder_sort | |
result = self.dup |
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
#!/bin/sh -e | |
# Usage: license | |
# Prints an MIT license appropriate for totin' around. | |
# | |
# $ license > COPYING | |
year=`date "+%Y"` | |
cat <<EOF | |
Copyright (c) $year Aitor García | |
Permission is hereby granted, free of charge, to any person obtaining |
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
- 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 |
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
STDOUT.sync = true | |
require 'queue' | |
start_time = Time.now.to_i | |
msg = 0 | |
queue = Queue.new("testing") | |
queue.subscribe do |obj| | |
msg += 1 |
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
# 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 |
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
def wadus(wadus = nil, options = {}) | |
puts "wadus = #{wadus.inspect}" | |
puts "options = #{options.inspect}" | |
end | |
wadus | |
# wadus = nil | |
# options = {} | |
# OK |
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
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? |
OlderNewer