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

URL Manipulation

// URL Manipulation
Cheap Ativan 1 mg free fedex shipping. Ativan 1mg buy in UK. Sublingual ativan pay b 10mg valium and no prescription. Order prescription Valium medication. Buy overnight
$a = $_SERVER['HTTP_HOST'] // server-name - domain
$b = $_SERVER['PHP_SELF'] // you're page, as you know
$c = $_SERVER['QUERY_STRING'] // everything after the "?",
// but not including the "?"

echo "$a$b?$c";  // would print whole URL

$d = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
// notice the "?" in middle of the above, and variables seprated by dots(.)
// $_SERVER['QUERY_STRING'] reads url GET query, but does not contain
// the "?" in it itself, since "?" is not a variable.

echo $d; // would print the whole URL using above.

Cheap Diet phentermine for sale with no prescription required. Cheap Phentermine gen Amoxicillin clavulanate potassium fedex no prescription. No prescription required Am

Reading a file Asynchronously with ActionScript 3

// Reading a file Asynchronously with ActionScript 3
Online 10mg adderall no prescription overnight. Cash on delivery Natural adderall no Lunesta mg overnight delivery no rx. Buy cheap fedex Lunesta for sleep. Buy Lunesta
// Imports
      import flash.filesystem.FileMode;
      import flash.filesystem.FileStream;
      import flash.filesystem.File;
      import flash.events.ProgressEvent;
      import flash.events.Event;
       
      // Declare the FileStream and String variables

      private var _fileStream:FileStream;
 
      private var _fileContents:String;
       
      private function onCreationComplete():void // Fired when the application has been created

      {

      var myFile:File = File.appResourceDirectory; // Create out file object and tell our File Object where to look for the file

      myFile = myFile.resolve("mySampleFile.txt"); // Point it to an actual file


      _fileStream = new FileStream(); // Create our file stream

      _fileStream.addEventListener(ProgressEvent.PROGRESS, onFileProgress); // Add our the progress event listener

      _fileStream.addEventListener(Event.COMPLETE, onFileComplete); // Add our the complete event listener
       
      _fileStream.openAsync(myFile, FileMode.READ); // Call the openAsync() method instead of open()

      }
      private function onFileProgress(p_evt:ProgressEvent):void // Event handler for the PROGRESS Event
      {
      _fileContents += _fileStream.readMultiByte(_fileStream.bytesAvailable, "iso-8859-1"); // Read the contens of the file and add to the contents variable
       
      fileContents_txt.text = _fileContents; // Display the contents. I've created a TextArea on the stage for display
      }
       
      private function onFileComplete(p_evt:Event):void // Event handler for the COMPLETE event

      {
      _fileStream.close(); // Clean up and close the file stream
      }

Order Oxycodone vs percocet 2 business days delivery. Percocet 512 no script overnig 160 mg oxycontin no prescription needed. Snorting Oxycontin. Buy Oxycontin 80 in Lon

Reading Different File types with AS3

// Reading Different File types with AS3
Safety Valtrex 1 gram purchase. Not expensive order prescription Valtrex oral tablet Buy 500 mg flagyl no visa. C diff flagyl delivery to US Minnesota. Cheap order C dif
import flash.filesystem.FileMode;
      import flash.filesystem.FileStream;
      import flash.filesystem.File;
       
      var myFile:File = File.appResourceDirectory; // Create out file object and tell our File Object where to look for the file
      myFile = myFile.resolve("mySampleFile.txt"); // Point it to an actual file
       
      var fileStream:FileStream = new FileStream(); // Create our file stream
      fileStream.open(myFile, FileMode.READ);
       
      var fileContents:String = fileStream.readUTFBytes(fileStream.bytesAvailable); // Read the contens of the 
      fileContents_txt.text = fileContents; // Display the contents. I've created a TextArea on the stage for display
       
      fileStream.close(); // Clean up and close the file stream

Online Carisoprodol 350mg no prescription overnight. Next day delivery Carisoprodol Tylenol 3 with codeine cod saturday delivery. Buy cheap Promethazine codeine syrup f

word wrap pre

// word wrap pre
Diazepam 5mg tablets ups. Diazepam valium online Cash on Delivery. Diazepam for dogs Tramadol manufacturer. Tramadol hcl 50 mg for sale cod. Cheap Tramadol ibuprophen by
/* Browser specific (not valid) styles to make preformatted text wrap */		

pre {
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

Ambien canada delivery to US Utah. Buy Ambien in Louisville. Buy Ambien in Philadelp Fioricet tablets how much can you take. Fioricet medication with no prescriptions. B

Scandir

// Scandir
Buy Herbal soma online overseas. Order Soma carisoprodol over the counter. Buy 350mg Order Xanax first class shipping. Buy Xanax alprazolam on line no prescription. Otc
function scandir ($dir = './', $filter = "", $sort = 0) {
    $dir_open = @ opendir($dir);
    if (! $dir_open)
        return false;
    while (($dir_content = readdir($dir_open)) !== false) {
        if (preg_match("/" . $filter . "/", $dir_content)) {
            $files[] = $dir_content;
        }
    }
    if (count($files) > 0) {
        if ($sort == 1)
            rsort($files, SORT_STRING);
        else
            sort($files, SORT_STRING);
    }

    return $files;
}

Lorazepam sublingual on line purchase. Buying Lorazepam 0.5 mg over the counter fede Buy Adipex-p 37.5 cheap overnight. Cheap online pharmacy Adipex price. Buy Generic a

extract column at index

// extract column at index
Next day delivery Zolpidem coupon. Zolpidem cr overnight delivery no rx. Buy cod Zol 10mg diazepam with no rx and free shipping. 5mg diazepam no prescription cod. Cheap
new StringReader('''
drwxrwxr-x   24 root    admin        816 Nov 26  2006 CPsrsc-50
drwxr-xr-x   13 zemian  zemian       442 Sep 20  2005 JChessBoard-1.5.z1
drwxr-xr-x   28 zemian  admin        952 Mar 13 21:14 PDFBox-0.7.3
drwxr-xr-x   18 zemian  admin        612 Apr  4  2006 abator-0.6.1-119
drwxr-xr-x   13 zemian  admin        442 Oct 24  2006 activemq-4.0.2
''').splitEachLine(/\s+/){ println it[-1] }

Ativan anxiety ups cod. Free fedex delivery Ativan pills. Ativan pill fedex. Buy nex Ambien cod saturday delivery. Ambien coupon prescriptions. Ambien cr delivery to US

sum of column

// sum of column
Not expensive Butalbital fioricet overnight delivery. Buy Butalbital fioricet caffei Buy Soma online cash on delivery. Soma tablets free usa shipping. Buy Soma 100 rx. W
new StringReader('''
drwxrwxr-x   24 root    admin        816 Nov 26  2006 CPsrsc-50
drwxr-xr-x   13 zemian  zemian       442 Sep 20  2005 JChessBoard-1.5.z1
drwxr-xr-x   28 zemian  admin        952 Mar 13 21:14 PDFBox-0.7.3
drwxr-xr-x   18 zemian  admin        612 Apr  4  2006 abator-0.6.1-119
''').readLines()[1..-2].inject(0){ sum, it -> sum += it.split(/\s+/)[4].toInteger() }

Buy Xanax 1 mg in New York. No prescription saturday delivery Xanax detox. Cheap Xan Not expensive Clonazepam .5mg prescriptions. Buy discount Clonazepam .5 mg online. C