Instantly share code, notes, and snippets.

View provided_deref.t
use Test2::V0;
use PerlX::Maybe qw< :all >;
subtest 'provided_deref' => sub {
my $object = mock {} => (
add => [
count => sub { 1 },
interval => sub { 1 },
update => sub {
View .envrc
use perl ${PERL_VERSION}
eval $(perl -Mlocal::lib="${HOME}/.plenv/libs/${PERL_VERSION}@${LIB_NAME}")
View runtime-role-application-moo.t
use Test2::V0;
use Moo;
{
package Person;
use Moo;
has age => ( is => 'ro' );
}
{
View log.t
use 5.026;
use Log::Any::Adapter qw< TAP >;
use Test::Most;
{
package Bar;
use Moo;
use Log::Any qw< $log >;
sub BUILD { $log->debugf('building package: %s', __PACKAGE__) }
}
View retries.t
use 5.026;
use Test::Most;
{
package Process;
use Moo;
has state => ( is => 'ro', lazy => 1, default => sub { { } } );
sub at_max_retries { $_[0]->state->{retries} // 0 >= 10 }
sub retry { $_[0]->state->{retries}++ }
}
View jsonapi.t
use 5.026;
use DBIx::RunSQL;
use DBIx::Class::Schema::Loader 'make_schema_at';
BEGIN {
my $sql = <<'SQL';
BEGIN;
CREATE TABLE request (
id INTEGER NOT NULL,
View force_parse.t
use 5.026;
use Test::Most;
{
package TemplateGen;
use Moose;
use Types::Standard qw( ArrayRef Str );
use experimental qw( signatures );
has descriptors => ( is => 'ro', isa => ArrayRef[Str], lazy => 1, builder => '_build_descriptors' );
View use-package_cperl-mode_config.el
(use-package cperl-mode
:ensure t
:init (defalias 'perl-mode 'cperl-mode)
:mode (("\\.t\\'" . cperl-mode)
("cpanfile" . cperl-mode))
:config (setq cperl-indent-level 4
cperl-close-paren-offset -4
cperl-continued-statement-offset 4
cperl-indent-parens-as-block t
cperl-tab-always-indent t)
View gist:0e1bcb34597c72ac8df9282ea99da219
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:
https://www.virtualbox.org/manual/ch04.html#sharedfolders
This option can be disabled globally with an environment variable:
VAGRANT_DISABLE_VBOXSYMLINKCREATE=1
View template.t
use 5.024;
use Test::Most;
package C {
use Moo::Role;
has dir => ( is => 'ro', required => 1 );
has file => ( is => 'ro', default => sub { sprintf '%s/%s.pm.ep' => $_[0]->dir, ref($_[0]) =~ s/::/\//gr } );
};
package A {