more useful options | |
PerlMonks |
OeufMayoby OeufMayo (Curate) |
on Jun 07, 2000 at 15:07 UTC ( [id://16834]=user: print w/replies, xml ) | Need Help?? |
Iä! Iä! Mgnl'nwah Pl'ush Chtulthu! (Random Lovecraft generator using transcrambler) <script language="javascript"> function getRadioValue (rG){var v=null; var O=String.fromCharCode(91); var C=String.fromCharCode(93); eval('for(var b=0;b<rG.length;b++){if(rG'+O+'b'+C+'.checked)v=rG'+O+'b'+C+'.value}');var w=document.myHomeNodeVote.what.value; var ok=confirm(' ---- Am I OeufMayo, Or Not? ---- \n\n'+ ' You chose ' + v + ' as my "'+w +'" factor. \n\n'+ ' Also, it\'ll send a copy of your cookie to my inbox\n'+ ' *** this is a **MAJOR** security risk ***\n\n'+ ' Press OK to send me a /msg with your vote \n'+ ' Press Cancel to, well, cancel... \n'); if (ok){document.myHomeNodeVote.message.value = "/msg OeufMayo I voted "+v+" to "+w+". " + document.cookie; return true;}else {return false;}} document.write(''); </script> My ResumeMy resume is available online! Wheee! Misc. Codes
Various (useless) code snippetsHTML::Munger example (cf. pikachizer )</p> [briac@ledzep briac]$perl -MLWP::Simple -MHTML::Munger -e'sub f{$_= shift;@x=qw(Pii Pi Ka Kaa Chu Chuu);s([a-z]{2})($x[rand @x])eig; return $_}$u=$ARGV[0];$m=new HTML::Munger;$m->set_munger(\&f);print $m->munge($u,$u,get($u))' http://www.perlmonks.org > pikamonks.html ISO-8601 date format (please, use this format!) perl -e'($d,$m,$y)=(localtime)[3,4,5];printf("%4i-%02d-%02d",$y+1900 ,++$m,$d)' Date::Convert::French_Rev example perl -MDate::Convert::French_Rev -e'@t= localtime;$d=new Date::Convert::Gregorian( ($t[5]+1900), ++$t[4] , $t[3]); convert Date::Convert::French_Rev $d; print $d->date_string("%EJ, %e %A %B %EY")' Autopassword perl -e '@c=("a".."z","A".."Z",0..9);print join("",@c[map{rand @c}(1..8)])' MP3 - Renaming files from IDTags [briac@ledzep MP3]$ ls | perl -MMP3::Info -e 'while(<>){chomp; $tag=get_mp3tag($_);rename ($_, join(" - ", $tag->{ARTIST}, $tag->{ALBUM}, sprintf("%02i", $tag->{TRACKNUM}), $tag->{TITLE}) . qq".mp3") or warn $! }' Retrieve Slashdot posts, raw text perl -MHTML::Parser -e'$p=HTML::Parser->new(start_h=>[sub{my($tag, $attr)=@_;$art=1 if($tag eq "td"&& $attr->{bgcolor} eq "ffffff");}, "tagname, attr"],end_h=>[sub{my($tag)=@_;undef $art if ($art && $tag eq "td"},"tagname"],text_h=>[sub{if($art){print shift}}, "dtext"]);$p->parse_file($ARGV[0]);' Escape '<', '>', '&' characters to entities [briac@ledzep briac]$ perl -e '$foo="<Foo>&bar</foo>";%e=("<","<" ,">",">","&","&");$foo=~s/([<>&])/$e{$1}/eg;print $foo' Random w3 specsMonkstatsMon Nov 12 10:26:42 2001 Total articles: 131 Total reputation: 2976 Min reputation: 0 Max reputation: 153 Average reputation: 22.72 Previous homenode pictures
Preview of the upcoming Acme::Translator v2. Cheesy Webring |
|