Monday, 24 November 2014

Check if an array is multi-dimensional

if (count($array) == count($array, COUNT_RECURSIVE)) 
  echo 'array is not multidimensional';
  echo 'array is multidimensional';

Filtering data with PHP (Sanitizing data) and Validation

To filter arrays:

Get url query string parameters using Javascript only

Difference between array merge and array + array

Responsive Design: Screen resolution reference

Using rems

CSS Clear Fix

Parallax websites

Single Page Website

Install both OpenJDK and Oracle Java on Fedora

Use the "alternatives" app to switch between the two.

Assign event to Escape keypress

$(document).keyup(function(e) {
  if (e.keyCode == 27) { some_code_here }   // esc

CSS 3 resize property

Doesn't work on iframes in Firefox  33

Prevent link from doing default action

$( "a" ).click(function( event ) {

Make link open in parent of iframe

window.parent.location.href= "";

Saturday, 8 November 2014

Restrict web site access to specific IP addresses in Apache

order deny,allow
deny from all
allow from 111.222.333.444

Put the above code in the .htaccess in the root. You can add more "allow from" lines for more ip addresses.

Friday, 7 November 2014

Word wraping by word breaking

.break-word {
  word-wrap: break-word;