X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/4f4c79b0fd9e7fb10c1059c90b581dfc4f35fdac..c26d5da0a9b989982e7897ff5712d0fc79a714b4:/cc.plp
diff --git a/cc.plp b/cc.plp
new file mode 100644
index 0000000..48b9910
--- /dev/null
+++ b/cc.plp
@@ -0,0 +1,87 @@
+<:
+use utf8;
+use strict;
+use warnings;
+use open IO => ':utf8';
+
+our $VERSION = 'v1.0';
+
+$header{content_type} = 'text/html; charset=utf-8';
+
+:>
+
+
+
+country code cheat sheet
+
+
+
+
+
+Country codes
+
+<:
+my $cc = do 'cc.inc.pl';
+
+sub quote {
+ local $_ = shift;
+ s/"/"/g;
+ s/</g;
+ s/>/>/g;
+ return $_;
+}
+
+{
+ printf '';
+ print '';
+ for my $section (qw{thead}) {
+ print "<$section>â±";
+ print ' | ', $_ for 'a' .. 'z';
+ print "\n";
+ }
+ print ' |
';
+ for my $row ('a' .. 'z') {
+ print '', $row;
+ for my $col ('a' .. 'z') {
+ my $code = $row . $col;
+ my $country = $cc->{$code} or do {
+ print $code =~ /^x|^q[m-z]|^aa|^zz/ ? ' | ' : ' | ';
+ next;
+ };
+ my $img = sprintf '', $code, $code
+ if -e "flag/$code.png";
+ printf "\n".' | %s',
+ $img ? 'X '.$country->[1] : '', quote($country->[0]), $img;
+ }
+ print "\n";
+ }
+ print " |
---|
\n";
+}
+
+:>
+
+
+
+
+ africa
+ | europe
+ | asia
+ | oceania
+ | antarctica
+ | south america
+ | north america
+ | reserved
+ | user-assigned
+ |
+
+
+
+
+