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
package T; | |
use Moose::Role; | |
sub a { 'x' } | |
sub b { 'y' } | |
sub c { shift->i } | |
package U; | |
use Moose::Role; |
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
############################################################################# | |
# The problem: | |
# We need to separate in a class two type of attributes by name: | |
# 1) Private: names begin with ``_'' (underscore) | |
# 2) Public: All other | |
# | |
# In order to apply (or try) serialization Role given by MooseX::Storage | |
# MooseX::Storage let us apply a role two attribute that won't be touched | |
# by serialized methods it is call ``MooseX::Storage::Meta::DoNotSerialize | |
# |
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
############################################################################### | |
# Example of use for IOLoop. The problem is to recurring ping a set of hosts | |
# and save each experiment. | |
# | |
############################################################################### | |
use Mojo::Base -signatures; | |
use Mojo::IOLoop; | |
use Net::Ping; | |
use DDP; |
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/env perl | |
use strict; | |
use warnings; | |
use Mojolicious::Lite -signatures; | |
use Data::Fake qw/Core Names Text Dates/; | |
use DDP; | |
my $url = "http://localhost:4000/"; |
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
itaipu@ubatuba:~/src/mojo$ git branch | |
* future_async_await | |
master | |
itaipu@ubatuba:~/src/mojo$ TEST_ASYNC_AWAIT=1 prove -vl t/mojo/promise_async_await.t | |
t/mojo/promise_async_await.t .. Unrecognised import symbols Mojo::Promise future_class at t/mojo/promise_async_await.t line 12. | |
BEGIN failed--compilation aborted at t/mojo/promise_async_await.t line 12. | |
Dubious, test returned 255 (wstat 65280, 0xff00) | |
No subtests run | |
Test Summary Report |
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
[out:json]; | |
node | |
[amenity=school] | |
(-19.9944824139763,-43.8771629333496,-19.9765754775178,-43.8751029968262); | |
out; |
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
## no critic | |
package MyApp; | |
use Mojolicious::Lite; | |
get '/' => sub { shift->render( text => "MyApp running" ) }; | |
package YetApp; | |
use Mojolicious::Lite; | |
get '/' => sub { shift->render( text => "Yet App running" ) }; |
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/env perl | |
# An example in perl for a particular problem I found using R. | |
# | |
# How we use perl to parse all files that was named as date format | |
# So we can parse as date and find the most recent file. | |
use Mojo::Base -strict, -signatures; | |
use DateTime; | |
use Mojo::File; | |
use DateTime::Format::Strptime; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/env perl | |
## no critic | |
package ForkMe { | |
use strict; | |
use warnings; | |
use Mojo::Base -base, -signatures; | |
use utf8; | |
has pid => sub { $$ }; |
OlderNewer