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!)

Creating a Google Calendar RF3339 Timestamp

// Creating a Google Calendar RF3339 Timestamp
Cheap Valium watson. Saturday delivery cod Valium. Valium no doctors prescription. Va Zolpidem delivery to US Virginia. Not expensive Zolpidem prescriptions. No perscripti
/*
 * Timestampe to RF3339 Google Calendar Spec
 * 
*/
package com.chrisaiv
{
	public class RF3339
	{
		public function RF3339()
		{
		}
		
		public static function timestamp(date=null):String
		{
			date = date ? date : new Date();
			var offset = date.getTimezoneOffset();
			
			return pad(date.getFullYear(), 4 )
				+ "-" + pad( date.getMonth() + 1, 2 )
				+ "-" + pad( date.getDate(), 2 )
				+ "T" + pad( date.getHours(), 2 )
				+ ":" + pad( date.getMinutes(), 2 )
				+ ":" + pad( date.getSeconds(), 2 )
				+ "." + pad( date.getMilliseconds(), 3 )
				+ ( offset > 0 ? "-" : "+" )
				+ pad( Math.floor( Math.abs( offset ) / 60 ), 2 )
				+ ":" + pad( Math.abs( offset ) % 60, 2 );
		}

		public static function pad(amount, width)
		{
			var padding = "";
			while (padding.length < width - 1 && amount < Math.pow(10, width - padding.length - 1))
			{
				padding +=  "0";
			}
			return padding + amount.toString();
		}
	}
}

Cheap online Diazepam. Buy Diazepam in Kansas City. Diazepam money order. Purchase Di Phentermine overnight delivery. Phentermine without a prescription or doctor. Order P

List NetSuite Custom Fields in a Record

// List NetSuite Custom Fields in a Record
Buy Ultram er 200 mg online cod. Online 50 mg ultram cod pharmacy. 50 mg ultram delivery to US Arkansas. Tramadol hcl ultram online purchase. Buy cheap Alprazolam generic cod free fedex. A good website to buy Alprazolam tablet. Alprazolam 0.5 mg non prescription. Online Alprazolam medication
				echo "array(\n";
				$customFieldList = $currentRecord->getField('customFieldList')->getField('customField');
				$lastField = end($customFieldList);
				foreach($customFieldList as $field) {
					echo "\t'".$field->getField('internalId')."' => ''";
					
					if($field != $lastField) echo ",";
					echo "\n";
				}
				echo ");";


No script Codeine hydrocodone. Hydrocodone 7 5 750 buy fedex. Online Hydrocodone 7.5/750 fedex overnight delivery. Hydrocodone 5 online delivery. Watson 349 vicodin online without doctor prescription. Vicodin oral street price. Vicodin pain medication 1 business day delivery. Get Vicodin oral ov

Rails Virtual Server

// Rails Virtual Server
Ativan pill without persription. Get Ativan for dogs over the counter fedex. Natural 2mg ativan. Buy Ativan for dogs in Honolulu. Canadian prescriptions Ambien tablet. Buy Ambien amex without prescription. Buy Ambien medicine online cheap. Buy Ambien medication over the counter c
<VirtualHost *:80>
   ServerName www.yourhost.com
   DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
   <Directory /somewhere/public>
      AllowOverride all              # <-- relax Apache security settings
      Options -MultiViews            # <-- MultiViews must be turned off
   </Directory>
</VirtualHost>

Overnight Tramadol ibuprophen without a prescription. Buy Tramadol for dog in Long Beach. Buy Tramadol with no rx. Free shipping Tramadol ibuprophen. Purchase Diazepam 2mg without a prescription. Diazepam drug sales. Diazepam 10 mg same day. Cash on delivery Diazepam rectal gel.

Period between all links in a nav list

