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; | |
package Weekly84 { | |
use Zydeco; | |
class Matrix { | |
# public required attribute | |
has cells! ( type => ArrayRef[ArrayRef[Bool, 1], 1] ); |
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 List::MoreUtils qw( frequency part uniq ); | |
my @words = map /([\w']+)/g, <DATA>; | |
my %freq = frequency @words; | |
my @parts = part { $freq{$_} } uniq @words; | |
for my $i ( 0 .. $#parts ) { | |
next unless $parts[$i]; |
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 feature 'say'; | |
use List::Util 'shuffle'; | |
use Sub::Operable 'subop'; | |
*greetings = subop { | |
my @greetings = shuffle( | |
'Greetings', | |
'Hello', |
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
<div class="form-group"> | |
<label>Start Date (required)</label> | |
<input | |
type="date" | |
required | |
class="form-control" | |
id="startdate" | |
name="startdate" | |
data-tempus-dominus-overlay="ddd D MMM YYYY" | |
data-tempus-dominus-onclick="true" |
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 Z; | |
my $app = app sub { | |
class 'Visitor' => sub { | |
constant 'USER' => 'tobyink'; # Your username! | |
constant 'TOKEN' => 'XXXXXXX'; # https://github.com/settings/tokens | |
has 'code' => ( type => CodeRef, required => true ); | |
has 'repos' => ( is => 'lazy', init_arg => undef ); |
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 SLL { | |
use Zydeco; | |
class Node { | |
has value ( type => Int ); | |
has nextnode ( type => Maybe[Object] ); | |
method printvalue () { | |
print $self->value, " "; | |
} |
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 utf8::all; | |
use Moo (); | |
use Z qw( Dumper ); | |
use Math::Trig qw( asin pi ); | |
my $app = app sub { | |
role 'Body' => sub { | |
my $CleanNumber = Num->plus_coercions( Str, 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 5.008008; | |
use strict; | |
use warnings; | |
{ | |
package MyApp; | |
use parent 'Exporter::Tiny'; | |
our @EXPORT_OK; | |
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 5.008008; | |
use strict; | |
use warnings; | |
use Types::Standard qw( Str ); | |
use MooX::Press ( | |
prefix => 'MyApp', | |
class => [ | |
'Person' => { |
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 5.008008; | |
use strict; | |
use warnings; | |
use Zydeco::Lite; | |
use Types::Standard qw( Str ); | |
app 'MyApp' => sub { | |
class 'Person' => sub { |