Instantly share code, notes, and snippets.

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 {
View gist:0ec315a50774ac612c70aea5ba87d13c
Your build configuration:
CC = gcc
CPPFLAGS = -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
CFLAGS = -g -O2 -Wall -Wextra -Wdeclaration-after-statement -g -gdwarf-2 -fno-omit-frame-pointer
CXX = g++
CXXFLAGS = -g -O2 -Wall -Wextra -g -gdwarf-2 -fno-omit-frame-pointer
LDFLAGS =
prefix: /usr/local
version: 4.9.4
View install-watchman.sh
#!/bin/sh -ex
apt-get install -y autoconf automake libssl-dev libtool pkg-config python-dev
cd /tmp
git clone https://github.com/facebook/watchman.git
cd watchman
./autogen.sh
./configure
make
make install
View example.sh
perl -MTest::Most=no_plan -E 'sub foo { +{ @ARGV } }' -wE 'cmp_deeply(foo(), { foo => re("^[0-9]+") }, "data as expected")' foo 100
View install-slack-fedora.sh
#!/bin/sh -ex
#
# download the rpm from here: https://slack.com/downloads/linux
dnf install -y libappindicator && rpm -i slack-3.0.5-0.1.fc21.x86_64.rpm