Slopjong
A geek discovering the World, Tech & Science
Latest Posts
Programming
Mac
Linux
WordPress
Hardware
Howtos
Nerd Trash
Programming Archive
0
Display PHP code in a html code section
Posted on April 9, 2013
How do I display PHP code in HTML? you may ask yourself. Briefly, you cannot print a string with php code directly to a html code block as shown here: $php_string = [...]
Continue Reading
0
Lightbox2: Limit the max image size
Posted on April 2, 2013
Lightbox2 is a JavaScript technique used to display a high resolution image in a modal dialog while the rest of the website is darkened. Unfortunately the original code of Lightbox2 shows [...]
Continue Reading
0
reCAPTCHA and this strange Uncaught TypeError
Posted on March 5, 2013
During some refactoring and code improvements in OpenSpaceLint (a validator for a specific json schema implementation) I replaced a Javascript module by some equivalent PHP code and for whatever reason [...]
Continue Reading
0
PHP: sort an array by key case-insensitive
Posted on February 26, 2013
In some situations one wants to sort an array by key but PHP's
ksort()
function sorts case-sensitive which is not always what you want. The result of ksort is an order like
A < C < b
instead of
A < b < C
. PHP 5.4.0 has introduced the
SORT_FLAG_CASE
flag to sort case-insensitive. This article shows two simple implementations to get the same functionalityIf in PHP 5.2 or 5.3 .
Continue Reading
4
When a comment leads to a syntax error in Bash
Posted on December 4, 2012
When you are writing Bash scripts and commenting out commands which are performing arithmetic operations you must be aware that they’re still interpreted in particular cases. Let’s assume we have the [...]
Continue Reading
Next Page »