This file contains 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
adb forward tcp:9222 localabstract:chrome_devtools_remote |
This file contains 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
> ls -t ~/Downloads | head -1 | |
LISTA_MOVIMENTI_20140330101644484.csv | |
> cp `ls -t ~/Downloads | head -1` workfile.csv | |
This file contains 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
> cat workfile.csv | ruby -rcsv -ne ' | |
row = CSV.parse_line($_) | |
puts CSV.generate_line(row, {col_sep: ";" }) | |
' > work1.csv | |
> cat workfile.csv | ruby -rcsv -ne ' | |
row = CSV.parse_line($_) | |
row.each {|elem| elem.tr!(",.",".,") if elem.match(/^-?[0-9,.]+$/)} | |
puts CSV.generate_line(row, {col_sep: ";" }) |
This file contains 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
student=1 | |
topic=DownloadBoundServiceAsync | |
gdsrc=~/projects/coursera/posa-002/POSA-14-20140706/grading-drivers/week-8-assignment-7/W8-A7-ThreadedDownloads-BoundServices/src/edu/vuum/mocca/$topic.java | |
peer_assesment=./peer-assessments/week8/s$student/$topic.java | |
tmp_peer_assesment=./tmp/$topic.java | |
awk '{ sub(/\r$/,""); print }' < $peer_assesment > $tmp_peer_assesment | |
opendiff $gdsrc $tmp_peer_assesment |
This file contains 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
package org.rondadev.samples; | |
/** | |
* @author rondadev | |
* | |
*/ | |
public class StatelessCalculator { | |
public double add(double a, double b) { | |
return a + b; | |
} |
This file contains 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
package org.rondadev.samples; | |
/** | |
* @author rondadev | |
* | |
*/ | |
public class StatefulCalculator { | |
private StatelessCalculator calculator; | |
double register = 0; |
This file contains 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
# singleton-as-module loaded once, kept in memory | |
module App | |
module Global extend self | |
def calc | |
@calc ||= StatefulCalculator.new | |
end | |
end | |
end | |
This file contains 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
root = File.dirname(__FILE__) # => "." | |
require File.join( root, 'sample_app' ) # => true | |
run Sample # ..in sample_app.rb ..class Sample < Sinatra::Base |
This file contains 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
source :rubygems | |
gem 'sinatra' | |
gem 'warbler' |
This file contains 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
rvm use --create jruby-1.6.7@jruby_sinatra | |
export JRUBY_OPTS=--1.9 |
OlderNewer