This file contains 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 -wl | |
# code for answer on question | |
use Mojo::IOLoop; | |
sub inc { | |
my ($num, $cb) = @_; | |
return Mojo::IOLoop->next_tick(sub {$cb->('error')}) unless $num =~ /^\d+$/; |
This file contains 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
my $t = Test::Mojo->new; | |
sub f2 { | |
my $cb = shift; | |
my $d = Mojo::IOLoop->delay( | |
sub { | |
warn 'f2_1', $/; | |
shift->pass; | |
}, | |
sub { |
This file contains 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
my $ua = Mojo::UserAgent->new(); | |
my $result; | |
$self->render_later; | |
$ua->head( $location => sub { | |
my ($ua, $tx) = @_; | |
if ( $tx->res->code eq '200' ) { | |
$result = 'good'; | |
} |
This file contains 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 | |
# Run with command perl 1.pl get / | |
package AAA; | |
use Scalar::Util 'weaken'; | |
sub new { | |
my ($class, $app) = @_; |
This file contains 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; | |
use warnings; | |
use v5.10; | |
use Mojolicious::Lite; | |
use Mojo::IOLoop; |
This file contains 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; | |
use warnings; | |
use v5.10; | |
use Mojolicious::Lite; | |
get '/login' => sub { shift->render } => 'login'; |
This file contains 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 | |
package A1; | |
use Data::Dumper; | |
our $AUTOLOAD; | |
sub new { my $class = shift; bless {@_}, ref $class || $class }; | |
sub AUTOLOAD { |
This file contains 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; | |
use warnings; | |
use v5.10; | |
use Mojo::UserAgent; | |
say Mojo::UserAgent->new->post('http://127.0.0.1:3000/' => form => { |
This file contains 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 Mojo::Base -strict; | |
use Mojo::Util 'encode'; | |
use Mojo::UserAgent; | |
say Mojo::UserAgent->new->post('http://127.0.0.1:3000/' => form => { | |
file_name_1 => [ | |
{ | |
# file => '/path/to/file', |
This file contains 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
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;34m\]\u\[\033[01;32m\]@\[\033[01;31m\]\h\[\033[00m\]:\[\033[01;35m\]\w\[\033[01;31m\]$(__git_ps1 " (%s) ")\[\033[01;32m\]\$ \[\033[00m\]' | |
function svndiff () { svn diff $@ | colordiff; } | |
PATH=$PATH:/home/logioniz/Scripts |
OlderNewer