HTML: Make a Page Refresh Every xx Seconds

A quick tip for those who just started learning HTML. It’s possible to add a line of code in your HTML page so that it’s automatically refreshed every few seconds when loaded in the user’s browser. To make the page automatically refresh itself every 60 seconds, just insert the following code in the <head></head> section …

HTML: Make a Page Refresh Every xx Seconds Read More »

Microsoft Office 365 Review & Screenshots – What will you get?

Office 365 is a set of team collaboration / productivity web applications for professionals, businesses, government agencies and education institutions. It currently offers 3 different plans: For professionals and small businesses, $6 / user / month, basic features For midsize businesses and enterprises, $12 and more / user / month, advanced features For education And …

Microsoft Office 365 Review & Screenshots – What will you get? Read More »

DreamHost Promo Invitations – $100 Off!

DreamHost just gave me 5 promo invitations that could be used for new accounts only. Whoever uses one of the invitation codes to sign up with them would get $100 off for a two-year plan. Just use one of the 12-digit invitation code in the “Promo Code” field when signing up at DreamHost: 737871080684 599411300419 …

DreamHost Promo Invitations – $100 Off! Read More »

PHP: Display Files and Sub-directories of A Directory Recursively as A Tree

Given a directory, how to display the contents (directories and files under it) of it recursively and exhaustively? Here’s the code: $dir = ‘/path/to/directory’; // without trailing slash, can be absolute paths such as ‘/home/jim/public_html’ or relative paths such as ‘samples’ getDirContents($dir); function getDirContents($dir) { if (is_dir($dir)) { $dirs = explode(‘/’, $dir); $last_dir = $dirs[count($dirs) …

PHP: Display Files and Sub-directories of A Directory Recursively as A Tree Read More »

PHP Class: Convert Plural to Singular or Vice Versa in English

I was trying to find a PHP function or class that can convert English words / nouns in plural form into their singular form so that wordcrow.com automatically detects and redirects plural lookup to the singular page. After a while searching on Google, I found this class. This great class (Inflector) was ported from Ruby …

PHP Class: Convert Plural to Singular or Vice Versa in English Read More »

A few Amazon affiliate tips and my earnings of Mar. 2011

I’ve been a happy Amazon affiliate for over a year now and the monthly revenues have been steadily climbing up ever since I started promoting their products galore. The most recent month, Mar. 2011 has ended up making me over $400 in commissions or advertising fees. Attached on the right is the screenshot. Considering I …

A few Amazon affiliate tips and my earnings of Mar. 2011 Read More »

vBulletin: How to add more buttons to quick reply box toolbar?

When people are replying to a thread, going advanced editing would require an extra click as well as page loading time — very inconvenient. However, at gotalk.org, users would generally want to post a lot of code because it’s a programming language forum in nature. But vBulletin doesn’t come with a CODE button in the quick …

vBulletin: How to add more buttons to quick reply box toolbar? Read More »

vBulletin: Change default height of editor and quick reply box

The quick reply box of vBulletin is by default about 100px or less in height which is bit small for large chunks of text editing such as code. To change the default height of the quick reply box without having to click the enlarge button manually every time, you’ll have to edit the template: Changing …

vBulletin: Change default height of editor and quick reply box Read More »

MySQL: Get the exact size of a database by SQL query

phpMyAdmin doesn’t show the exact size in MB when the size of your database exceeds 1GB. It just shows something like 4.2GB, truncating everything out in the 100MB precision. So is it possible to get the database size in MB in exact numbers using MySQL query? Yes, it is: SELECT CONCAT(sum(ROUND(((DATA_LENGTH + INDEX_LENGTH – DATA_FREE) …

MySQL: Get the exact size of a database by SQL query Read More »

MySQL: How to export a database / table to XML?

You can export any MySQL database or table into an XML file by the exporting capabilities of phpMyAdmin, the web interface of MySQL. The problem with this approach, however, is that with large tables, you may have to manually export the table more than once by sections into several sequential XML files. A better approach …

MySQL: How to export a database / table to XML? Read More »

Linux: How to delete / remove hidden files with ‘rm’ command?

To delete all content in any directory, including all sub-directories and files, I’ve been using this: rm -rf somedir/* If it is to delete all content of the current directory: rm -rf * However, it turns out ‘rm -rf’ doesn’t remove hidden files such as .htaccess (Files with a name starting with a dot are …

Linux: How to delete / remove hidden files with ‘rm’ command? Read More »

Linux: How to ‘find’ and search ONLY text files?

The ‘find’ command in Linux systems searches through a directory and return files that satisfy certain criteria. For instance, to find a file that contains the string ‘needle text’ in the ‘mydocs’ directory: find mydocs -type f -exec grep -l “needle text” {} \; The problem of this approach is that it would search through ALL files …

Linux: How to ‘find’ and search ONLY text files? Read More »

Checklist slides to learn the new features in PHP 5.3 with examples

One of my old Internet friends Brad made a very nice online slide that introduces to you some of the exciting new features of PHP 5.3. I’m most interested in namespace that would make coding in a large project and code reuse much easier, especially for people who find keeping naming conventions a challenge in …

Checklist slides to learn the new features in PHP 5.3 with examples Read More »

A small mistake in a regular expression caused connection to reset – (.+)+

Was doing something with a regular expression and very oddly the connection keeps being reset every time I refresh the web page. I tried to narrow down the problematic line by removing the code in functional chunks. Finally it comes down to a preg_match() instance with a small bit in the regular expression that’s accidentally …

A small mistake in a regular expression caused connection to reset – (.+)+ Read More »

Scroll to Top