Skip to content

Instantly share code, notes, and snippets.

@LucaTNT
LucaTNT / casualtext.php
Created November 13, 2012 21:38
Generatore di frasi casuali
<?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
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
<keymap>
<global>
<keyboard>
<n>XBMC.Action(reloadkeymaps)</n>
</keyboard>
<remote>
<four>ActivateWindow(filemanager)</four>
<five>ActivateWindow(home)</five>
<seven>ActivateWindow(Videos,MovieTitles)</seven>
<eight>ActivateWindow(Videos,TvShowTitles)</eight>
@LucaTNT
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: http://dx.com/p/multimedia-ir-remote-controller-with-usb-receiver-for-pc-1-cr2025-26368
<keymap>
<global>
<keyboard>
<!-- reload Keymap, n on the actual keyboard -->
<n>XBMC.Action(reloadkeymaps)</n>
<!-- Orange movie button brings to Movie list -->
<b mod="ctrl,alt">ActivateWindow(Videos,MovieTitles)</b>
<!-- Yellow TV button brings to TV Show list -->
@LucaTNT
LucaTNT / Vibrazioni
Last active December 17, 2015 12:09
% Programma per verificare che la mia chiusura del problema sia buona
% Link al testo: http://cl.ly/P3ia
% Immagine risultante: http://cl.ly/P4Zz
clear; close all; clc;
R = 10;
L = 15;
x_cir = @(x) R*sin(x);
y_cir = @(x) R*cos(x);
@LucaTNT
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.
-- Edited by @LucaTNT, originally from Nigel Garvey (http://macscripter.net/viewtopic.php?id=29010)
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
LucaTNT / parseTrenitaliaICS.php
Last active September 19, 2023 06:24
Parse Trenitalia ICS
<?php
// Based on CalFileParser (https://github.com/controlz/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
LucaTNT / prettyDateDifference.php
Created June 17, 2013 20:49
Make a pretty date difference from the current time
<?php
/*
Make a pretty date difference from the current time
Author: Luca Zorzi (@LucaTNT)
License: BSD
*/
function parseDate($timestamp)
{
// Current timestamp
@LucaTNT
LucaTNT / recordCam.sh
Last active June 17, 2021 19:56
Record Foscam IP camera live feed
#!/bin/bash
# recordCam.sh
# ------------
# This script saves the live video from the Foscam IP camera to a full-quality mp4 file.
# I chose to split the files every 15 minutes (900 seconds), to quickly find the time I need.
# Note: audio is not saved as my cameras don't have a microphone connected to them.
# -----------
# Author: @LucaTNT
# License: BSD
@LucaTNT
LucaTNT / convertVideo.sh
Created August 1, 2014 11:04
Convert IP camera recordings to lower quality for archiving
#!/bin/bash
# convertVideo.sh
# ---------------
# This script converts the original, high quality recording to a much smaller
# and lower quality file for archiving purposes.
# ---------------
# Author: @LucaTNT
# License: BSD
# Define some paths
@LucaTNT
LucaTNT / lookForNewiOS.sh
Last active March 28, 2018 17:59
Automatic iOS firmware downloader
#!/bin/bash
# lookForNewiOS.sh
# Author: Luca Zorzi (@LucaTNT)
# Version: 0.2 (2014/11/20)
# License: BSD
# -----------------------------
# This scripts uses icj.me's API to check if there are new iOS releases for
# the iOS devices specified in the MODELS array. You can put any number of devices,
# as long as they are in an array (space separated, enclosed in brackets).
# If a new release is available, it gets download into the DESTINATION_FOLDER, respecting