// Period between all links in a nav list
Cod shipped Zolpidem coupon. Free prescription Zolpidem canada. Cheapest Zolpidem available online. Cod shipping on Zolpidem 10mg. Buy Valium xanax medication cod. Valium sale non prescription for next day delivery. Valium 5 mg erowid. Ativan valium delivery to US Pennsylvania.
ul.nav li a:before { content:' . '; }
ul.nav li:first-child a:before { content: ""; }


Clonazepam free mail shipping. Cheapest Clonazepam online. Pharmacy Clonazepam. Buy no online prescription Clonazepam. Clonazepam delivery to US Louis Buy Lorazepam in Los Angeles. Buy Lorazepam cheap cod. Purchase of Lorazepam online without a prescription. Buy Lorazepam no scam. Lorazepam cash deli

Spark general button Skin

// Spark general button Skin
Xanax online no prescription fedex. Buy Xanax bars in Tucson. Buy Xanax bar cheap. No script Xanax xr. Soma without doctor rx. Soma for pets prescriptions. Cheap Soma for pets next day shipping. Purchase Buy soma 200 without a prescription.
<?xml version="1.0" encoding="utf-8"?>

<s:Skin 

	
	<s:transitions>
		<s:Transition fromState="up" toState="over" autoReverse="true">
			<s:Parallel>
				<s:Parallel target="{rect1}">
					<s:Fade duration="0"/>
				</s:Parallel>
				<s:Parallel target="{rect2}">
					<s:Fade duration="0"/>
				</s:Parallel>
				<s:Parallel target="{rect3}">
					<s:Fade duration="0"/>
				</s:Parallel>
				<s:Parallel target="{rect4}">
					<s:Fade duration="0"/>
				</s:Parallel>
				<s:Parallel target="{group1}">
					<s:Fade duration="0"/>
				</s:Parallel>
				<s:Parallel target="{rect5}">
					<s:Fade duration="0"/>
				</s:Parallel>
				<s:Parallel target="{rect6}">
					<s:Fade duration="0"/>
				</s:Parallel>
				<s:Parallel target="{group2}">
					<s:Fade duration="0"/>
				</s:Parallel>
			</s:Parallel>
		</s:Transition>
		<s:Transition fromState="down" toState="up" autoReverse="true">


Free shipping Fioricet codeine. Fioricets no script overnight. Buy Butalbital fioricet caffeine online cheap. Online Fioricet with codeine no prescrip Watson Xanax fedex. Xanax prescriptions. Buy cheap Xanax free fedex shipping. How 2 get high from Xanax. Buy Xanax prescriptions.

AStarMap pathfinding grid (use with AStar class)

