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 of http://sites.google.com/site/redcodenl/creating-shazam-in-java-1 just in case | |
Why is this necessary? Read http://sites.google.com/site/redcodenl/patent-infringement | |
Please fork, tweet about, etc. | |
---- | |
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? |
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 'irb/completion' | |
require 'irb/ext/save-history' | |
require 'rubygems' | |
require 'wirble' | |
require 'hirb' | |
#completion | |
ARGV.concat [ "--readline", "--prompt-mode", "simple" ] |
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 Setup | |
#---------------------------------------------------------------------------- | |
file '.gitignore', <<-FILE | |
.DS_Store | |
log/*.log | |
tmp/**/* | |
config/database.yml | |
db/*.sqlite3 | |
public/uploads/* |
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
the work-around is to get a console ("irb -rinit") and do "Integrity::Build.all.select { |b| b.commit.nil? }.each { |b| b.destroy! }" |
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
Feature: Cool AJAX autocomplete | |
Scenario: Autocomplete city | |
When I fill in "City" with "Madr" | |
Then I should see "Madrid, Spain" | |
When I follow "Madrid, Spain" | |
Then the field "City" should contain "Madrid, Spain" |
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
Before('@selenium') do | |
if ENV["SELENIUM_HEADLESS"] == 'true' | |
require "headless" | |
@headless = Headless.new | |
@headless.start | |
end | |
end | |
After('@selenium') do | |
@headless.destroy if @headless.present? |
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
#Así he implementado tu propuesta como scope: | |
named_scope :normalized_name_begins_with, lambda { |term| | |
map = [ | |
"âãäåāăąÁÂÃÄÅĀĂĄèééêëēĕėęěĒĔĖĘĚìíîïìĩīĭÌÍÎÏÌĨĪĬóôõöōŏőÒÓÔÕÖŌŎŐùúûüũūŭůÙÚÛÜŨŪŬŮñÑçÇüÜ".mb_chars, | |
"aaaaaaaaaaaaaaaeeeeeeeeeeeeeeeiiiiiiiiiiiiiiiiooooooooooooooouuuuuuuuuuuuuuuunnccuu"] | |
# ActiveSupport::Multibyte::Chars#tr broken? | |
adapted_word = "%#{term.mb_chars.split(//).map {|e| (p = map[0].index(e)) ? map[1][p,1] : e.to_s }.join.downcase}%" | |
{ |
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
// Snippet by @ayosec on IM - Thx ayose! :) | |
//:ruby | |
//= form.input :city_id, :as => :string, :input_html => { :value => resource.city_id } | |
//:javascript | |
jQuery(function() { city_autocompleter("#resource_city_id", "#{escape_javascript resource.localized_city_long_name || params[:city]}") }); | |
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
// HTML using 960.gs | |
<body> | |
<div class="container_16"> | |
// more stuff | |
<div class="grid_4"> | |
Sidebar | |
</div> |