Category: Small Tips

PHP Type Checking

Here’s a quick and dirty utility method for type checking an object or an array of objects. [cc escaped=”true” lang=”php”]/** * Ensure the object (or the first item in the * array of objects) is of the specified type *

Tagged with: , , ,

Force MS document’s extension and MIME type through .htaccess

The problem If you use MacOS and Chrome browser (recently this has been reported under other browsers and OS as well) you might have experienced an issue when downloading any Microsoft documents like Word, Excel, PoerPoint their file extension is

Tagged with: , , , , ,

Prevent caching of XML files with Apache .htaccess rules

I am having problems with a dynamically created images.xml being cached in internet explorer. The xml file is used by a flash slideshow player and for different pages on the site, has different images to show. IE isn’t reading the

Tagged with: , , , , , , , , , , , ,

Source Code -> Iframe with 100% Height

Ever wonder how to create an iframe that fills the entire height (and width) of a page? You probably tried writing something like: [cc lang=”html” escaped=”true”]<iframe width=”100%” height=”100%”></iframe>[/cc] and expected the iframe to fill up whatever it could. The width=100%

Tagged with: , , ,

Debugging with CSS – outline all elements

Sometimes document structure and layout could be very difficult and complex. To achieve some goals designers tend to use a lot of nested elements in their code and after that style them with CSS. What if you want to see

Tagged with: , , , , ,

Rotate element with CSS3 and some tricks

I see many people are playing around the net with the new CSS3 features. The biggest problem is that some features are still not very well or at all adopted by some browsers. Since Microsoft had officially announced the IE6

Tagged with: ,

JavaScript – First key from associative array

Working with arrays is very beneficial for every developer in every language. But in different languages some operations are done differently. Very good example is retrieving first key from an associative array in JavaScript. In PHP you could use “foreach“,

Tagged with: , , ,

Generate radio grpoup with JHTML

Joomla provides very useful class called JHTML that can be used to produce different HTML elements saving us time and code. The Joomla team has provided a very useful class loader method “_()” in which we can pass string for

Tagged with: , , , ,

Htaccess – redirect domain to WWW

If you have a website for sure you have come to the point wondering how to redirect all visitors to the WWW part of the domain. This is small tip explaining in details the actual .htaccess redirect. Enough talking let’s

Tagged with: , , , , ,