How to enable Firebug Lite

Just insert the following code at the top of 'head'.


<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js#startOpened=true"></script>

CSS3 Media Queries - Target specific devices and orientation

/* Portrait */
@media screen and (orientation:portrait) {
    /* Portrait styles */
}
/* Landscape */
@media screen and (orientation:landscape) {
    /* Landscape styles */
}

/* iPad [portrait + landscape] */
/* Portrait */
@media only screen and (max-device-width: 1024px) and (orientation:portrait){
}
/* Landscape */
@media only screen and (max-device-width: 1024px) and (orientation:landscape) { 
}

/* iPhone [portrait + landscape] */
/* Portrait */
@media screen and (max-width: 320px) {
}
/* Landscape */

PHP - How to Display All Errors

error_reporting(E_ALL);
ini_set('display_errors', '1');

The Golden Ratio

The Golden Ratio: b = a * 1.61803399

CSS Header Comment

Added 9/23/2011:
http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutoria...

/* ===========================================================
 * Filename:
 * Description:
 * Version:
 * Website:	
 * Author:
 * =========================================================== */

How to scroll to top of window with jQuery


$(document).ready(function(){
$("html, body").animate({ scrollTop : 0 }, 'slow');
return false;
});

How to generate a random number with Javascript

/* The following will generate a random number between 1 and 100.
var numRand = Math.floor(Math.random()*101);

How to check if an element is visible with jQuery

if( $('#foo').is(':visible') ) {
    // it's visible, do something
}
else {
    // it's not visible so do something else
}

How to check which version of jQuery is loaded

var jQueryVersion = $().jquery;

console.log(jQueryVersion); // logs 1.x.x

How to check if jQuery is already loaded

// code to check if jquery is loaded already
/*
 * ------------------------------------------------------
 * First Method
 * ------------------------------------------------------
 */
try{
  var jQueryIsLoaded=jQuery;
  jQueryIsLoaded=true;
}
catch(err){
  var jQueryIsLoaded=false;
}

if(jQueryIsLoaded){
  // jQuery is loaded
}
else{
  // jQuery NOT loaded
}

/*
 * ------------------------------------------------------
 * Second Method
 * ------------------------------------------------------
 */
if (typeof jQuery == 'undefined') 
{  
Syndicate content