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
# shellcheck shell=sh | |
nodenv() { | |
if has nodenv; then | |
export NODENV_VERSION="${1}" | |
else | |
echo "direnv: nodenv is not installed" | |
fi | |
} |
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
$ cpan "Archive::Zip" | |
CPAN: Storable loaded ok (v2.34) | |
Reading '/Users/nonyiah/.cpan/Metadata' | |
Database was generated on Wed, 29 Jan 2020 14:17:03 GMT | |
Running install for module 'Archive::Zip' | |
CPAN: Digest::SHA loaded ok (v5.71) | |
CPAN: Compress::Zlib loaded ok (v2.048) | |
Checksum for /Users/nonyiah/.cpan/sources/authors/id/P/PH/PHRED/Archive-Zip-1.67.tar.gz ok | |
CPAN: YAML loaded ok (v1.30) | |
CPAN: CPAN::Meta::Requirements loaded ok (v2.131) |
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'; | |
const { expect } = require('chai'); | |
const middleware = async (req, res) => { | |
if (!req.query.jobId) { | |
throw Error('Missing requirement (jobId)'); | |
} | |
return res.status(200).json({ message: '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
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 |
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 Test2::V0; | |
package Demo::A { | |
use Moo; | |
has attr => ( | |
is => 'lazy', | |
builder => sub { __PACKAGE__ }, | |
); | |
}; |
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 Test2::V0 -target => 'Crypt::CBC'; | |
subtest 'Crypt::CBC' => sub { | |
my $a = Crypt::CBC->new(qw< -key A -cipher Blowfish >); | |
my $b = Crypt::CBC->new(qw< -key B -cipher Blowfish >); | |
my $s = 'Hello, World!'; | |
is( | |
$a->decrypt( $a->encrypt($s) ), | |
$s, |
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 Test::Most; | |
package Class { | |
use Moo; | |
use Types::Standard qw< :all >; | |
has attribute => ( | |
coerce => 1, | |
is => 'ro', | |
isa => ArrayRef->parameterize(Str)->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
package Point; | |
use Data::Dumper::Concise qw< Dumper >; | |
use Scalar::Util qw< refaddr >; | |
my %x; | |
my %y; | |
use overload '""' => sub { | |
my $self = shift; |
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 Test::LectroTest::Compat; | |
use Test::LectroTest::Generator qw< :all >; | |
sub Positive_Int { Gen { abs Int->generate(@_) } } | |
holds( | |
Property { | |
##[ a <- Positive_Int, b <- Positive_Int ]## | |
my $c = sub { $_[0] + $_[1] }->( $a, $b ); |
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
#!/bin/sh | |
# Minimum perl configuration | |
export PLENV_VERSION="5.24.0" | |
cpan "local::lib" "App::cpm" "CPAN" "Log::Log4perl" "Term::ReadKey" "Term::ReadLine::Gnu" "YAML" | |
eval "$(perl -Mlocal::lib=local)" |