August 25, 2011
Display random posts in WordPress
WordPress posts may be randomly displayed using the [Get random results from a MySql table]({{ site.base_url }}{% post_url 2011-08-20-get-random-results-from-a-mysql-table ) tip placed in a simple...
Read →August 20, 2011
Get random results from a MySql table
It is possible to retrieve random results from a MySql table using the RAND() mathematical function. In order to get the random results, the RAND() function should be used in the ORDER BY clause,...
Read →August 6, 2011
Pretty print JavaScript with Google Chrome
The built-in Developer Tools from Google Chrome allows formatting of an inline (minified) JavaScript code to a human readable format. To format the JavaScript code, fire up the Developer Tools, go...
Read →May 7, 2011
Display banner text in command line
You can display banner-like texts with large characters created from regular characters using the FIGlet utility. The default output look like this (quotes are optional): Basic usage requires...
Read →October 2, 2010
Use your browser to decode base64 encoded data
If you are dealing with base64 encoded data you may find useful to know that any modern browser can easily decode it using the Data URI scheme. All you need is pass the encoded data to the browser in...
Read →March 11, 2010
CLI search and replace in multiple files
In this example you have some text files (.txt) with urls like "http://example.com, http://another-example.com...". What you are trying to do is to replace all "http" references with "https". You...
Read →October 11, 2009
Find all folders with same name in a directory tree and execute commands on
In a Linux CLI environment you can use the "find" command to search for files or folder. In this tutorial I will explain how to find folders having the same name in a directory tree and execute...
Read →October 3, 2009
PHP CLI increase memory limit
When running a PHP script from command line interface, a higher memory limit may be required in order for the script to be successfully executed. This can be achieved using the -d or --define option...
Read →July 12, 2009
Insert value 0 for primary keys with auto increment in MySQL
In order to insert value 0 in a field that is set as primary key for a MySQL table you need to execute the following query prior to any insert query: Mentioning the "SESSION" variable will make...
Read →November 24, 2008
Disable foreign key checks in MySQL
Disabling foreign key checks in MySQL is usefull when you are dealing with tables that use foreign keys (InnoDB engine). You can not delete (drop) multiple tables, a parent table or a child table...
Read →