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 Fuga; | |
use strict; | |
use warnings; | |
use Hoge; | |
sub new { | |
my ($class) = @_; | |
my $self = bless {}, $class; | |
$self->{'foo'} = 'bar'; | |
return $self; |
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 Fuga; | |
use strict; | |
use warnings; | |
use Hoge; | |
use Sub::Install; | |
Sub::Install::install_sub({ code => \&Hoge::hoge }); | |
sub new { | |
my ($class) = @_; |
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 IO::Socket::INET; | |
use Parallel::Prefork; | |
use IPC::Open3; | |
sub MaxRequestsPerChild () { 100 } | |
my $listen_sock = IO::Socket::INET->new( | |
Listen => 5, |
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; | |
sub hoge { return fuga() }; | |
sub fuga { | |
if (wantarray) { | |
print "array\n"; | |
} else { | |
print "scalar\n"; | |
} |
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 t::Util; | |
BEGIN { | |
unless ($ENV{PLACK_ENV}) { | |
$ENV{PLACK_ENV} = 'test'; | |
} | |
if ($ENV{PLACK_ENV} eq 'deployment') { | |
die "Do not run a test script on deployment environment"; | |
} | |
} | |
use File::Spec; |
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
#!/bin/sh | |
exec 2>&1 | |
export HOME=/home/riywo | |
cd /home/riywo/MyApp | |
exec setuidgid riywo ./script/start.sh |
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
#!/bin/sh | |
if [ $OSTYPE = "linux-gnu" ]; then | |
LSB_ID=`lsb_release -i | cut -f2 -d:` | |
LSB_VERSION=`lsb_release -r | cut -f2 -d:` | |
OS_VERSION=`echo $LSB_ID-$LSB_VERSION | sed -e "s/ //g"` | |
MACHINE_TYPE=`uname -m` | |
echo $OS_VERSION-$MACHINE_TYPE | |
else | |
echo `uname -rsm | sed -e "s/ /-/g"` | |
fi |
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/perl /Users/riywo/llenv/apps/perl-5.8.8/local/lib/perl5/ExtUtils/xsubpp -typemap /System/Library/Perl/5.10.0/ExtUtils/typemap -typemap typemap XS.xs > XS.xsc && mv XS.xsc XS.c | |
gcc-4.2 -c -arch x86_64 -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"2.32\" -DXS_VERSION=\"2.32\" "-I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE" XS.c | |
XS.xs: In function ‘json_init’: | |
XS.xs:109: warning: format not a string literal and no format arguments | |
XS.xs: In function ‘shrink’: | |
XS.xs:135: warning: format not a string literal and no format arguments | |
XS.xs: In function ‘decode_hv’: | |
XS.xs:1317: warning: comparison is always false due to limited range of data type | |
XS.xs: In function ‘decode_json’: | |
XS.xs:1611: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘STRLEN’ |
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 Parallel::ForkManager; | |
use IO::Pipe; | |
use JSON; | |
my @hosts = map { sprintf("host%02d", $_) } (1..10); | |
my $workers = 5; | |
my $pm = Parallel::ForkManager->new($workers); |
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
http { | |
map $uri $backend_port { | |
include port_map; | |
} | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
server { |