Coda Clips

Unify Div Heights (using jQuery)

// Make the height of all the innerDivs the same height based on the tallest one.
  function unifyHeights() 
  {
    var maxHeight = 0;
    $('div#OuterContainer').children('div').each(function(){
      var height = $(this).outerHeight();
      //alert(height);
      if ( height > maxHeight ) { maxHeight = height; }
    });
    $('div.innerDivs').css('height', maxHeight);
  }

Added to by Michael D. Noga

Install Clip


PHP switch

switch ($op)
{
case 'op1':
 //code to be executed if $op = op1;
 break;  
case 'op2':
 //code to be executed if $op = op2;
 break;
default:
 //code to be executed
 //if expression is different 
 //from both op1 and op2;
}

Added to by David Reed

Install Clip


Drupal: watchdog

watchdog('type', 'message', null, 'WATCHDOG_NOTICE', 'link');

Added to by David Reed

Install Clip


Drupal: link

l('label', 'path', array('query' => 'destination=node'));

Added to by David Reed

Install Clip


Drupal: set message

drupal_set_message('message', 'status');

Added to by David Reed

Install Clip


Include

<?php
include(example.php)
?>

Added to by Chris O'Donnell

Install Clip


Sitemap XML

<?xml version=”1.0” encoding=’UTF-8’?> 
<urlset xmlns=’http://www.sitemaps.org/schemas/sitemap/0.9’> 
	<url> 
		<loc>http://www.site.com/</loc> 
		<lastmod>2008-11-04</lastmod> 
		<changefreq>monthly</changefreq> 
		<priority>0.9</priority> 
	</url> 
</urlset>

Added to by Nikos Mouratidis

Install Clip


Clearing div

.clearing {clear:both; height:0; overflow:hidden; margin:-1px 0 0 0;}

Added to by Mark Evans

Install Clip