Skip to content

Instantly share code, notes, and snippets.

grep -h "<testcase" `find . -iname "TEST-*.xml"` | sed 's/<testcase name="\(.*\)" classname="\(.*\)" time="\(.*\)".*/\3\t\2.\1/' | sort -rn | head
@pdincau
pdincau / gist:ea60d1fc7d900a61ae0c
Created February 17, 2015 13:00
separatore string calculator
Estrarre separatore string calculator
Pattern pattern = Pattern.compile("//(.+?)\n(.+)");
Matcher matcher = pattern.matcher(input);
if (matcher.matches()) {
System.out.println(matcher.group(1));
}
cowboy static files:
src
priv
in priv
static/js
index.html
index referenzia js come <script src="/static/js/controllers.js"></script>
@pdincau
pdincau / gist:0825ad51adbcd52ee83c
Last active August 29, 2015 14:22
amazon links
jQuery(document).ready(function() {
var attributes = {}
attributes["IT"] = 'data-amazon-it';
attributes["GB"] = 'data-amazon-gb';
var url = "http://freegeoip.net/json/ ";
jQuery.getJSON(url, function(data) {
var code = data.country_code;
var links = jQuery('[data-amazon]');
jQuery.each(links, function(index, link) {
sudo -u postgres createdb --locale it_IT.utf8 --encoding UTF8 --template template0 mopapp
postgres -D /opt/boxen/homebrew/var/postgres
@pdincau
pdincau / README.md
Last active August 29, 2015 14:24 — forked from cloudbring/README.md
@pdincau
pdincau / gist:08f7b2fac39088c87b75
Last active December 26, 2016 00:51
Things I learned about ExUnit
Run tests:
mix test
Run single test file:
mix test path/to/file
Run single test:
@pdincau
pdincau / service-checklist.md
Created July 6, 2017 12:17 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?

Takeaways from TDD and Software Design

video

  • TDD by its own CANNOT leads to good design, obviously
  • TDD as a mechanism to help us to learn more about good design
  • Software is "Soft" just because it can be changed, it is not meant to be settled in the stone
  • Test-first programming can help the team to reduce defects but it will not lead to good design

Code qualities