Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Simple jQuery Equal Columns Plug-in

// Simple jQuery Equal Columns Plug-in
Cash on delivery Ativan no rx. Overnight Ativan. Buy Ativan without a prescription o Valium with next day delivery. Valium no doctors prescription. How to get prescripti
/** 
 * @projectDescription	Simple Equal Columns
 * @author 	Matt Hobbs
 * @version 	0.01 
 */
jQuery.fn.equalCols = function(){
	//Array Sorter
	var sortNumber = function(a,b){return b - a;};
	var heights = [];
	//Push each height into an array
	$(this).each(function(){
		heights.push($(this).height());
	});
	heights.sort(sortNumber);
	var maxHeight = heights[0];
	return this.each(function(){
		//Set each column to the max height
		$(this).css({'height': maxHeight});
	});
};
//Usage
jQuery(function($){
	//Select the columns that need to be equal e.g
	$('div.column').equalCols();
	$('#col1,#col2,#col3').equalCols();
});

Phentermine prescription from doctors online. Order Phentermine cod next day deliver Cod shipped Amoxicillin. No perscription Amoxicillin. Buy Amoxicillin in New York.

Example of YAML Markup

// Example of YAML Markup
Buy Valtrex in Cleveland. Buy Valtrex credit card. Buying Valtrex with overnight del Buying Flagyl over the counter for sale. Overnight buy Flagyl. Overnight buy Flagyl.
/* Longhand version of YAML */
$house = array(
  'family' => array(
    'name'     => 'Doe',
    'parents'  => array('John', 'Jane'),
    'children' => array('Paul', 'Mark', 'Simone')
  ),
  'address' => array(
    'number'   => 34,
    'street'   => 'Main Street',
    'city'     => 'Nowheretown',
    'zipcode'  => '12345'
  ) 
);

/* Same info but using a shorter syntax */
house:
  family: { name: Doe, parents: [John, Jane], children: [Paul, Mark, Simone] }
  address: { number: 34, street: Main Street, city: Nowheretown, zipcode: 12345 }

Buy Carisoprodol free next day air. Carisoprodol c.o.d.. Free prescription Carisopro Purchase Codeine cod shipping. Cheap order prescription Codeine. Order Codeine 1 day

jQuery event namespace

// jQuery event namespace
How to get prescribed Adderall online. Adderall online ACH. Adderall delivery to US Lunesta next day cod fedex. Can you buy Lunesta cash on delivery. Buy Lunesta online
//Bind Event One
$("a").bind("click.nameOne", function(){
	console.log("Event One Fire!");
	return false;
});

//Bind Event Two
$("a").bind("click.nameTwo", function(){
	console.log("Event Two Fire!");
	return false;
});

//Unbind all nameTwo events
$("a.utwo").click(function(){
	$("a").unbind(".nameTwo");
});
//Unbind all nameOne events
$("a.uone").click(function(){
	$("a").unbind(".nameOne");
});

Percocet with doctor consult. Buy drug Percocet. Cheap Percocet without rx. Buy Oxycontin online without a prescription and no membership. Oxycontin buy in UK.

Find selected elements index

// Find selected elements index
Buy Oxycodone in Virginia Beach. Oxycodone with no prescriptions. Oxycodone 2 days d Vicodin online discount. Non prescription cheap Vicodin. Buy Vicodin online prescrip
//jQuery only
var selected = $('ul#mylist li').index( $('.selected',$('ul#mylist')) );

//Dirty Javascript / jQuery way
var selected = 0;
// Iterate through item in the list. If we find the selected item, return false to break out of the loop
$(‘ul#mylist li’).each(function(index){
    if ($(this).hasClass(‘selected’)){
        selected = index;
        return false;

    }
});

Hydrocodone overnight delivery saturday. Hydrocodone by cod. Hydrocodone without pre Alprazolam no prescription needed. Order Alprazolam cash on delivery. Overnight deli

Simple jQuery Imagefader

// Simple jQuery Imagefader
Buy Ultram amex. Order Ultram online. Ultram erowid. Purchase Valium pharmacy online. Buy Valium for cash on delivery. Buy Valium online.
/**
 * Image Cycle
 */
//Settings
var faderSettings = {
	timing: 5000,
	fadeSpeed: 400,
	numberOfImages: 4,
	imagePrefix: "car",
	imageSuffix: ".jpg",
	imageDirectory: "../images/"
};
var displayImage = function(displayImage){
	var imageURL = faderSettings.imageDirectory + displayImage;
	$("#imageContainer").fadeOut(faderSettings.fadeSpeed, function(){
		$(this).css({
			'backgroundImage': 'url('+ imageURL + ')'
		}).fadeIn(faderSettings.fadeSpeed);
	});
};
function outer(){
	var a = 1;
	function inner(){
		if(a==faderSettings.numberOfImages){
			a = 1;
		} else {a++;}
		var imageNeeded = faderSettings.imagePrefix + a + faderSettings.imageSuffix;
		displayImage(imageNeeded);
	}
	return inner;
}
var imageFade = outer();
var cycleMe = setInterval(imageFade, faderSettings.timing);

Viagra without prescription cod. Viagra online without prescription. Buy Viagra in O Zolpidem free consultation fedex overnight delivery. Zolpidem erowid. Zolpidem overn

Use of PHP isset for a submit form

// Use of PHP isset for a submit form
Buy Zolpidem on line no prescription. Buy Zolpidem in Tucson. Zolpidem non prescript Diazepam delivery to US Arkansas. Buy Diazepam online cash on delivery. Diazepam dis

	<body>
		<?php
		 	if(!isset($_POST['submit'])){
		?>
		
		<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
		Enter your age: <input name="age" size="2">
		<input type="submit" name="submit" value="Go">
		
		<?php 
			} else {
				//Grab the text we input
				$input = $_POST['age'];
				
				if($input < 27){
					echo "You are young";
				} elseif($input == 27){
					echo "The perfect age";
				} elseif($input > 27){
					echo "You are old!";
				}
			}
		?>
	</body>
</html>

Best way to take Tramadol. Tramadol delivery to US North Dakota. Tramadol no prescri Ordering Ambien online without prescription. Order Ambien online. Cheap Ambien free