Skip to content

Instantly share code, notes, and snippets.

View j1n3l0's full-sized avatar

Nelo Onyiah j1n3l0

  • Goznel Limited
  • Kent UK
  • 03:28 (UTC -12:00)
View GitHub Profile
use Test2::V0;
use Test::LectroTest::Compat;
use Test::LectroTest::Generator qw< :all >;
sub Positive_Int {
Gen { abs Int->generate(@_) }
}
holds(
Property {
use Test2::V0;
use MooseX::Test::Role;
package Temporal {
use Moo::Role;
use Types::Standard ':all';
requires 'created_at';
around created_at => sub {
# shellcheck shell=sh
nodenv() {
if has nodenv; then
export NODENV_VERSION="${1}"
else
echo "direnv: nodenv is not installed"
fi
}
$ 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)
'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' });
};
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
use Test2::V0;
package Demo::A {
use Moo;
has attr => (
is => 'lazy',
builder => sub { __PACKAGE__ },
);
};
@j1n3l0
j1n3l0 / cbc.t
Created November 12, 2019 11:30
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,
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 {[$_]}),
);
@j1n3l0
j1n3l0 / Point.pm
Last active October 17, 2019 21:16
package Point;
use Data::Dumper::Concise qw< Dumper >;
use Scalar::Util qw< refaddr >;
my %x;
my %y;
use overload '""' => sub {
my $self = shift;