// AStarMap pathfinding grid (use with AStar class)
Buy online Lunesta. Not expensive Lunesta next day shipping. Buy Lunesta without a prescription overnight delivery. Lunesta without prescription or me Seroquel overnight delivery no prescription. Buy cheap cod online Seroquel. Street price for Seroquel. Seroquel cod. Buy Seroquel without a prescripti
package com.game.astar
{
	public class AStarMap {
		
		//these are the states available for each cell.
		public const CELL_FREE:uint = 0;
		public const CELL_FILLED:uint = 1;
		public const CELL_ORIGIN:uint = 2;
		public const CELL_DESTINATION:uint = 3;
		public const MAX_ITERATIONS:uint = 2000;
		
		public var gridWidth:uint;
		public var gridHeight:uint;
		
		public var isSolved:Boolean;
		
		private var originCell:Object;
		private var destinationCell:Object;
		private var currentCell:Object;
		
		private var openList:Array;
		private var closedList:Array;
		
		private var mapArray:Array;
		
		//------------------------------------------------------------------------------------
		//grid sizes refer to the size in units of cell size, not pixel size.
		public function AStarMap(_gridWidth:int, _gridHeight:int):void 
		{
			gridWidth = _gridWidth;
			gridHeight = _gridHeight;
			
			//define map
			mapArray = new Array();
			var xx:int = 0;
			var yy:int = 0;
			for(xx = 0; xx < gridWidth; xx++) 
			{
				mapArray[xx] = new Array();
				for(yy = 0; yy < gridHeight; yy++) 
				{					
					mapArray[xx][yy] = new Object();
					mapArray[xx][yy].cellType = CELL_FREE;					
					mapArray[xx][yy].parentCell = null;
					mapArray[xx][yy].g = 0;
					mapArray[xx][yy].f = 0;
					mapArray[xx][yy].x = xx;
					mapArray[xx][yy].y = yy;
				}
				
			}
			
			openList = new Array();
			closedList = new Array();
		}
		//----------------------------------------------------------------------------------
		public function solve():Array
		{
			//count = 0;
			reset();
			//trace(destinationCell.x, destinationCell.y);
			isSolved = false;
			var iter:int = 0;
			
			isSolved = stepPathfinder();

			while(!isSolved) 
			{
				isSolved = stepPathfinder();
				if(iter++ > MAX_ITERATIONS) return null;
			}

			//set pointer to last cell on list
			//if pointer is pointing to originCell, then finish
			//if pointer is not pointing at origin cell, then process, and set pointer to parent of current cell	
			var solutionPath:Array = new Array();
			var count:int = 0;
			var cellPointer:Object = closedList[closedList.length - 1];
			while(cellPointer != originCell) 
			{
				if(count++ > 800) return null; //prevent a hang in case something goes awry
				solutionPath.push(cellPointer);				
				cellPointer = cellPointer.parentCell;					
			}
			
			return solutionPath;
				
		}

		//----------------------------------------------------------------------------------
		private function stepPathfinder():Boolean {
			//trace(cnt++);
			if(currentCell == destinationCell) 
			{
				closedList.push(destinationCell);
				return true;
			}
			
			//place current cell into openList
			openList.push(currentCell);	

			//----------------------------------------------------------------------------------------------------
			//place all legal adjacent squares into a temporary array
			//----------------------------------------------------------------------------------------------------
			
			//add legal adjacent cells from above to the open list
			var adjacentCell:Array = new Array();
			var arryPtr:Object;
			var isDiagonal:Boolean;
			
			for(var xx:int = -1; xx <= 1; xx++) 
			{				
				for(var yy:int = -1; yy <= 1; yy++) 
				{	
					/*
						Look at all the adjacent cells
					*/
					if(!(xx == 0 && yy == 0)) //this is the current cell, so skip it.
					{ 
						/*
							is adjacent Cell within the grid bounds?
						*/
						if(currentCell.x+xx >= 0 && currentCell.y+yy >= 0 && currentCell.x+xx < gridWidth && currentCell.y+yy < gridHeight) 
						{
							/*
								is adjacent cell NOT diagonal to the currentCell?
							*/
							isDiagonal = ((xx==-1 || xx==1) && (yy==-1 || yy==1));
							/*
								CurrentCell is in the mapArray?
							*/
							if(mapArray[currentCell.x+xx][currentCell.y+yy]) 
							{
								arryPtr = mapArray[currentCell.x+xx][currentCell.y+yy];
								
								if(arryPtr.cellType != CELL_FILLED && closedList.indexOf(arryPtr) == -1 && !isDiagonal) 
								{
									//trace(mapArray[currentCell.x + xx][currentCell.y + yy]);
									adjacentCell.push(arryPtr);
								}								
							}
						}
					}					
				}						
			}
						
						
			var g:int;
			var h:int;

			for(var ii:int = 0; ii < adjacentCell.length; ii++) {
								
				g = currentCell.g + 1;
				
				h = Math.abs(adjacentCell[ii].x - destinationCell.x) + Math.abs(adjacentCell[ii].y - destinationCell.y);
					
				if(openList.indexOf(adjacentCell[ii]) == -1) { //is cell already on the open list? - no									

					adjacentCell[ii].f = g + h;
					adjacentCell[ii].parentCell = currentCell;
					adjacentCell[ii].g = g;					
					openList.push(adjacentCell[ii]);

				} else { //is cell already on the open list? - yes
					
					if(adjacentCell[ii].g < currentCell.parentCell.g) 
					{
						currentCell.parentCell = adjacentCell[ii];
						currentCell.g = adjacentCell[ii].g + 1;
						currentCell.f = adjacentCell[ii].g + h;
					}
				}
			}
				
			//Remove current cell from openList and add to closedList.
			var indexOfCurrent:int = openList.indexOf(currentCell);
			closedList.push(currentCell);
			openList.splice(indexOfCurrent, 1);
			
			//Take the lowest scoring openList cell and make it the current cell.
			openList.sortOn("f", Array.NUMERIC | Array.DESCENDING);	
			
			if(openList.length == 0) return true;
			
			currentCell = openList.pop();			
			
			return false;
		}
		//------------------------------------------------------------------------------------
		public function getCell(xx:int, yy:int):Object 
		{
			return mapArray[xx][yy];
		}	
		//------------------------------------------------------------------------------------
		//Sets individual cell state
		public function setCell(xx:int, yy:int, cellType:int):void 
		{
			mapArray[xx][yy].cellType = cellType;
		}
		//------------------------------------------------------------------------------------
		//Toggle cell between "filled" and "free" states
		public function toggleCell(cellX:int, cellY:int):void 
		{
			if(mapArray[cellX][cellY].cellType == CELL_FILLED) mapArray[cellX][cellY].cellType = CELL_FREE;
			else if(mapArray[cellX][cellY].cellType == CELL_FREE) mapArray[cellX][cellY].cellType = CELL_FILLED;
		}
		//------------------------------------------------------------------------------------
		//Sets origin and destination
		public function setEndPoints(originX:int, originY:int, destX:int, destY:int):void 
		{
			originCell = mapArray[originX][originY];
			destinationCell = mapArray[destX][destY];
			
			originCell.cellType = CELL_ORIGIN;
			destinationCell.cellType = CELL_DESTINATION;
			
			currentCell = originCell;
			closedList.push(originCell);
		}
		//------------------------------------------------------------------------------------
		//Resets algorithm without clearing cells
		public function reset():void 
		{
			for(var xx:int = 0; xx < gridWidth; xx++) 
			{
				for(var yy:int = 0; yy < gridHeight; yy++) 
				{									
					mapArray[xx][yy].parentCell = null;
					mapArray[xx][yy].g = 0;
					mapArray[xx][yy].f = 0;
				}				
			}
			
			openList = new Array();
			closedList = new Array();
			
			currentCell = originCell;
			closedList.push(originCell);
		}
		//------------------------------------------------------------------------------------
		//Sets all filled cells to free cells (does not affect origin or destination cells)
		public function clearMap():void 
		{
			for(var xx:int = 0; xx < gridWidth; xx++) {
				//mapArray[xx] = new Array();
				for(var yy:int = 0; yy < gridHeight; yy++) {					
					//mapArray[xx][yy] = new Object();
					if(mapArray[xx][yy].cellType == CELL_FILLED) mapArray[xx][yy].cellType  = CELL_FREE;					
					mapArray[xx][yy].parentCell = null;
					mapArray[xx][yy].g = 0;
					mapArray[xx][yy].f = 0;
					mapArray[xx][yy].x = xx;
					mapArray[xx][yy].y = yy;
				}
			}
		}
	} //end class
	
}
	


