Skip to content

Instantly share code, notes, and snippets.

View autarch's full-sized avatar

Dave Rolsky autarch

View GitHub Profile
@autarch
autarch / matrix.md
Last active December 5, 2016 21:01

Parameter specs

Type

  • No type, just required
  • Has a type -> Types

Required or not

  • Required
#!/home/autarch/perl5/perlbrew/perls/perl-5.24.0/bin/perl
use strict;
use warnings;
use lib '/home/autarch/.perlbrew/libs/perl-5.24.0@dev/lib/perl5';
use Getopt::Long qw( :config pass_through );
use Perl::Tidy 20120714;
use Path::Class qw( file );
# sample(main)
multi trait_mod:<is>(Method $method, :$annoying!) {
$method.wrap( { say "Thank you for calling {$method.name}!"; callsame } );
}
class Dog {
method bark is annoying { say 'woof' }
}
Dog.new.bark
class Log {
has $.safe;
has $.u̯͓͚̟̜͍͔n̟̦̱̟̬͓s̫̟̺͉̥p͈̜͇e͇̗̝̩͓̳ͅa̼̹̯k̻̱͓̗̦̘͇a̦̰b̪̦̪l̬̜e̤̣̖̥-h̜̫o͉̮̜̖r͉̮̪̝͎r̯̟̱̟or̺̯̖;
}
my $log = Log.new( safe => 42, u̯͓͚̟̜͍͔n̟̦̱̟̬͓s̫̟̺͉̥p͈̜͇e͇̗̝̩͓̳ͅa̼̹̯k̻̱͓̗̦̘͇a̦̰b̪̦̪l̬̜e̤̣̖̥-h̜̫o͉̮̜̖r͉̮̪̝͎r̯̟̱̟or̺̯̖ => 'Zalgo' );
$log.u̯͓͚̟̜͍͔n̟̦̱̟̬͓s̫̟̺͉̥p͈̜͇e͇̗̝̩͓̳ͅa̼̹̯k̻̱͓̗̦̘͇a̦̰b̪̦̪l̬̜e̤̣̖̥-h̜̫o͉̮̜̖r͉̮̪̝͎r̯̟̱̟or̺̯̖ = 'He Comes!';
say $log.u̯͓͚̟̜͍͔n̟̦̱̟̬͓s̫̟̺͉̥p͈̜͇e͇̗̝̩͓̳ͅa̼̹̯k̻̱͓̗̦̘͇a̦̰b̪̦̪l̬̜e̤̣̖̥-h̜̫o͉̮̜̖r͉̮̪̝͎r̯̟̱̟or̺̯̖
$log.safe = 'Protect Us!';
use strict;
use warnings;
use Test2::IPC;
use Test2::Tools::AsyncSubtest qw( subtest_start subtest_run subtest_finish );
use Test2::API qw( context_do test2_stack );
foo($_) for 1, 2;
test2_stack()->top->cull;
use strict;
use warnings;
use Test2::IPC;
use Parallel::ForkManager;
use Test2::API qw( context run_subtest test2_stack );
use Test::More;
my $pfm = Parallel::ForkManager->new(2);
use strict;
use warnings;
use Test2::IPC;
use Parallel::ForkManager;
use Test2::API qw( context run_subtest test2_stack );
use Test::More;
my $pfm = Parallel::ForkManager->new(2);
Cannot find method 'compile_time_value'
at gen/moar/m-Perl6-Actions.nqp:7230 (/home/autarch/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Actions.moarvm:bare_rat_number:35)
from gen/moar/stage2/QRegex.nqp:1340 (/home/autarch/.rakudobrew/moar-nom/install/share/nqp/lib/QRegex.moarvm:!reduce:0)
from gen/moar/stage2/QRegex.nqp:1296 (/home/autarch/.rakudobrew/moar-nom/install/share/nqp/lib/QRegex.moarvm:!cursor_pass:0)
from <unknown>:1 (/home/autarch/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm:bare_rat_number:133)
from <unknown>:1 (/home/autarch/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm:rat_number:64)
from src/Perl6/Grammar.nqp:3333 (/home/autarch/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm:numish:182)
from <unknown>:1 (/home/autarch/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm:number:sym<numish>:57)
from gen/moar/stage2/QRegex.nqp:1356 (/home/autarch/.rakudobrew/moar-nom/install/share/nqp/lib/QRegex.moarvm:!proto
$ perl -MEmail::MIME -E 'say Email::MIME->create( header => [ To => q{sástien.lambert@example.com}, Subject => q{«Testing»}, From => q{autarch@urth.org} ], body => q{Body} )->as_string'
To: sástien.lambert@example.com
Subject: «Testing»
From: autarch@urth.org
Date: Mon, 25 Jan 2016 19:17:38 -0600
MIME-Version: 1.0
Body
$ perl -MCourriel::Builder -E 'say build_email( to( q{sástien.lambert@example.com} ), subject( q{Testing} ), from( q{autarch@urth.org} ), plain_body(q{Body}) )->as_string'
To: =?UTF-8?B?c8ODwqFzdGllbi5sYW1iZXJ0QGV4YW1wbGUuY29t?=
Subject: Testing
From: autarch@urth.org
Date: Tue, 26 Jan 2016 01:08:47 +0000
Message-Id: <14537705270.BD7FaFC0D.31134@houseabsolute.urth.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64