Skip to content

Instantly share code, notes, and snippets.

View fvianello's full-sized avatar

Flavio Vianello fvianello

  • AKQA
View GitHub Profile
@fvianello
fvianello / seconds_to_human.php
Created July 18, 2012 14:53
convert seconds to human timing
<?php
function humanTiming($time)
{
$tokens = array (
86400 => 'giorno/i',
3600 => 'ore',
60 => 'minuti',
1 => 'secondi'
);
$string = "";
@fvianello
fvianello / Applescript to open selected file in finder with specific editor
Created February 20, 2012 09:55
This Applescript take the selected file in Finder and open it with Sublime Text 2 (~/bin/subl). Using Alfred you can bind a global hotkey for this script, so you can edit your files with just a keypress, without worrying about the default editor.
tell application "Finder"
activate
set filePath to (POSIX path of (target of front window as alias))
set fileAlias to the selection as alias
set fileName to name of fileAlias
do shell script "~/bin/subl " & filePath & fileName
end tell