Skip to content

Instantly share code, notes, and snippets.

View j1n3l0's full-sized avatar

Nelo Onyiah j1n3l0

  • Goznel Limited
  • Kent UK
  • 07:59 (UTC -12:00)
View GitHub Profile
(ns example-cascalog.core
(:require [cascalog.api :refer [?<- stdout]]
[clojure.string :refer [split-lines split]]))
(defn slurp-psv
"Slurp a PSV file into a vector of vectors"
[file]
(->> file slurp split-lines (mapv #(split % #"\|"))))
(?<- (stdout)
# def adjacent_pixels(matrix, color, row, column)
# [column - 1, column + 1]
# .select { |x| x >= 0 and x < matrix.column_count }
# .select { |x| matrix.element(row, x).eql? color }
# .map { |x| [row, x] }
# .concat(
# [row - 1, row + 1]
# .select { |y| y >= 0 and y < matrix.row_count }
# .select { |y| matrix.element(y, column).eql? color }
# .map { |y| [y, column] }
it '"S" should print to STDOUT and not update env' do
e = {:cmd=>'S',:args=>[],:img=>{},:errors=>[]}
s = $stdout.string
o = <<-OUTPUT
=>
OUTPUT
expect(Editor.eval(e)).to eq(e).and(s).to eq(o)
end
# subtests in Test::Class
sub test_foo :Tests() {
my $self = shift;
subtest foo => sub {
pass 'foo passes';
};
subtest bar => sub {
{
package Schema;
use Moo;
use MooX::HandlesVia;
has _real_schema_object_ => (
default => sub { { Hook => [1..5], Item => [qw(foo bar baz)] } },
is => 'lazy',
handles => { 'resultset' => 'get' },
handles_via => 'Hash',
);
use DateTime;
use Test::Most;
{
package Fulfilment;
use Moo;
has pick_required_date => ( is => 'ro', lazy => 1 );
has time_to_sla => (
is => 'ro',
lazy => 1,
#!/usr/bin/env perl
use 5.014;
use Test::Most;
use Template;
use Capture::Tiny ':all';
my $person = {
name => 'nelo',
(define-skeleton perl-throwaway
"Throwaway Perl Skeleton" nil
"#!/usr/bin/env perl\n"
"\n"
"use 5.014;\n"
"use Test::Most;\n"
"\n"
"# test your idea here ...\n"
"\n"
"done_testing;\n")

Keybase proof

I hereby claim:

  • I am j1n3l0 on github.
  • I am j1n3l0 (https://keybase.io/j1n3l0) on keybase.
  • I have a public key whose fingerprint is CEEE ACF1 FAF2 A718 F9A8 434D 9D2B 686B 51D4 50A5

To claim this, I am signing this object:

use 5.014;
use Test::Most;
{ package Foo;
use Moose;
has bar => (
default => sub { Bar->new },
handles => {
baz => 'baz',
quux => ['quux', 'demo'],