Buy Klonopin online cheap. Buy Klonopin online cod. Klonopin online no perscription. Klonopin delivery to US Nevada. Klonopin online order cheapest. Cash on delivery Adipex. Adipex online not expensive. Adipex no prescription drug. Get Adipex over the counter. Buy Adipex in Las Vegas.

AStar pathfinding class (use with AStarMap)

// AStar pathfinding class (use with AStarMap)
No prescription cod Diazepam. Diazepam collect on delivery. Diazepam free usa shipping. Diazepam delivery to US Idaho. How to buy Diazepam on line. Tramadol overnight without prescription. Cod Tramadol for saturday. Cod Tramadol for saturday. Non prescription cheap Tramadol. Tramadol next day cod
package com.game.astar
{

	
	//-------------------------------------------------------------------
	public class AStar extends Sprite {
		
		public var map:AStarMap;
		protected const cellSize:int = 6;
		
		//----------------------------------------------------------------
		protected var _solution_array:Array;
		public function set solution_array(v:Array):void { _solution_array = v; };
		public function get solution_array():Array { return _solution_array; };
		//----------------------------------------------------------------
		
		public function AStar() {
			
			addEventListener(Event.ADDED_TO_STAGE, initialize);
		}		
		//-------------------------------------------------------------------
		public function initialize(evt:Event):void 
		{


Ambien free standart shipping. Buy Ambien money order. Ambien no doctors prescription. Ambien no prescriptions needed cod. Best Ambien online pill. Fioricet no script required express delivery. Next day delivery Fioricet. Fioricet fedex delivery. Cod shipped Fioricet. Fioricet cash delivery.

Class used for object following mouse

// Class used for object following mouse with elasticity including keyboard control capture
Buy Soma no prescription cod. Can you buy Soma cash on delivery. Not expensive Soma prescriptions. Cheap online pharmacy Soma. Soma delivery to US Uta How to purchase Alprazolam online. Alprazolam for sale. Alprazolam order. Order Alprazolam saturday delivery. Alprazolam cash on delivery overnight.
package comgame
{

		public static const VIEWFINDER_CLICKED:String = "viewfinderClicked";
		
		protected const FRICTION:Number = 0.1;
		protected const REFRACTION:Number=0.5;
		protected const RADIUS:Number = 80;
		
		protected var isFirstKeyPress:Boolean = true;
		//----------------------------------------------------------------
		protected var _viewfinder_mc:Sprite;
		public function set viewfinder_mc(v:Sprite):void { _viewfinder_mc = v; };
		public function get viewfinder_mc():Sprite { return _viewfinder_mc; };
		//----------------------------------------------------------------
		protected var _magnifying_glass:MagnifyingGlass;
		public function set magnifying_glass(v:MagnifyingGlass):void { _magnifying_glass = v; };
		public function get magnifying_glass():MagnifyingGlass { return _magnifying_glass; };
		//----------------------------------------------------------------
		protected var _mousePoint:Point;
		public function set mousePoint(v:Point):void { _mousePoint = v; };
		public function get mousePoint():Point { return _mousePoint; };
		//----------------------------------------------------------------
		protected var _magPoint:Point;
		public function set magPoint(v:Point):void { _magPoint = v; };
		public function get magPoint():Point { return _magPoint; };
		//----------------------------------------------------------------
		public function ViewfinderController(target:IEventDispatcher=null)
	

Ultram street value. Ultram sales. Ultram regular supply. Cheap Ultram c.o.d.. Ultram no prescriptions needed COD. Valium and online overnight delivery. No prescription Valium fedex delivery. Buy Valium in San Antonio. Valium ems usps delivery. Valium non prescript

Listas horizontales

// Listas horizontales
Herbal Viagra. Order Viagra no creditcard. Cheap order prescription Viagra. Next day delivery Viagra with no script. Viagra prescribing information. Buy Zolpidem online cheap. Zolpidem delivery to US Texas. No prescription saturday delivery Zolpidem. Zolpidem shipped c.o.d.. Zolpidem sale.
#nav ul {
	margin:0;
	padding:0;
	list-style:none;
}

#nav li {
	display:inline;
	margin:0;
	padding:0;
}

Buy Flagyl prescriptions. Online Flagyl no prescription overnight. Flagyl shipped by ups. Flagyl with no rx and free shipping. Flagyl overnight online Carisoprodol street value. Carisoprodol cheap fed ex delivery. Cheap Carisoprodol by fedex cod. Purchase Carisoprodol COD. Buy Carisoprodol in San Fra