Skip to content

Instantly share code, notes, and snippets.

Avatar

Solomon Foster colomon

View GitHub Profile
View gist:1c509aa4ba4a245f2fb306b627616cef
# This is against current Math::Vector with method Dim changed to
# method Dim() is DEPRECATED('dim')
Wynne:Math-Vector colomon$ perl6 -Ilib --ll-exception t/01-basics.t
ok 1 - Variable is of type Math::Vector
ok 2 - Variable is of type Math::Vector
ok 3 - Variable is of type Math::Vector
ok 4 - Variable is of type Math::Vector
ok 5 - Variable is of type Math::Vector
ok 6 - Variable is of type Math::Vector
View check-file.p6
enum Results <success no-import hung crash>;
sub check-file($file) {
# say "working on $file";
my $proc = Proc::Async.new('utils/sat_nlib', $file);
$proc.stdout(:bin).tap: { Nil }
$proc.stderr(:bin).tap: { Nil }
await Promise.anyof(my $promise = $proc.start, Promise.at(now + 20));
View check-file.p6
enum Results <success no-import hung crash>;
sub check-file($file) {
# say "working on $file";
my $proc = Proc::Async.new('utils/sat_nlib', $file);
$proc.stdout(:bin).tap: { Nil }
$proc.stderr(:bin).tap: { Nil }
my $promise;
View gist:28fa4731c5ba56a8cb0d3641b2770338
multi what's-that(42) { take 'The Answer' }
multi what's-that(Int $ where *.is-prime) { take 'Tis a prime!' }
multi what's-that(Numeric) { take 'Some kind of a number' }
multi what's-that($a, *@b where @b > 0) { what's-that($a); what's-that(|@b); }
multi what's-that { how-good-is $^it }
sub how-good-is ($) { take rand > ½ ?? 'Tis OK' !! 'Eww' }
my $seq := gather what's-that(1, 31337, 42, 'meows');
View gist:89a6e7b8bf7694aa42e83058bb43f489
use v6;
use Inline::Python;
my $date = DateTime.now;
my %days-of-the-week := {
Monday => 1,
Tuesday => 2,
Wednesday => 3,
Thursday => 4,
Friday => 5,
View gist:d79c62638f3a07baa36fe0ebe484b1b3
use v6;
use File::Find;
sub is-git-top($dir) {
# shell('git rev-parse --is-inside-work-tree >&/dev/null').exitcode == 0;
# && shell('git rev-parse --is-inside-git-dir >&/dev/null').exitcode != 0;
$dir.child(".git").d;
}
View gist:5cf7f3d3ed38c0f4cb56
Could not download module metadata: No such method 'host' for invocant of type 'HTTP::Request'
in method update at /home/colomon/.rakudobrew/moar-nom/install/share/perl6/site/lib/Panda/Ecosystem.pm:110
in method init-projects at /home/colomon/.rakudobrew/moar-nom/install/share/perl6/site/lib/Panda/Ecosystem.pm:48
in method project-list at /home/colomon/.rakudobrew/moar-nom/install/share/perl6/site/lib/Panda/Ecosystem.pm:41
View gist:3aa697092a560952b61e
./one-smoke projects.json Kains
==> Fetching Kains
==> Building Kains
==> Testing Kains
Error: unshare(0x10020000): Operation not permitted
It seems your system doesn't support user namespaces.
Although, this should work with PRoot (http://proot.me).
in block at /home/colomon/emmentaler/.panda-work/1441193469_1/lib/App/Kains/Core.pm6:62
in sub raise-errno-on at /home/colomon/emmentaler/.panda-work/1441193469_1/lib/App/Kains/Native.pm6:46
in sub unshare at /home/colomon/emmentaler/.panda-work/1441193469_1/lib/App/Kains/Native.pm6:53
View gist:7097000dcda0935c6ab4
for slurp.comb(/ "http://trillian.mit.edu/~jc/music/book/oneills/waifs/X/" \w*? ".abc" /) -> $url {
qqx/curl -O $url/;
}
View explanation
So... if you run the very-broken script, everything works properly, both running the version of
very-broken-combinations from core and the indentical but for name copy very-broken-combinations-local
here. If you run very-broken-combinations from the REPL, it will fail:
> very-broken-combinations(3,2)
([9 10] [9 10] [9 10] [9 10] [9 10])
The original combinations bug also occurred when running combinations.t, which is how I discovered it.
I haven't tried setting up a test file for very-broken-combinations.