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 -MEncode -e 'print Encode::encode("utf8", "\x{264b}");' |
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 Carp (); | |
sub try (&@) { | |
my $try = shift; | |
my ($catch, @finally); | |
while (my ($kind, $coderef) = splice @_, 0, 2) { | |
if ($kind eq 'catch') { | |
$catch = $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
use common::sense; | |
use HTTP::Message::PSGI; | |
use HTTP::Request::Common; | |
use Test::More; | |
use Test::Pretty; | |
use Test::Stub; | |
my $env = (GET "http://hoge/?name=foo&name=bar")->to_psgi; | |
subtest 'Plack::Request' => sub { |
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 common::sense; | |
use AnyEvent; | |
use AnyEvent::Socket; | |
use AnyEvent::Handle; | |
use Data::Dumper; | |
my $cv = AnyEvent->condvar; | |
my %clients; | |
my %names; | |
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 common::sense; | |
use Data::Dumper; | |
use Encode (); | |
use JSON::XS qw(decode_json); | |
use Mojo::Util qw(monkey_patch); | |
use Mojolicious::Lite; | |
use Test::Deep; | |
use Test::Mojo; | |
use Test::More; | |
use Test::Pretty; |
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 common::sense; | |
pipe my $read, my $write; | |
my @pids; | |
for (1 .. 5) { | |
my $pid = fork // die "Failed: $!"; | |
if ($pid) { # Parent |
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 common::sense; | |
use LWP::UserAgent; | |
use HTTP::Request::Common; | |
use POSIX qw(:sys_wait_h); | |
use Test::More; | |
my @urls = qw( | |
http://hoge.fuga/ | |
http://fuga.hoge/ | |
http://fooo.baar/ |
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 v6; | |
use HTTP::UserAgent; | |
use HTTP::Request; | |
use Test; | |
use URI; | |
my Str @urls = "http://hoge.fuga/", | |
"http://fuga.hoge/", | |
"http://fooo.baar/"; |
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
<?php | |
# Specify `charset=utf8` or you get multi-byte chars as "?" | |
$dbh = new PDO('mysql:host=some-host-name;dbname=databse-name;charset=utf8', 'user', 'password'); |
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 common::sense; | |
use HTTP::Request::Common; | |
use LWP::UserAgent; | |
{ | |
my $req = POST 'http://localhost:8888/test.php', | |
Content_type => 'form-data', | |
Content => { | |
myname => 'hogefuga', | |
myfile1 => [ 'file.txt', 'file.txt' ], |
OlderNewer