Skip to content

Instantly share code, notes, and snippets.

View skaji's full-sized avatar

Shoichi Kaji skaji

  • Kanagawa, Japan
  • 13:32 (UTC +09:00)
View GitHub Profile
#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage 'pod2usage';
use Getopt::Long qw(
:config
posix_default no_ignore_case
bundling auto_help
);
GetOptions(
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use 5.010;
my $app = App->new;
$app->stash( data => [1..100] );
$app->register(sub {
@skaji
skaji / .dir_colors
Created March 20, 2013 07:25
~/.dir_colors
# Configuration file for the color ls utility
# Synchronized with coreutils 8.5 dircolors
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
# pipes. 'all' adds color characters to all output. 'none' shuts colorization
# off.
COLOR tty
@skaji
skaji / 256color.pl
Last active December 15, 2015 04:39
#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage;
=head1 SEE ALSO
http://en.wikipedia.org/wiki/ANSI_escape_code
=head1 NOTE
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Data::Dumper;
=head1 SYNOPSIS
% perl evaluate.pl 'www[01-05].example[1-2].{com,jp}'
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
my $file = shift or die 'specify file';
my $content = slurp($file);
$content =~ s/ [#][^\n]*$ //gxsm;
for my $module (qw{strict warnings utf8}, qr{[\d.]+}) {
$content =~ s/^use [ \t]+ $module \s* ; [ \t]* \n//xsm;
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
my @cont = ('@', 'A'..'Z', qw( [ \ ] ^ _ ));
for my $i (0..$#cont) {
printf "%02X ^%s ", $i, $cont[$i];
print "\n" if $i % 8 == 7;
}
@skaji
skaji / temp.pl
Last active December 16, 2015 06:19
use strict;
use warnings;
use Module::Build;
my $build = Module::Build->new(
module_name => 'Dummy::Module',
# test_requires from 0.4004 2013/03/29
# test_requires => {
# 'Test::More' => '1.98',
# },
#!/usr/bin/env perl
use strict;
use warnings;
use File::Copy qw(copy);
use File::Path qw(mkpath rmtree);
use File::Spec::Functions qw(splitpath catdir catfile);
my @fatlib_list = qw(
HTTP::Tiny
local/lib/perl5/darwin-2level/auto/Test/Simple/.packlist
@skaji
skaji / MYMETA
Created May 6, 2013 16:14
CPAN::Meta
{
"abstract" : "the distribution metadata for a CPAN dist",
"author" : [
"David Golden <dagolden@cpan.org>",
"Ricardo Signes <rjbs@cpan.org>"
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 4.300031, CPAN::Meta::Converter version 2.130880",
"license" : [
"perl_5"