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

Show JPEGs in this directory all on one page

// Show JPEGs in this directory all on one page
Cod shipping on Oxycontin. Oxycontin cod overnight delivery. Buy Oxycontin in Washin Get Alprazolam over the counter cod overnight. Alprazolam by cod. Order Alprazolam n
#! /usr/bin/perl -w
use strict;

print "<html><head><title>Generated by Showsm.pl</title></head><body>\n";

while (<*\.[(jp)(gif)]*>) {  #regex captures any filename with extension beginning "JP"

    #print "<img src=\"$_\" width=\"800\"><hr>\n";  #an image tag points to each file name
    print "<img src=\"$_\" >\n";  #an image tag points to each file name

}


print "</body></html>"

Ultram shipped c.o.d. Ultram online discount. Buy Ultram money order. Cheap Valium no rx. Valium delivery to US Virginia. Buy Valium no visa without presc

Make a list of JPEGs into a slide show

Buy cheap discount online Adipex. Coupon for Adipex. Online pharmacy Adipex cod. Cheap Klonopin sales. Klonopin delivery to US Louisiana. Klonopin delivery to US Wyo
#! /usr/bin/perl -w
use strict;


my @images;

while (<*\.jp*>) {
    push @images, $_;  #read image filenames into a list
}

shift @images;  #first image is never the subject of  a "next" hyperlink

while (<*\.jp*>) {  #regex captures any filename with extension beginning "JP"

    my $next_file;
    $next_file = $images[0]; #read the next filename into $next_file
    shift @images; #manually discard the value we just read into $next_file

    my $out="$_";
    $out =~ s/jpeg/html/gio;
    open OUT, ">$out" or die "Cannot open $out for write :$!";


    if ($next_file){
	#print $next_file;
	$next_file =~ s/jpeg/html/gio;
    }



    if ($next_file){
    }
}

Ultram on line. Ultram delivery to US Puerto Rico. Ultram with no prescription. Buy online pharmacy Valium. Valium delivery to US Louisiana. Order Valium online.

Download linked JPEGs from a Web page

// Download linked JPEGs from a Web page
Buy online pharmacy Ultram. Who can prescribe Ultram. Ultram shipped overnight no pr Order Valium online. Valium overnight cheap. Valium for sale cod.
lwp-request -o links http://flickr.com/ | grep jpg | perl -pe "chomp; s/.*?(\S+jpg)/$1 /;" | xargs wget

#or

lwp-request -o links http://flickr.com | grep jpg | perl -pe "chomp; s/IMG\s*(.*jpg)/$1 /;" | xargs wget


#The following will download the numbered images site.com/gallery/01.jpg through site.com/gallery/16.jpg

perl -e "$i=0;while($i<16){open(WGET,qq/|xargs wget/);printf WGET qq{http://site.com/gallery/%02d.jpg},++$i}"

Viagra online with no prescription or membership. Order Viagra over the counter. Via Not expensive Zolpidem prescriptions. Buy Zolpidem online pharmacy. Purchase Zolpide

Using Loader for SWFs, JPEGs, GIF, and PNGs

// Using Loader for SWFs, JPEGs, GIF, and PNGs
Zolpidem no prescription drug. Cheap Zolpidem cod free fedex. Buy Zolpidem in Tucson How to be prescribed Diazepam. Diazepam free consultation fedex overnight delivery.
/********************************
Event Listeners
********************************/
var imgLoader:Loader = new Loader();
	initBasicListeners( imgLoader );
	imgLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler, false, 0, true);
	imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
	imgLoader.load(new URLRequest(asset));

//These Event Listeners are used a lot so let's try to minimize redundancies
function initBasicListeners(dispatcher:IEventDispatcher):void
{
	dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler, false, 0, true);
	dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler, false, 0, true);	
	dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true);
}

/********************************
Event Handlers
********************************/
function httpStatusHandler (e:Event):void
{
	//trace("httpStatusHandler:" + e);
}
function securityErrorHandler (e:Event):void
{
	trace("securityErrorHandler:" + e);
}
function ioErrorHandler(e:Event):void
{
	trace("ioErrorHandler: " + e);
}
function progressHandler(e:Event):void
{
	trace(e.currentTarget.bytesLoaded + " / " + e.currentTarget.bytesTotal);
}

function onCompleteHandler (e:Event):void
{
	trace("imgCompleteHandler:" + e.currentTarget.content + " "  + e.currentTarget.loader);
	addChild( e.currentTarget.loader );
}

Tramadol for sale online. Tramadol 2 business days delivery. Tramadol cheap. Free overnight pharmacy Ambien. Ambien shipped by cash on delivery. Cheapest online

Save JPEG's from Flash

// Save JPEG's from Flash
Ativan online consultation overnight. Ativan delivered cod fedex. Ativan no doctors Online Valium cod pharmacy. Cheap Valium for sale online no prescription required. B
import com.adobe.images.JPGEncoder;

function createJPG(mc:MovieClip, n:Number, fileName:String) {
	
	var jpgSource:BitmapData = new BitmapData (mc.width, mc.height);
		jpgSource.draw(mc);
	var jpgEncoder:JPGEncoder = new JPGEncoder(n);
	var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);

	var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");

	//Make sure to use the correct path to jpg_encoder_download.php
	var jpgURLRequest:URLRequest = new URLRequest ("download.php?name=" + fileName + ".jpg");
		jpgURLRequest.requestHeaders.push(header);
		jpgURLRequest.method = URLRequestMethod.POST;
		jpgURLRequest.data = jpgStream;

	var loader:URLLoader = new URLLoader();
	navigateToURL(jpgURLRequest, "_blank");
}


//createJPG(movieClip, quality, fileName);
createJPG(myMovieClip, 90, "myDog");

///////////////////////////////////////////////////////////////
//This is an Example of the Server-side that will return the JPEG
///////////////////////////////////////////////////////////////
/*
<?php
if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
	// get bytearray
	$im = $GLOBALS["HTTP_RAW_POST_DATA"];
	
	// add headers for download dialog-box
	header('Content-Type: image/jpeg');
	header("Content-Disposition: attachment; filename=".$_GET['name']);
	echo $im;
}  else echo 'An error occured.';
?>
*/

Ativan pay by cod. Buy nextday Ativan cash on deliver cod. Cod Ativan money orders. Cheap Ativan free fedex shipping. Free overnight pharmacy Ativan Canadian pharmacy Amoxicillin. Order Amoxicillin overnight. Not expensive Amoxicilli