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 MusicPref; | |
use Moose; | |
use namespace::autoclean; | |
has 'name' => ( is => 'ro', isa => 'Str' ); | |
package Character; | |
use Moose; | |
use namespace::autoclean; | |
has 'name' => ( is => 'ro', isa => 'Str' ); | |
has 'music_prefs' => ( is => 'rw', does => 'KiokuDB::Set' ); |
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
.---------. | |
.----------.----------| Handler |--------.--------. | |
| | | '---------' | | | |
| | | | | | | |
| | | | | | | |
v v v '-> v v | |
.-----. .-----. .-----. .------------. .------. .-------. | |
| App | | App | | App | | Serializer | | Hook | | Route | | |
'-----' '-----' '-----' '------------' '------' '-------' |
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
use strict; | |
use warnings; | |
use DateTime; | |
my $dt = DateTime->new( | |
day => 13, | |
year => 2012, | |
); | |
my $count = 0; |
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
# this function lets you run code in a fork | |
# and use a condvar on it to get the data | |
# and return it to the client in JSON form, all non-blocking and async | |
# based heavily on a trick by Assaf Gordon | |
sub async_response (&) { | |
my $cb = shift; | |
send_file( | |
\'noop', |
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
use strict; | |
use warnings; | |
use AnyEvent; | |
use AnyEvent::HTTP; | |
use Promises 'deferred'; | |
my @urls = ( 'https://ddg.gg', 'http://dyndns.org', 'http://metacpan.org' ); | |
my $cv = AE::cv; | |
my $cb; $cb = 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
use v5.10; | |
use MetaCPAN::API; | |
use Data::Dumper; | |
use List::AllUtils qw(min max); | |
use DateTime; | |
use DateTime::Format::ISO8601; | |
my @score_label = qw( | |
Abysmal | |
Poor |
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
MetaCPAN::API::Rating { | |
Parents Moo::Object | |
public methods (9) : author, date, details, distribution, helpful, new, rating, release, user | |
private methods (1) : _known_fields | |
internals: { | |
data { | |
author "PLACEHOLDER", | |
date "2014-03-02T12:20:07", | |
distribution "Moose", | |
rating 4.9, |
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
# app.pl: | |
use MyApp::Web; | |
use MyApp::Web::API; | |
use Plack::Builder; | |
builder { | |
mount '/' => MyApp::Web->to_app; | |
mount '/api' => MyApp::Web::API->to_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
#!perl | |
use strict; | |
use warnings; | |
use IO::All; | |
use IO::All::LWP; | |
use Web::Query; | |
local $| = 1; | |
wq('http://podbay.fm/show/536258179') |
OlderNewer