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
| # error | |
| proxy_intercept_errors on; | |
| proxy_ignore_client_abort on; | |
| recursive_error_pages on; | |
| error_page 400 403 404 /404.html; | |
| error_page 500 502 503 504 512 =200 /500.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
| # check routes: script/app routes | |
| my $r = $self->routes; | |
| $r->route("/$_")->to("user-auth#$_") for qw(login signup forgot); | |
| # check user | |
| for($r->bridge->to('user-auth#check')) { | |
| $_->route('/')->to('about#index'); | |
| $_->route('/movies')->to('movie#main'); |
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/env perl | |
| use Mojolicious::Lite; | |
| get '/' => sub { | |
| my $self = shift; | |
| $self->main::mail( | |
| to => 'To', | |
| from => 'From', |
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/env perl | |
| use Mojolicious::Lite; | |
| get '/' => 'index_with_block'; | |
| shagadelic; | |
| __DATA__ |
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/env perl | |
| use Mojolicious::Lite; | |
| get '/' => 'index'; | |
| get '/ok' => 'index_ok'; | |
| use Test::More; | |
| plan tests => 6; |
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 MooseX::Declare; | |
| our $VERSION = '0.02'; | |
| # XXX: fuck, please, refactoring me :) | |
| class Geo::Message { | |
| has 'data' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); | |
| method parse(Str $data) { |
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
| # find all env | |
| find ~/mojo/lib/ -type f -print0 | xargs -0 grep -on -E --colour 'MOJO_[A-Z_]+' | |
| # find uniq env | |
| find ~/mojo/lib/ -type f -print0 | xargs -0 grep -oh -E --colour 'MOJO_[A-Z_]+' | sort -u | |
| __END__ | |
| Total: 23 | |
| MOJO_APP |
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 App::Controller; | |
| use strict; | |
| use base 'Mojolicious::Controller'; | |
| # alias | |
| sub redirect { | |
| my $self = shift; | |
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 | |
| use strict; | |
| my @SOURCE = (2000, 1500); | |
| my @FORMAT = (1920, 1080); | |
| my $K = '16x9'; | |
| my @check = check_video($SOURCE[0], $SOURCE[1], $FORMAT[0], $FORMAT[1], $K); | |
| my $x = $check[1] / 2; |
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/env perl | |
| use lib '../mojo/lib'; | |
| BEGIN { $ENV{MOJO_TMPDIR} = 'tmp/upload' }; | |
| use Mojolicious::Lite; | |
| use Data::Dumper; | |
| get '/' => 'form'; | |
| post '/' => sub { |