Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@raul
raul / js_test.html
Created May 9, 2011 21:55 — forked from javisantana/test.js
quick'n'dirty javascript testing framework
<!doctype html>
<html lang=en>
<head>
<title>quick'n'dirty js testing framework</title>
<meta charset=utf-8>
<style type="text/css" media="screen">
p { font: .8em courier; padding: .5em 1em; margin: 0;}
.pass { color: #4F8A10; background: #DFF2BF }
.fail { color: #D8000C; background: #FFBABA }
.error{ color: white; background: red }
#!/usr/bin/env ruby
#
# Joins paragraphs so that they span one long line.
# Quoted or indented text are left untouched.
# Useful for Gmail.
#
open('| pbcopy', 'w') do |pbcopy|
pbcopy.write(`pbpaste`.gsub(/([^>\n])\n(\w)/, '\\1 \\2'))
end
var detectBackOrForward = function(onBack, onForward) {
hashHistory = [window.location.hash];
historyLength = window.history.length;
return function() {
var hash = window.location.hash, length = window.history.length;
if (hashHistory.length && historyLength == length) {
if (hashHistory[hashHistory.length - 2] == hash) {
hashHistory = hashHistory.slice(0, -1);
onBack();
# Adapted for Rspec2. This won't work in RSpec 1.
# Put this code in acceptance_helper.rb or better in a new file spec/acceptance/support/javascript.rb
Rspec.configure do |config|
config.before(:each) do
Capybara.current_driver = :selenium if example.metadata[:js]
end
config.after(:each) do
#----------------------------------------------------------------------------
# Git Setup
#----------------------------------------------------------------------------
file '.gitignore', <<-FILE
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
public/uploads/*
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?