Skip to content

Instantly share code, notes, and snippets.

@rondinif
rondinif / gist:9870604
Created March 30, 2014 10:14
Come ottenere il nome dell'ultimo file scaricato, come copiare l'ultimo file scaricato in file di lavoro temporaneo.
> ls -t ~/Downloads | head -1
LISTA_MOVIMENTI_20140330101644484.csv
> cp `ls -t ~/Downloads | head -1` workfile.csv
@rondinif
rondinif / gist:9058989
Created February 17, 2014 20:59
Debugging Mobile Chrome using Desktop Chrome via ADB port forwarding.
adb forward tcp:9222 localabstract:chrome_devtools_remote
@rondinif
rondinif / gist:6628904
Created September 19, 2013 19:50
Test code for the issue exposed in: (Not able to view ComboBox in Excel using JXL API)[http://stackoverflow.com/questions/18780151/not-able-to-view-combobox-in-excel-using-jxl-api]
/*
* Test code for the issue exposed in:
* http://stackoverflow.com/questions/18780151/not-able-to-view-combobox-in-excel-using-jxl-api
* -jar jxl.jar
* [jxl 2.6.12 2009-10-26](http://jexcelapi.sourceforge.net/)
* javac 1.7.0_25
*/
package org.rondakit.jxl.tester;
import java.io.File;
rvm use --create jruby-1.6.7@jruby_sinatra
export JRUBY_OPTS=--1.9
@rondinif
rondinif / Gemfile
Created April 29, 2013 11:49
Gemfile
source :rubygems
gem 'sinatra'
gem 'warbler'
root = File.dirname(__FILE__) # => "."
require File.join( root, 'sample_app' ) # => true
run Sample # ..in sample_app.rb ..class Sample < Sinatra::Base
@rondinif
rondinif / sample_app.rb
Created April 29, 2013 11:47
sample_app.rb
# singleton-as-module loaded once, kept in memory
module App
module Global extend self
def calc
@calc ||= StatefulCalculator.new
end
end
end
@rondinif
rondinif / StatefulCalculator.java
Created April 29, 2013 11:44
StatefulCalculator.java
package org.rondadev.samples;
/**
* @author rondadev
*
*/
public class StatefulCalculator {
private StatelessCalculator calculator;
double register = 0;
@rondinif
rondinif / StatelessCalculator.java
Last active December 16, 2015 18:50
StatelessCalculator.java
package org.rondadev.samples;
/**
* @author rondadev
*
*/
public class StatelessCalculator {
public double add(double a, double b) {
return a + b;
}