Skip to content

Instantly share code, notes, and snippets.

LucaTNT /
Last active August 29, 2015 14:21 — forked from giu1io/
Cleans OS X's Notification Center
# Author: @giu1io
# Thanks @LucaTNT for making the script work on < 10.10
MAJOR_OSX_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $2}')
if [[ $MAJOR_OSX_VERSION -ge 10 ]]
DB_PATH="$HOME/Library/Application Support/NotificationCenter/"
LucaTNT / casualtext.php
Created November 13, 2012 21:38
Generatore di frasi casuali
View casualtext.php
/* Casual Text
* Autore: Luca Zorzi
* Data: 13/11/2012 (originariamente risale circa al 2004-2005)
* Licenza: BSD
* Scopo: nessuno
* Funzionamento: inserire 4 file txt nella stessa cartella in cui risede questo script:
* nomi.txt dovrà contenere dei nomi, singolari
* verbi.txt dovrà contenere dei verbi TRANSITIVI, non vogliamo frasi come pisciare il cane oppure salire le valigie
* complementi.txt dovrà contenere dei complementi oggetti, che saranno generalmente altri nomi
LucaTNT / gist:5520296
Created May 5, 2013 09:34
Custom XBMC keyboard.xml to be used with Samsung CEC-capable TV and RaspBMC running on a Raspberry PI
View gist:5520296
LucaTNT / gist:5540119
Created May 8, 2013 12:28
Custom XBMC keyboard.xml to be used with chinese USB infrared remote control that emulates a keyboard. Here it is:
View gist:5540119
<!-- reload Keymap, n on the actual keyboard -->
<!-- Orange movie button brings to Movie list -->
<b mod="ctrl,alt">ActivateWindow(Videos,MovieTitles)</b>
<!-- Yellow TV button brings to TV Show list -->
LucaTNT / Vibrazioni
Last active December 17, 2015 12:09
View Vibrazioni
% Programma per verificare che la mia chiusura del problema sia buona
% Link al testo:
% Immagine risultante:
clear; close all; clc;
R = 10;
L = 15;
x_cir = @(x) R*sin(x);
y_cir = @(x) R*cos(x);
LucaTNT / parseTrenitaliaICS.php
Last active December 18, 2015 01:08
Parse Trenitalia ICS
View parseTrenitaliaICS.php
// Based on CalFileParser ( by Michael Mottola
// Author: @LucaTNT
// My code is MIT licensed as well
// Inserisci qui dove salvare il file ICS sistemato
$saveTo = '/Users/luca/Downloads/AddToiCal.ics';
* CalFileParser
LucaTNT / SalvaICS.applescript
Last active December 18, 2015 01:09
Salva il file ICS allegato alle mail di conferma di acquisto di Trenitalia Saves the ICS file attached to Trenitalia purchase confirmation emails.
View SalvaICS.applescript
-- Edited by @LucaTNT, originally from Nigel Garvey (
property theAttachmentPath : (path to downloads folder) as Unicode text
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with This_Message in theMessages
repeat with ma in mail attachments of This_Message
set n to name of ma
if n ends with ".ics" then
LucaTNT / prettyDateDifference.php
Created June 17, 2013 20:49
Make a pretty date difference from the current time
View prettyDateDifference.php
Make a pretty date difference from the current time
Author: Luca Zorzi (@LucaTNT)
License: BSD
function parseDate($timestamp)
// Current timestamp
# Author: Luca Zorzi (@LucaTNT)
# License: WTFPL (
# Connects to CrashPlan running in a FreeNAS jail and launches the Desktop APP, then reverts all the settings back to their defaults
LucaTNT /
Created May 1, 2016 10:57
An old script I made years ago to compare the response times of two DNS servers
# Author: Luca Zorzi <luca A_T tuttoeniente D_O_T net>
# License: CC Attribution (
# Release date: 2009-12-13
# A little script to compare 2 DNS servers
if [[ "$#" != "2" ]]
echo "USAGE: $0 dns-server-1 dns-server-2"
exit 1