Skip to content

Instantly share code, notes, and snippets.

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?
@brenes
brenes / letsdo.thor
Created January 13, 2011 09:07 — forked from mort/letsdo.thor
# My first Thor script is a helper to the productivity strategy of having an
# specific /etc/hosts file that blocks Twitter, Facebook, porn sites, and other
# unwanted distractions, during certains time of the day.
# Copy of your regular hosts file to /etc/hosts.play
# Create a /etc/hosts.work file with all the blocked sites on it
# Use 'thor lets:do [work|play]' to switch to the desired mental context.
# 'work' and 'play' are orientative, use whichever keywords suit you best.
# Nothing keeps you from keeping n different 'contexts' around.
unless ARGV[0].nil?
File.open(ARGV[0],'r').each do |line|
line.gsub!(/\(|\)|,/,'')
versions = line.split
gem_name = versions.shift
versions.each do |version|
puts "gem install #{gem_name} -v=#{version} --ignore-dependencies"
system("gem install #{gem_name} -v=#{version} --ignore-dependencies")
@brenes
brenes / colorize_git_ps1.bash
Created June 14, 2011 13:51 — forked from afgomez/colorize_git_ps1.bash
Color current git branch in prompt
# Color the current git branch in prompt
# red -> we are in master, take care!
# blue -> just a normal branch. Carry on
function __colorize_git_ps1 () {
local branch=$(__git_ps1 "%s")
if [ -n "$branch" ]; then
local color
if [[ $branch == master* ]]; then
color="31" #Red
@brenes
brenes / Cucumber Plain Text Feature.tmLanguage
Created September 28, 2011 16:00 — forked from unixmonkey/Cucumber Plain Text Feature.tmLanguage
Cucumber Language definition file for TextMate; modified to work with Sublime Text 2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>feature</string>
</array>
<key>firstLineMatch</key>
<string>기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd(.*)</string>
@brenes
brenes / .gitignore
Created January 29, 2012 23:33 — forked from karmi/.gitignore
Simple ping:pong WebSockets server and client in Ruby (em-http and em-websocket
Gemfile.lock
@brenes
brenes / rawclone_bundler.rb
Created February 8, 2012 12:21 — forked from rsierra/rawclone_bundler.rb
Script para generar el Gemfile de bundler a partir de un 'gem list'
#!/usr/bin/env ruby
# So you want to start developing an already "woking" project. No
# bundle, config.gem's not present or messing up dependencies. Fear
# not!
# Do a "gem list" wherever the project is already working
# (production?, some colleage machine?). Make a file with this format:
#
# chronic (0.2.3)
# colored (1.1)
@brenes
brenes / index.html
Created February 8, 2012 19:16 — forked from enjalot/index.html
Simple Pie Chart example with D3.js
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script>
<style type="text/css">
@brenes
brenes / 1ST README
Last active December 11, 2015 21:39 — forked from rsierra/1ST README.md
Rails 2.3.5 version of the Rails 2.1.1 patch by @rsierra
Rails 2.3.5 patch for CVE-2013-0333 vulnerability:
If you can't upgrade your Rails installation you can get the OkJson parser and include it in your project. How?
- Add cve_2013_0333_patch.rb in '/config/initializers' directory.
- Add okjson.rb in '/lib/active_support/json/backends' directory.
To test the parser, try to decode with a bad formatted json:
(I don't know if it's the best test, but you check if you are using the json parser in the rails 2.3 official patch)
@brenes
brenes / proc.rb
Last active August 29, 2015 14:14 — forked from qrush/proc.rb
# somewhere in your middleware stack...
# request.env['yourapp.someid'] = "1337"
YourApp::Application.configure do
config.log_tags = [
-> request {
request.env['yourapp.someid']
}
]
end