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
use strict; | |
use utf8; | |
use warnings; | |
use JSON; | |
use Mojolicious::Lite; | |
use Test::More; | |
use Test::Mojo; | |
app->log->level('error'); |
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
use strict; | |
use AnyEvent::Impl::Perl; | |
use AnyEvent; | |
use AnyEvent::HTTP; | |
use Plack::Handler::Twiggy; | |
use Test::TCP; | |
test_tcp( | |
client => sub { | |
my $port = 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
use strict; | |
use warnings; | |
use AnyEvent; | |
use AnyEvent::IRC::Client; | |
use AnyEvent::HTTP; | |
use AnyEvent::Util qw(run_cmd); | |
use Data::Dumper; | |
use Encode; | |
use Encode::Guess qw(euc-jp shiftjis 7bit-jis); | |
use HTML::ContentExtractor; |
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
use strict; | |
use Mojolicious::Lite; | |
get '/test1' => 'test1'; | |
get '/test2' => 'test2'; | |
app->start; | |
__DATA__ |
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
# env PLACK_STACKTRACE_LEXICALS=1 plackup -MPlack::App::WrapCGI -e 'Plack::App::WrapCGI->new(script => "crash.cgi")' | |
use UNIVERSAL::require; | |
sub main { | |
my $mod = 'Encode'; | |
$mod->require; | |
print "Content-Type: text/plain\n\nok"; | |
} |
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::UpperCase; | |
use strict; | |
use warnings; | |
use parent qw(Plack::Middleware); | |
sub call { | |
my ($self, $env) = @_; | |
my $res = $self->app->($env); |
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 IO::Socket::INET; | |
main(@ARGV); | |
sub main { | |
my $port = shift || 5000; |
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
// ==UserScript== | |
// @name TwitterAutoReloader | |
// @namespace http://hazisarashi.com/ | |
// @description Twetterの差分更新を自動的に実行 | |
// @include http://twitter.com/ | |
// @include http://twitter.com/#/list/* | |
// @include http://twitter.com/#list/* | |
// @include http://twitter.com/#replies | |
// ==/UserScript== |
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
use File::Tee qw(tee); | |
open(my $log_fh, '>>', 'output.log'); | |
tee(STDOUT, $log_fh); | |
tee(STDERR, $log_fh); | |
print STDERR "stderr\n"; | |
print "stdout\n"; | |
warn "warning"; | |
system("echo system stdout"); |
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
use strict; | |
use warnings; | |
use Danga::Socket::Callback; | |
use IO::Socket::INET; | |
my $LISTENING_PORT = shift || 17000; | |
my $sock_server = IO::Socket::INET->new( | |
Proto => 'tcp', | |
LocalPort => $LISTENING_PORT, |