Skip to content

Instantly share code, notes, and snippets.

@sabas
sabas / simplecloak.html
Created May 16, 2014 08:54
A really simple mail cloaking script
<a href="#" onclick="this.href='mai'+'lto'+':'+window.atob('dGVzdEBleGFtcGxlLmNvbQ==')">
<img src="simplecloak.php?t=dGVzdEBleGFtcGxlLmNvbQ=="/>
</a>
@sabas
sabas / carsharing.geojson
Last active August 29, 2015 14:03
Car sharing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sabas
sabas / INGV.geojson
Last active August 29, 2015 14:04
Stazioni di rilevamento INGV
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sabas
sabas / magicpath.php
Created August 1, 2014 14:14
Calculate an abolute path against a root folder
<?php
/*
* magicpath.php
* Copyright 2013 Stefano Sabatini
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@sabas
sabas / refinery.geojson
Created August 2, 2014 17:51
Raffinerie presenti in Italia
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sabas
sabas / Del mappatore in vacanza
Created September 5, 2014 19:18
Ode a Cortesi?
In quel dell'isola di Ventotene,
un giorno arrivò un mappatore,
di completarla voleva l'onore.
Molti chiesero: ma cosa ne viene?
Disse: dei dati aperti l'amore.
con l'aiuto di altri da remoto
lui partì ad esplorare l'ignoto
girando tutto in diverse ore.
@sabas
sabas / haversine.js
Created November 2, 2014 11:35
Just an implementation of haversine formula in JS
function haversine(lat1,lon1,lat2,lon2)
{
var R = 6372797.560856;
var dlat = (lat2-lat1).toRad();
var dlon = (lon2-lon1).toRad();
var lonh=Math.sin(dlon*0.5);
lonh*=lonh;
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 2 columns, instead of 4. in line 1.
# Funded Startups
45.561575 12.440669 20lin.es http://web.map2app.com/The-Italian-Startup-Ecosystem/it/Funded-Startups/20lin.es/
45.561575 12.440669 Addictive http://web.map2app.com/The-Italian-Startup-Ecosystem/it/Funded-Startups/Addictive/
40.8652032 14.2880629 Admantx http://web.map2app.com/The-Italian-Startup-Ecosystem/it/Funded-Startups/Admantx/
45.436113 9.200977 ADRaptors http://web.map2app.com/The-Italian-Startup-Ecosystem/it/Funded-Startups/ADRaptors/
38.920267 16.251785499999983 Affaredelgiorno.it http://web.map2app.com/The-Italian-Startup-Ecosystem/it/Funded-Startups/Affaredelgiorno.it/
43.8607568 10.517102499999964 Alga Energy http://web.map2app.com/The-Italian-Startup-Ecosystem/it/Funded-Startups/Alga-Energy/
44.483507 11.421468 Angiodroid http://web.map2app.com/The-Italian-Startup-Ecosystem/it/Funded-Startups/Angiodroid/
41.8309576 14.103255499999932 App Tripper http://web.map2app.com/The-Italian-Startup-Ecosystem/it/Funded-Startups/App-Tripper/
39.219637 9.106661 Appeat.it http://web.map2app.co
@sabas
sabas / thumb.sh
Created December 13, 2014 16:09
Resize photos (found online)
#!/bin/bash
for file in ./*
do
# next line checks the mime-type of the file
IMAGE_TYPE=`file --mime-type -b "$file" | awk -F'/' '{print $1}'`
if [ "x$IMAGE_TYPE" == "ximage" ]; then
WIDTH=`imageinfo --width "$file"` # obtaining the image width
HEIGHT=`imageinfo --height "$file"` # obtaining the image height
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.