2012

Customize WordPress Admin Styles from Your Theme Directory

It’s better to style the /wp-admin of WordPress from your theme because it’s portable and upgrade-proof. Keeping all customizations  in ONE place is always a good idea in web development. How to style WordPress admin backend /wp-admin from your theme? Add this hook to the functions.php of your theme: function customAdmin() { ?><link rel="stylesheet" type="text/css" href="<?php bloginfo(‘stylesheet_directory’); ?>/wp-admin.css" …

Customize WordPress Admin Styles from Your Theme Directory Read More »

Super Cheap Cloud VPS: 1 Core, 1024MB, SSD, Managed – Just $21.25 / Month

Some of my sites such as ConvertHub has grown out of the 512MB box I have had for over 2 years at Linode. It’s been great but as I’m fed up with managing the server myself (I’ll come to that later), I went ahead looking for a solid VPS plan with WHM / cPanel that’s …

Super Cheap Cloud VPS: 1 Core, 1024MB, SSD, Managed – Just $21.25 / Month Read More »

Make WordPress Hooked Function to Run Only Once

Consider this hook to add something before your WordPress blog’s sidebar: function before_siderbar() { ?> <!– Something goes here, such as an AdSense links unit –> <?php } add_action( ‘get_sidebar’, ‘before_siderbar’ ); It’s usual to add an AdSense links unit there but the problem with some themes is that they run get_sidebar more than once, …

Make WordPress Hooked Function to Run Only Once Read More »

Remove Gmail via Field and Add mailed-by & signed-by with PHP mail()

PHP mail() is a great function to easily send emails from your website server. If you have ever used it before in action, or are currently using mail() to send out emails from your website or application, chances are you would find Gmail to be very persistent in attaching a ‘via’ field to the from …

Remove Gmail via Field and Add mailed-by & signed-by with PHP mail() Read More »

Disable Source > Format (Ctrl + Shift + F) in Zend Eclipse PDT

It became a total mess when I selected the entire root directory of my project and accidentally clicked Source > Format in Zend Eclipse PDT. All the files were instantly re-formatted and saved in a manner I wasn’t comfortable with and there didn’t seem any easy way to undo these changes that had been applied …

Disable Source > Format (Ctrl + Shift + F) in Zend Eclipse PDT Read More »

PHP: Round to the Nearest 0.5 (1.0, 1.5, 2.0, 2.5, etc.)

The common practice of rounding, namely the round() function in PHP, is to round to the nearest decimal point, that is, 1.0, 2.0, 3.0, etc. or, 10, 20, 30, etc. For example, echo round(4.25, 0); // 4 echo round(3.1415926, 2); // 3.14 echo round(299792, -3); // 300000 When I’m trying to aggregate all the customer …

PHP: Round to the Nearest 0.5 (1.0, 1.5, 2.0, 2.5, etc.) Read More »

Change array() indentation and wrapped line indentation in Eclipse for PHP Developers

The default array() indentation of Eclipse for PHP Developers when you create an array seems to be 2 tabs which I think are too much. To reduce it to just 1 tab: Window => Preferences => PHP => Editor => Typing => formatter preference page => Edit… => Indentation => Default indentation of array initializers Or Window => …

Change array() indentation and wrapped line indentation in Eclipse for PHP Developers Read More »

500 Internet Server Error for Incorrect Permissions after Installing suPHP and Uploading PHP Script

Many’s the time after you have uploaded some PHP script to your server and point the web browser to the address it gives 500 Internet Server Error. If you have suPHP installed this is very likely because the uploaded PHP script (files and directories) have wrong permissions set to them. With regards to Linux permissions, …

500 Internet Server Error for Incorrect Permissions after Installing suPHP and Uploading PHP Script Read More »

vBulletin: Paid Subscription Not Showing Up

I was trying to start a premium membership for Kavoir Backyard and after I have created a Paid Subscription profile, nothing shows up in user control panel nor at /backyard/payments.php. As you can see from the thread I started in the official vBulletin forum for help, I have done everything necessary to create the subscription …

vBulletin: Paid Subscription Not Showing Up Read More »

Make Firefox to Not Send HTTP Referer (or On a Per-Site Basis)

By default browsers such as Firefox sends the Referer information to the target URL in the HTTP header, as defined by HTTP protocol, so the destination URL / website knows where you have come from. For instance, when you click this link to one of my friends’ sites, it would know you have arrived at …

Make Firefox to Not Send HTTP Referer (or On a Per-Site Basis) Read More »

MySQL: Incorrect key file error AND InnoDB: Error: unable to create temporary file; errno: 2

When I encounter the incorrect key file for table error, it’s almost certainly because the disk is full and MySQL can’t write to the tmpdir. The solution is simple, just move tmpdir to another partition with enough disk space. Open my.ini and change tmpdir to another directory with enough disk space. Restart MySQL and that …

MySQL: Incorrect key file error AND InnoDB: Error: unable to create temporary file; errno: 2 Read More »

Make phpMyAdmin Show Exact Number of Records for InnoDB Tables

By default, phpMyAdmin shows an estimated number of records for InnoDB tables that have more than 20,000 rows. It can vary by every fresh as much as 50% or even more. Makes it hard to get an exact number of records for the tables as we have to explicitly run an SQL query to do …

Make phpMyAdmin Show Exact Number of Records for InnoDB Tables Read More »

Amazing Science – Photons and Optical Fiber Cable

Today, most of our online data transmissions pass through fiber-optic cables. And as most of us know, fiber-optic cables are simply long, thin strands of glass which allow light to bounce and refract from one-end to the other without leaving the cable. It’s a bit like shining a flashlight down a long, mirrored tube. One …

Amazing Science – Photons and Optical Fiber Cable Read More »

How to Free C:\ Drive Disk Space in Windows 7 and Reduce System Size?

Windows 7 is a beast in consuming hard drive disk spaces, especially the system drive, C, which is constantly being filled up. After a while it will keep annoying you with low disk space warnings because C drive is running out of space and almost full. So how can I safely free up all the …

How to Free C:\ Drive Disk Space in Windows 7 and Reduce System Size? Read More »

Scroll to Top