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; | |
use strict; | |
use warnings; | |
use utf8; | |
use Net::EmptyPort qw(empty_port); | |
use Mojo::Server::Daemon; | |
sub run_server { | |
my ($app) = @_; | |
my $port = empty_port(); |
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 MyApp::DB; | |
use parent 'Teng'; | |
use DateTime; | |
# プラグイン有効 | |
__PACKAGE__->load_plugin('Pager'); | |
__PACKAGE__->load_plugin('Count'); | |
# hookの設定 | |
use Class::Method::Modifiers; |
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
<html> | |
<head><title>テスト</title></head> | |
<body> | |
<div> | |
[% content.raw %] | |
</div> | |
</body> | |
</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
package Mojolicious::Plugin::Example; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
sub register { | |
my ($self, $app, $conf) = @_; | |
} | |
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 strict; | |
use warnings; | |
use Test::More; | |
use Test::TCP; | |
use Net::Server::Mail::SMTP; | |
use Net::SMTP; | |
use Email::MIME; | |
use Email::MIME::MobileJP::Parser; |
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
$ sudo yum install java-1.6.0-openjdk | |
$ sudo yum install java-1.6.0-openjdk-devel |
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
$ cpanm Mojolicious::Plugin::FillInFormLite |
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 Plack::Builder; | |
builder { | |
enable 'LogFilter', filter => sub { | |
my ($env, $output) = @_; | |
# ignore static file log | |
if ($output =~ /\/static\/(js|css|images)/) { | |
return 0; | |
} |
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 | |
if (($sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) { | |
die("socket_create() failed: ".socket_strerror(socket_last_error())); | |
} | |
if (socket_connect($sock, '127.0.0.1', 5000) === false) { | |
die("socket_connect() failed: ".socket_strerror(socket_last_error())); | |
} |
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
class Object | |
{ | |
static private $_methods = array(); | |
static public function addMethod($name, Closure $cb) | |
{ | |
self::$_methods[$name] = $cb; | |
} | |
public function __call($name, array $args) |