This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
print "Hello World!\n"; | |
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -CSDAL | |
# | |
# Usage: PROGNAME big_list.txt small_list.txt > output.txt | |
# -CSDAL for unicode. | |
use strict; | |
use warnings; | |
# should maybe have this | |
use locale; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
att passa någon som handen i handske;to be right up somebody's alley | |
(bildligt) rycka in och hjälpa till, (omedelbart) hjälpa till;step into the breach | |
bli sämre;be losing one's grip | |
bort med tassarna!;take your paws off! | |
brännas på bål;be burnt at the stake | |
bromsa något, hejda något;put the (a) brake on something | |
finnas i alla former och storlekar;come in all shapes and sizes | |
förbarma sig över någon;take pity on somebody | |
för Guds skull! (informellt);for crying out loud! | |
försöka lyckas i världen (särskilt litterärt);seek one's fortune |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Usage: perl nukedups.pl $currentfolder $oldfolder | |
Run once with just the print and check output for sanity. If all looks good uncomment the 'unlink' line and re-run. | |
This code builds a list of the MD5 sums of the files in the first directory, then deletes the files in the second directory if their MD5 sum matches one of the sums seen in the first directory. | |
Follow with: | |
find $oldfolder -depth -type d -exec rmdir {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $top = shift(@ARGV) || '.'; | |
chdir $top or die "could not chdir to $top: $!\n"; | |
open my $find, '-|', 'find .' or die "$!\n"; | |
my %top_must = ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compute digram frequency of <space>a-zA-Z | |
<space> is signified by 'S', A-Z are mapped onto a-z. | |
Output: Char1Char2 Count Count/Total | |
... | |
Sf 103 0.006550 | |
... | |
eo 16 0.001018 | |
... | |
15724 characters # on STDERR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int out2(unsigned short int t) { | |
unsigned char c[3]; | |
unsigned char *b; | |
unsigned char l = 0; | |
b = c; | |
// 0000 0000 0xxx xxxx -> 0xxx xxxx | |
// 0000 0yyy yyxx xxxx -> 110y yyyy 10xx xxxx | |
// zzzz yyyy yyxx xxxx -> 1110 zzzz 10yy yyyy 10xx xxxx | |
if ( ! (t & 0xFF80) ) { | |
c[l++] = t & 0x007F; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use File::Basename; | |
my $cbrfile = $ARGV[0] or die "Usage: $0 <cbrfile>\n"; | |
# get a verbose basic list of archive contents. (path/to/file.ext) | |
my $pid = open my $fh, '-|', rar => vb => $cbrfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use 5.014; | |
use warnings; | |
use Weather::Google; | |
use Data::Dump qw(pp dd); | |
use LWP::UserAgent; | |
my $gw = Weather::Google->new('Glendale, CA'); | |
my $current = $gw->current; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use 5.014; | |
use warnings; | |
use Weather::Google; | |
use Data::Dump qw(pp dd); | |
use LWP::UserAgent; | |
my $gw = Weather::Google->new('Glendale, CA'); | |
my $current = $gw->current; |
OlderNewer