This file contains hidden or 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 hidden or 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
# Convertir video avi a flv | |
mencoder -forceidx -of lavf -oac mp3lame -lameopts abr:br=128 -srate 44100 -ovc lavc -lavcopts vcodec=flv:vbitrate=250:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -o video.flv video.avi |
This file contains hidden or 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
FECHAHORA=`date +%Y%m%d-%H%M` | |
/usr/bin/mysqldump --opt -uUSER -pPASS -hlocalhost disolventes > /home/BACKUP_DIR/backup_bd_$FECHAHORA.sql | |
gzip /home/BACKUP_DIR/backup_bd_$FECHAHORA.sql | |
cp /home/BACKUP_DIR/backup_bd_??????01-0000.sql.gz /home/BACKUP_DIR_VIEJOS/ | |
find /home/BACKUP_DIR -ctime +60 -exec rm \{} \; |
This file contains hidden or 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
class User < ActiveRecord::Base | |
require 'digest/md5' | |
validates_presence_of :email, :password | |
def self.authenticate(email, password) | |
User.find_by_email_and_password(email, Digest::MD5.hexdigest(password)) | |
end | |
def password=(password) |
This file contains hidden or 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
# metodo antiguo | |
desc "Delete old sessions from database." | |
task :delete_old_sessions => :environment do | |
#puts "Removing old sessions from #{ENV['RAILS_ENV']} database" unless ENV['SILENT'] | |
sesiones = CGI::Session::ActiveRecordStore::Session.find(:all, :conditions => ['updated_at < ?', 3.hours.ago]) | |
sesiones.each {|s| s.destroy } | |
end | |
# para rails 2.3.5 | |
desc "Borrar de la base de datos la sesiones que han expirado ." |
This file contains hidden or 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
rake db:migrate:redo VERSION=20090506173825 | |
rake db:migrate:down VERSION=20090506173825 | |
rake db:migrate:up VERSION=20090506173825 |
This file contains hidden or 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
instalar una version especifica de rails: | |
sudo gem install rails --version=2.1.2 | |
sudo gem install rails -v=2.1.2 | |
This file contains hidden or 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
provincias = ['Alava','Albacete','Alicante','Almería','Asturias','Avila','Badajoz','Barcelona','Burgos','Cáceres', | |
'Cádiz','Cantabria','Castellón','Ciudad Real','Córdoba','La Coruña','Cuenca','Gerona','Granada','Guadalajara', | |
'Guipúzcoa','Huelva','Huesca','Islas Baleares','Jaén','León','Lérida','Lugo','Madrid','Málaga','Murcia','Navarra', | |
'Orense','Palencia','Las Palmas','Pontevedra','La Rioja','Salamanca','Segovia','Sevilla','Soria','Tarragona', | |
'Santa Cruz de Tenerife','Teruel','Toledo','Valencia','Valladolid','Vizcaya','Zamora','Zaragoza'] | |
comunidades = ["Andalucía", "Aragón", "Canarias", "Cantabria", "Castilla y León", "Castilla-La Mancha", "Cataluña", "Ceuta", "Comunidad Valenciana", "Comunidad de Madrid", "Extremadura", "Galicia", "Islas Baleares", "La Rioja", "Melilla", "Navarra", "País Vasco", "Principado de Asturias", "Región de Murcia"] |
NewerOlder