Display php error at runtime
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).
Filed under: IT | Leave a Comment
Tags: display, error, php, runtime
Json header for prototype (PHP)
header(‘X-JSON: (‘ . json_encode($data) . ‘)’);
header(‘Content-type: application/x-json’);
echo json_encode($data);
Filed under: IT | Leave a Comment
Tags: header, js, json, php, prototype
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.
Filed under: IT | Leave a Comment
Enabling dock on Ubuntu
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
Filed under: IT | Leave a Comment
Tags: dock, gnome-do, ubuntu
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
Filed under: IT | Leave a Comment
Tags: empty, mac, remove, sudo, trash
Recent Entries
- Display php error at runtime
- Json header for prototype (PHP)
- A perfect Firefox Extension for copying and pasting
- Enabling dock on Ubuntu
- Empty a trash on mac like super users do …
- Fixing Macbook iSight
- How to install Piwik Statistics System
- How to copy fonts from Windows to Mac
- How to upgrade SVN on a mac
- Removing ^M at the end of every lines in Vi/Vim
- SVN Repository View in Eclipse
Categories
- IT (41)
- Research Repository (4)