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 5.14.0; | |
# Very common leak | |
my $foo; | |
$foo = sub { | |
my ($i, $j) = @_; | |
return if $i >= $j; | |
say $i++; | |
$foo->($i, $j); | |
}; |
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
set background=dark | |
hi clear | |
if exists("syntax_on") | |
syntax reset | |
endif | |
let colors_name = "kraihlight" |
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 { | |
font-family: "Consolas"; | |
font-size: 11pt; | |
background-color: #1A1A1A; | |
color: #F9F9F9; | |
padding: 0; | |
margin: 0; | |
} | |
body { |
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
$ twiggy -l :3000 twitter.psgi |
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; | |
use Coro; | |
use Mojo::IOLoop; | |
Mojo::IOLoop->recurring(0 => sub {cede}); | |
hook around_dispatch => sub { | |
my $next = shift; | |
async { $next->() }; |
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; | |
use Coro; | |
use Mojo::IOLoop; | |
Mojo::IOLoop->recurring(0 => sub {cede}); | |
hook around_dispatch => sub { | |
my $next = shift; | |
async { $next->() }; |
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
# StreamingPSGI - Everything is streaming, no special cases | |
my $env = { | |
SERVER_NAME => 'localhost', | |
SERVER_PORT => 80, | |
SCRIPT_NAME => '', | |
REQUEST_METHOD => 'GET', | |
HTTP_CONTENT_LENGTH => 12, | |
version => 3, | |
url_scheme => 'http', | |
read => 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
package Mojolicious::Command::files; | |
use Mojo::Base 'Mojo::Command'; | |
use Mojo::Home; | |
has description => "List templates and static files.\n"; | |
has usage => "usage: $0 files\n"; | |
sub run { | |
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
package MyApp::Controller::Bar; | |
use Mojolicious::Lite; | |
get '/test' => sub { | |
my $self = shift; | |
$self->render('test'); | |
}; | |
1; | |
__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
use Mojolicious::Lite; | |
use EV; | |
use IO::Async::Process; | |
use IO::Async::Loop::EV; | |
my $loop = IO::Async::Loop::EV->new; | |
get '/' => sub { | |
my $self = shift; |