Skip to content

Instantly share code, notes, and snippets.

Kensuke Nagae kyanny

Block or report user

Report or block kyanny

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View member_of.pl
#!perl
# $Id$
use strict;
use warnings;
use File::Spec;
use FindBin;
use lib File::Spec->catdir($FindBin::Bin, "..", "lib");
use Getopt::Long;
View perl context in brace
#!/usr/local/bin/perl
use strict;
use Data::Dumper;
warn Dumper { key => 'value' };
sub ret1 { return }
sub ret2 { return undef }
sub _wantarray { wantarray ? 'list' : 'scalar' }
View gist:54408
#!/usr/local/bin/perl
use strict;
use Devel::Size qw(size);
use Perl6::Say;
use URI;
use URI::Query;
my $url = 'http://nttdocomosucks.example.com/path?too=many&query=string';
my $uri = URI->new($url);
View tt-stash-component.pl
#!/usr/local/bin/perl
use strict;
use Template;
use Data::Dumper;
sub myfilter {
my ($context, $key) = @_;
return sub {
my $text = shift;
View display committers list of svn repos
svn log http://fastladder.googlecode.com/svn/trunk/ -q | perl -anle 'next if /^-+$/; $,=q{,}; $committers{$F[2]}++; END{ print keys %committers}'
View gist:63836
#!/bin/sh
# $Id$
svn log --stop-on-copy -q | perl -anle 'next if /^\-+$/; unshift @rows, $F[0]; END { $rev = sprintf(q/%s:%s/, $rows[0], $rows[-1]); $rev =~ s/r//g; print $rev }'
View DateTime::Sset DateTime::Span example
#!/usr/bin/perl
use strict;
use warnings;
use DateTime;
use DateTime::Set;
use DateTime::Span;
use Data::Dumper;
my $d1 = DateTime->new(year => 2009, month => 2, day => 27);
my $d2 = DateTime->new(year => 2009, month => 4, day => 1);
View Japanese Era
#!/usr/bin/perl
use strict;
use warnings;
use DateTime;
use DateTime::Format::Japanese;
use Perl6::Say;
my $fmt = DateTime::Format::Japanese->new;
my $dt = DateTime->today(time_zone => 'local');
my $str = $fmt->format_ymd($dt);
View Japanese Era
#!/usr/bin/perl
use strict;
use warnings;
use DateTime;
use DateTime::Format::Japanese;
use Perl6::Say;
my $fmt = DateTime::Format::Japanese->new;
my $dt = DateTime->today(time_zone => 'local');
my $str = $fmt->format_ymd($dt);
View Japanese Era
#!/usr/bin/perl
use strict;
use warnings;
use DateTime;
use DateTime::Format::Japanese;
use Perl6::Say;
my $fmt = DateTime::Format::Japanese->new;
my $dt = DateTime->today(time_zone => 'local');
my $str = $fmt->format_ymd($dt);
You can’t perform that action at this time.