Tuesday, 20 November 2012

Show/Hide invisible files in Mac OS

In terminal, type the following:

defaults write com.apple.Finder AppleShowAllFiles YES/NO 
And to unhide Files/Folders:

  sudo chflags nohidden ~/Folder

unhide all subFolder and files:

  sudo chflags -R nohidden ~/Folder

Monday, 12 November 2012

PHP set(display) local time and locale

<?php
//set timezone
$timezone_offset = +8;
$current_time = gmdate('H:i:s', time()+$timezone_offset*60*60);

echo "Current time is $current_time. "

$loc_uk = setlocale(LC_ALL, 'eng');
echo "Preferred locale on this system is $loc_uk";

?>

For supported locale for windows, see here.