This file contains 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 MyApp::Controller; | |
use strict; | |
use warnings; | |
use base 'Mojolicious::Controller'; | |
sub redirect_to_abs { | |
my $self = shift; | |
my $url = $self->url_for(@_); | |
return $self->redirect_to($url->to_abs->to_string); |
This file contains 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 MyApp::Example; | |
use strict; | |
use warnings; | |
use base 'Mojolicious::Controller'; | |
sub default { | |
my $self = shift; | |
# to text/plain |
This file contains 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 MyApp::Controller; | |
use strict; | |
use warnings; | |
use base 'Mojolicious::Controller'; | |
use Path::Class; | |
sub sendfile { | |
my $self = shift; | |
my %args = @_; |
This file contains 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 Plack::Middleware::Parallel::Scoreboard; | |
use strict; | |
use warnings; | |
use parent qw(Plack::Middleware); | |
use Plack::Util::Accessor qw(board base_dir path); | |
use Parallel::Scoreboard; | |
our $VERSION = '0.01'; | |
sub prepare_app { | |
my $self = shift; |
This file contains 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 XML::RPC; | |
use Data::Dumper; | |
my $blogid = 'xxxxxxx'; | |
my $username = 'xxxxxxx'; | |
my $password = 'xxxxxxx'; |
This file contains 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 | |
package MT::Feed; | |
use strict; | |
use warnings; | |
sub new { | |
my $class = shift; | |
bless { entries => [], delimiter => "--------\n" }, $class; | |
} |
This file contains 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/perl | |
use strict; | |
use warnings; | |
use YAML; | |
use Devel::Peek; | |
my $data = YAML::LoadFile('data.yaml'); | |
print Dump($data->{hoge}); |
This file contains 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/perl | |
# Usage: read-password.pl --user hoge -p | |
use strict; | |
use warnings; | |
use Term::ReadPassword; | |
use Data::Dumper; | |
use Getopt::Long; |
This file contains 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 Test::More tests => 3; | |
my $xxx = "a"; | |
my $str = "aaabbbaaabbb"; | |
my $hit = 6; | |
diag "str => $str, char => $xxx, hit => $hit"; |
This file contains 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 | |
# benchmark for | |
# http://gist.github.com/641766 | |
use strict; | |
use warnings; | |
use Benchmark qw(cmpthese); | |
my $xxx = "a"; |
OlderNewer