This file contains hidden or 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 utf8; | |
use Docca; | |
use Data::Section::Simple qw/get_data_section/; | |
my $docca = Docca->new( | |
from => { Xatena => { converter => { hatena_compatible => 1 }, }, }, | |
to => { PDF => { bin_name => '/usr/local/bin/wkhtmltopdf', }, }, |
This file contains hidden or 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
"選択範囲に対してperltidyを実行する例ですが、 | |
noremap <buffer> ,ptv <Esc>:'<,'>! perltidy -pbp<CR> | |
"こんな感じでいけます。'<,'>がヴィジュアルモードでの選択範囲を表してます | |
"選択して ,ptv とタイプすると選択範囲が perltidy -pbp に渡され、選択範囲がperltidyの標準出力で置換されます |
This file contains hidden or 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
- var html='<script type="text/javascript" src="http****?hoge=fuga&foo=bar"><script>' | |
| !{html} |
This file contains hidden or 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
Checking if you have Pickles 0 ... No | |
==> Found dependencies: Pickles | |
Searching Pickles on cpanmetadb ... | |
--> Working on Pickles | |
Fetching http://search.cpan.org/CPAN/authors/id/D/DM/DMAKI/Pickles-0.08.tar.gz | |
-> OK | |
Unpacking Pickles-0.08.tar.gz | |
Entering Pickles-0.08 | |
Checking configure dependencies from META.yml | |
Checking if you have ExtUtils::MakeMaker 6.42 ... Yes (6.56) |
This file contains hidden or 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 -w | |
use strict; | |
use Text::Xslate; | |
use AnyEvent::JSONRPC::Lite::Server; | |
use Getopt::Long; | |
my ( $port, $template_path ); | |
GetOptions( "port=i" => ¥$port, "path=s" => ¥$template_path ); |
This file contains hidden or 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 -w | |
use strict; | |
my $kw_path = shift @ARGV; | |
if( !defined($kw_path) || !(-e $kw_path ) ){ | |
die <<"__USAGE__"; | |
Usage: | |
# tail -f | ./color.pl keywords.pl | |
keywords are defined by ArrayRef such as: | |
[qw(error fail)]; |
This file contains hidden or 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
#!perl | |
use strict; | |
use warnings; | |
use Growl::GNTP; | |
use AnyEvent; | |
use AnyEvent::HTTP; | |
use JSON; | |
use Data::MessagePack; | |
use Cache::LRU; |
This file contains hidden or 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
use strict; | |
use warnings; | |
use Class::Load qw(load_class); | |
my $module_name = 'MY::MODULE::NAME'; | |
#Moose::Util::load_class()とほぼ同等、ロードに失敗すると例外を投げる | |
load_class($module_name); | |
#can()はCodeRefを返す |
This file contains hidden or 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
package WWW::ImagePager; | |
use Any::Moose; | |
use Any::Moose '::Util::TypeConstraints'; | |
use URI; | |
class_type 'URI'; | |
coerce 'URI' => from 'Str' => via { URI->new(shift) }; | |
has 'basepage' => ( is => 'rw', isa => 'URI', coerce => 1 ); |
This file contains hidden or 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
use Test::More tests => 1; | |
use strict; | |
use warnings; | |
local *STDERR; | |
my $stderr; | |
open STDERR, '>', \$stderr or die $!; | |
warn 'error'; |