Here you will find details of news, projects, releases and other bits and pieces that we are working on at Boolean.
We hope that you find something of interest amongst the archives.
Code snippets, methodologies and useful links will also be mentioned here.
![]() |
In an update to this post here is another way to obtain the number of likes for a Facebook page.
I’ll assume that you’ve already registered a Facebook application, have downloaded the PHP SDK and have included for use in your code.
Setup an array with your Facebook applications credentials
Decide which page you wish to obtain the number of likes for
Obviously you can consume, contrast and display this information in more exciting ways than simply echoing it to the screen. Enjoy.
![]() |
There are a few reasons to force a trailing slash at the end of URLs including SEO
A quick snippet for your .htaccess is below:
And while I’m here a quick snippet to prevent hotlinking of images. This will redirect all requests to a specified image, simply replace yoursite.com with your own URL, and nohotlinking.jpg with your own image and path.
And finally a snippet to put in your image assets folder (you have images stored separately right?) to prevent malicious code execution and prevent directory listing of all your assets.
Firefox has a limitation for cross domain font embedding in that it does not allow you to embed from another website. This .htaccess snippet allows you to bypass this limitation and embed fonts located on another webserver.
![]() |
All URLs on Gravatar are based on the use of the hashed value of an email address. According to their best practice you should:
Of course in PHP this is trivial as the following function shows:
Profiles are also available if you require them.
Property list files (.pfiles) store serialized objects and are often used to store a user’s settings. They are also used to store information about bundles and applications in OSX and recently iOS.
Danilo Campos wrote some time ago some background information and provided his source and blogged about the subject. Better than that however, he provided an OSX binary to download if you want to get going straight away.
This little application makes it easy to format and process your source data in a familiar environment like Excel and then convert ready to use in your application.
| |
Occasionally a webhost will block the very useful phpinfo() command making it difficult to understand any limitations of the server configuration. This script can display relevant information to help you understand what is happening behind the scenes.
if(!is_null($d_func) && $d_func !== “”){echo “Disabled Functions: \n $d_func”;}
if(!is_null($safe_mode) && $safe_mode !== “”){echo “<span style=’color:red;’>Safe Mode is Active</span> <br>”;}
if($up_max >= 1001){$up_max = $up_max / 1024; $up_max_size = “Gigabytes”;
if($up_max >= 10001){$up_max = $up_max / 1024; $up_max_size = “Terabytes”;}}
if($post_max >= 1001){$post_max = $post_max / 1024; $post_max_size = “Gigabytes”;
if($post_max >= 10001){$post_max = $post_max / 1024;$post_max_size = “Terabytes”;}}
if (min($input_max,60)){$input_max = $input_max /60;}
if (min($exec_time,60)){$exec_time = $exec_time /60;}
if($mem_limit >= 1001){$mem_limit = $mem_limit / 1024; $mem_limit_size = “Gigabytes”;}
echo “Maximum Upload Size = $up_max $up_max_size<br>”;
echo “Maximum Post Size = $post_max $post_max_size <br>”;
echo “Maximum Input Time = $input_max minute/s<br>”;
echo “Memory Limit = $mem_limit $mem_limit_size<br>”;
echo “Maximum Execution Time = $exec_time minute/s<br>”;
?>
![]() |
Alternating row colours within a grid of data can make for a more pleasant viewing experience and has become a popular styling method in recent times. I was a little incredulous at some code I saw recently to determine alternating rows so without further introduction, meet the Modulo operator which is a quick and easy way to get up and running:
I’m sure you will be able to apply this to your own css or styling within your loops.
![]() |
Sometimes you might want to determine a remote file size prior to determining further action to take. This is a quick function that utilises cURL to retrieve the file size in bytes.
Usage is simple: