<: my $canon = ($GOOD==4) ? '' : "index.$GOOD.html" :>
Marginal Hacks GetDave.com

"I'm glad cavepeople didn't invent television, because they would have just sat around and watched talk shows all day instead of creating tools." - Dave James

LICENSE Is it Free?

<: $STAR_FULL = "*"; $STAR_HALF = "+"; $STAR_EMPTY = " "; :> Too see more/less tools, change minimum rating (0,3,4,5 stars): <: my $DISP = $GOOD; $DISP = 4 if $GOOD==-1; :> <: print ($DISP!=0 ? "none" : "none"); :> | <: my $three = $DISP>=3 ? $STAR_FULL : $STAR_EMPTY; my $four = $DISP>=4 ? $STAR_FULL : $STAR_EMPTY; my $five = $DISP>=5 ? $STAR_FULL : $STAR_EMPTY; print "$three$three$three"; print "$four"; print "$five"; :>
-- Currently displaying <: print $DISP ? "code with $DISP or more stars" : "all code" :> --

<: $DOWNLOAD = "Download"; $HOMEPAGE = "Homepage"; $CHANGELOG = "Changelog"; $THUMBSUP = "Y"; $THUMBSDOWN = "N"; open(LIST,"list") || die("Couldn't read list\n"); # Unfortunately we have to do .5 stars as 0.5 stars my ($name,$num_stars,$half,$works,$aka) = (undef); my $good_enough = 0; while() { s/^\s*#.*//g; # Ignore comments next if (/^\s*$/); # Ignore blank lines if (/^\s*(\S(.*[^\t])?)\t+(\d)(.5)?\t+(\S+)(\t+(\S+))?\s*$/) { ($name,$num_stars,$half,$works,$aka) = ($1,$3,$4,$5,$7); $name =~ s/\s+$//; $works =~ s/Y/$THUMBSUP/; $works =~ s/N/$THUMBSDOWN/; print " \n \n \n" if $good_enough; #$good_enough = ($num_stars>=$DISP) ? 1 : 0; $good_enough = ($num_stars>=$DISP || -d "Hacks/$name") ? 1 : 0; $good_enough = 0 if $name eq "dAIve"; my $bin = "bin/$name"; $bin =~ s/\.cgi$/_cgi/; my $name_show = $name; $name =~ s/\.tar\.gz$//g; $name =~ s/\.cgi$//g; ($bin,$aka)=("bin/$aka","") if (-f "bin/$aka"); my $name_link = $name; my $home; my $clean_name = $name; $clean_name =~ s/
/_/g; $clean_name =~ s/[<>\s]/_/g; if ($aka ne "-") { $home = $aka ? $aka : -d "Hacks/$name" ? "Hacks/$name/" : undef; unless (defined $home) { $name_link = "$name_show"; } else { my $change = undef; $change = "$CHANGELOG" if (-f "Hacks/$name/CHANGELOG.html"); $change = "$CHANGELOG" if (-f "Hacks/$name/CHANGELOG"); $name_link = "$name_show"; $home = "$HOMEPAGE $DOWNLOAD $change"; } } my $stars=$STAR_FULL x $num_stars; $stars.=$STAR_HALF if ($half); $left = 5 - $num_stars; $left-- if $half; $stars.=$STAR_EMPTY x $left if $left; my $str = <
\n \n" if $good_enough; close(LIST); :>
Name Rating Works? Description

$home $name_link
$stars
$works END_OF_ENTRY print $str if ($good_enough); } else { print if $good_enough; # Part of the description } } print " \n



Author: David Ljung Madison Stellar [CONTACT]

GetDave.com DaveSource.com Daveola.com - My home.
LICENSE Free? Reporting Bugs

"I have an elegant script for this, but it was too big to fit in the margins.."

- Me, MarginalHacks


Thanks to Jamie Zawinsky and the Jargon File for the name




There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. - C.A.R. Hoare

Terms Of Use | Site Index | CONTACT | PGP Key | MarginalHacks, Marginal Hacks