With the production server, we have to disable the error reporting. However, sometime we need to really see the error for debugging purpose. We can use this code to display the error at runtime:

<?php
error_reporting(E_ALL);
ini_set(“display_errors”, 1);

Or we can better debug with an if statement, for example

<?php
if($_GET['SECRET_PASSWORD'] == ‘SOME SECRET PASSWORD’) {
error_reporting(E_ALL);
ini_set(“display_errors”, 1);
}

we can use a secret password to display error like: http://myurl.com?SECRET_PASSWORD=xxx

or we can limit to only our IP address (recommend).


header(‘X-JSON: (‘ . json_encode($data) . ‘)’);

header(‘Content-type: application/x-json’);

echo json_encode($data);


https://addons.mozilla.org/en-US/firefox/addon/383

What the plugin does basically auto copy a text when you highlight it.

To paste, click the mouse wheel or a middle button.


Dock can be enabled on Ubuntu by installing gnome-do

sudo apt-get gnome-do

More information about Gnome-do can be accessed from – http://do.davebsd.com/wiki/index.php?title=Docky


I’m a nerd. So I want to find a way to empty the trash by terminal. I found this:

sudo rm -Rf ~/.Trash/*

It works perfect. All files are removed. Earlier I had a few flies that stop me from having an empty trash :)

+1 for command line :)