Skip to content

Instantly share code, notes, and snippets.

@djerius
djerius / Shim.pm
Created May 20, 2020 13:57
Prototype Sub Mocking Shim
package My::Test::Shim;
use Test2::V0;
use 5.10.0;
use Test2::Mock;
use Package::Stash;
use Exporter ();
use Module::Runtime qw( use_module );
@djerius
djerius / Makefile
Last active February 4, 2020 20:57
# This Makefile is for the CIAO::Lib::Region extension to perl.
#
# It was generated automatically by MakeMaker version
# 7.38 (Revision: 73800) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: (q[INSTALLMAN1DIR=none], q[INSTALLMAN3DIR=none])
#
@djerius
djerius / compare.pl
Created July 22, 2018 17:39
benchmark hash element assignment and testing
use Benchmark ':all';
my @array = 1 .. 1000;
cmpthese(
10000,
{
'%foo = map { $_ => 1 } @array' => sub {
my %foo = map { $_ => 1 } @array;
@djerius
djerius / asserts.lua
Last active August 29, 2015 14:20
luassert match assertion
local say = require("say")
local assert = require( "luassert" )
local function matches(state, arguments )
if #arguments ~= 2 then
return false
end
-- allow for alternates by passing in a table as the expected
@djerius
djerius / badimp.sh
Created February 11, 2015 14:42
problem using roles in import
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.11.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `#!/bin/sh' line above, then type `sh FILE'.
#
lock_dir=_sh22402
# Made on 2015-02-11 09:40 EST by <dj@macabre>.
# Source directory was `/data/macabretmp/dj'.
#
# Existing files will *not* be overwritten, unless `-c' is specified.