Skip to content

Instantly share code, notes, and snippets.

package FizzBuzz;
use warnings;
use strict;
use Carp;
use version; our $VERSION = qv('0.0.1');
# Module implementation here
sub new { bless {} };
sub say {
use Test::More ;
use FizzBuzz;
my $c = FizzBuzz->new;
is($c->say(1),1,"与えられた数字が1の時、1を返すこと");
is($c->say(2),2,"与えられた数字が2の時、2を返すこと");
# Fizz
is($c->say(3),"Fizz","与えられた数字が3の時、Fizzを返すこと");
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Data::UUID;
use DBI;
use Time::Piece;
use Mojolicious::Lite;
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Data::UUID;
use DBI;
use Time::Piece;
use Mojolicious::Lite; # 'app', 'post', 'get', 'shagadelic' is exported
if exists("g:loaded_nerdtree_quickrun_keymap")
finish
endif
let g:loaded_nerdtree_quickrun_keymap = 1
if !exists('g:loaded_quickrun')
finish
endif
call NERDTreeAddKeyMap({
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Data::UUID;
use DBI;
use Time::Piece;
use Mojolicious::Lite; # 'app', 'post', 'get', 'shagadelic' is exported
#!/usr/bin/env perl
use strict;
use WWW::Mechanize;
use Data::Dumper;
#use HTML::ContentExtractor;
use HTML::Parser;
use Lingua::EN::Tagger;
use 5.10.0;
@toritori0318
toritori0318 / perl oneliner
Created December 3, 2010 04:05
lib 以下の 全モジュールに対して use_ok を作るワンライナー
find lib -name '*.pm' | perl -ne 'chomp;$f=$_;$f=~s|lib/||g;$f=~s|/|::|g;$f=~s|.pm$||g;print "use_ok (\"".$f."\");\n";'
@toritori0318
toritori0318 / ae_tepco.pl
Created April 2, 2011 15:12
電力情報をIRCに流す
use strict;
use warnings;
use Furl;
use JSON;
use Encode qw /encode decode_utf8/;
use AnyEvent::Cron;
use AnyEvent::IRC::Client;
use Data::Dumper;
use DateTime::Format::Strptime;
use 5.10.0;
@toritori0318
toritori0318 / redcloth3.rbの一部
Created April 29, 2011 19:02
これをperlに置き換えるのを考え中…
ALLOWED_TAGS = %w(redpre pre code notextile)
def escape_html_tags(text)
text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "&lt;#{$1}#{'&gt;' unless $3.blank?}" }
end