Skip to content

Instantly share code, notes, and snippets.

View luisparravicini's full-sized avatar

Luis Parravicini luisparravicini

View GitHub Profile
@luisparravicini
luisparravicini / composite.rb
Created March 25, 2012 13:47
Compose several images using ImageMagick
require 'fileutils'
include FileUtils
dir = ARGV.shift
method = ARGV.shift
if dir.nil? || method.nil?
puts "usage #{$0} <image-dir> <method>"
exit 1
end
@luisparravicini
luisparravicini / uncrush.rb
Created October 31, 2011 17:13
Revert optimizations made on .png files for iOS and leave them on their corresponding directory (if all the png are in a single dir, use pngcrush -d instead).
require 'fileutils'
include FileUtils
$dir = ARGV.shift
if $dir.nil?
puts "usage: #{$0} <dir>"
exit 1
end
Dir.glob("#{$dir}/**/*.png").each do |path|
#!/usr/bin/ruby1.9.1
#
# Reads the next line from a file and tweets it. It saves the position
# of the last line read so successive executions will use different
# lines of text. Authentication info is read from a file with YAML.
#
# http://ktulu.com.ar/blog/2010/05/07/twiteos-automaticos/
# lparravi@gmail.com
@luisparravicini
luisparravicini / isbn_search.rb
Created December 11, 2009 20:54
Busca la informacion de un libro segun su isbn
#!/usr/bin/ruby1.9.1
# Script para traducir isbn a informacion del libro buscando en varias
# librerias online. Se probo por ultima vez el 2009-12-11.
#
# Author:: Luis Parravicini
# Copyright:: Copyright (C) 2009 Luis Parravicini
# License:: GPL v2
#
# http://ktulu.com.ar/blog/2009/12/11/traduciendo-isbn/
@luisparravicini
luisparravicini / DumpIndex.java
Created October 12, 2009 14:40
Dumps a Lucene index as a XML document.
import java.io.File;
import java.io.IOException;
import java.util.List;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import org.apache.lucene.document.Document;
@luisparravicini
luisparravicini / jquery.twitter.js
Created October 3, 2009 15:25
Use Twitter api with JQuery to update news on a web page
/*
jquery twitter. By Luis Parravicini.
http://ktulu.com.ar/blog/2009/10/03/twitter-updates-with-jquery/
*/
(function($) {
$.twitter_updates = function(options) {
var defaults = { 'count': 10 }
var opts = $.extend(defaults, options)
var elem = this
@luisparravicini
luisparravicini / inscribir.rb
Created June 5, 2009 23:28
Inscripcion automatica al torneo diario de elbruto.es
#!/usr/bin/ruby
#
# Inscribe a un jugador de elbruto.es a los torneos.
#
# El nombre del jugador y la clave se definen en conf.yaml
#
# escrito por Luis Parravicini (lparravi@gmail.com)
require 'yaml'