Skip to content

Instantly share code, notes, and snippets.

/home/duff/perl5/perlbrew/perls/perl-5.16.2/bin/perl tools/build/create-jvm-runner.pl dev . . /home/duff/git/rakudo/install /home/duff/git/rakudo/install/languages/nqp/runtime/asm-4.1.jar:/home/duff/git/rakudo/install/languages/nqp/runtime/asm-tree-4.1.jar:/home/duff/git/rakudo/install/languages/nqp/runtime/jline-1.0.jar:/home/duff/git/rakudo/install/languages/nqp/runtime/jna.jar:/home/duff/git/rakudo/install/languages/nqp/runtime/nqp-runtime.jar:/home/duff/git/rakudo/install/languages/nqp/lib/nqp.jar
Creating './perl6-j'
Creating './perl6-jdb-server'
Creating './perl6-eval-server'
./perl6-j --target=jar --output=lib/Test.jar lib/Test.pm
./perl6-j --target=jar --output=blib/lib.jar lib/lib.pm6
/home/duff/perl5/perlbrew/perls/perl-5.16.2/bin/perl -MExtUtils::Command -e mkpath blib/Pod/To
./perl6-j --target=jar --output=blib/Pod/To/Text.jar lib/Pod/To/Text.pm
/home/duff/git/rakudo/install/bin/nqp-j --target=jar --javaclass=perl6-debug --output=perl6-debug.jar \
src/perl6-debug.nqp
@perlpilot
perlpilot / AB
Last active August 29, 2015 13:58
#!/usr/bin/env perl6
say "begin " ~ now;
my $b=0;
my @a;
for ^10_000 {
@a[$_]="1,2".split(','); # Version A
# @a[$_]="1,2".split(rx/\,/); # Version B
}
=>begin BHPCAC 2014101+0000 argsl
2014 04 10 23 42 00 18 157 2834 3 1 90 139 131 92 0 902 3 -4 1 0 0 2158 16879 320 56 210 465 33 33 25 161 183 92 25 8 5 6 8 7 26 745 55
1 12 195 7 2 170 170
2 36 212 6 2 155 155
3 51 206 6 2 145 149
4 97 161 7 2 138 152
5 39 117 6 2 145 149
6 7 130 8 3 144 139
7 20 166 8 3 139 131
8 19 185 7 2 134 122
> qx/ kill -l /
0
HUP
INT
QUIT
ILL
TRAP
ABRT
BUS
FPE
@perlpilot
perlpilot / magic
Last active August 29, 2015 14:04
#!/usr/bin/perl
use 5.010;
use strict; use warnings;
use Data::Dumper;
use Image::Magick;
my $image = Image::Magick->new;
$image->Read('cpira-weirdness.png');
$image->Quantize(colors=>256);
This code:
my $knowhow := nqp::knowhow().new_type(:repr("P6bigint"));
my $int := nqp::fromstr_I('23456789123456789012345678912345678', $knowhow);
say($int);
produces this output:
893965902
@perlpilot
perlpilot / SameCase.pm
Last active August 29, 2015 14:06
re-implementation of Str.samecase
use MONKEY_TYPING;
augment class Str {
method samecase-strcat(Str:D: Str $pattern) {
my str $str = nqp::unbox_s(self);
my str $pat = nqp::unbox_s($pattern);
my int $n = min(nqp::chars($str), nqp::chars($pattern));
my int $i = 0;
my int $j = 0;
my str $ret = '';
@perlpilot
perlpilot / gist:7ed197a4167cc1e4b40f
Created December 18, 2014 19:25
all the contexts
➤ ack -ho '\w+ context' | sort |uniq -c | sort -n
1 access context
1 all context
1 as context
1 binding context
1 Boolean context
1 build context
1 Capture context
1 character context
1 cloning context
diff --git a/lib/Panda/Fetcher.pm b/lib/Panda/Fetcher.pm
index 256f9d8..f263bc7 100644
--- a/lib/Panda/Fetcher.pm
+++ b/lib/Panda/Fetcher.pm
@@ -4,16 +4,18 @@ use Shell::Command;
method fetch($from, $to) {
given $from {
+ my $commit;
+ $from.=subst(/ '@' (<[ . / ]+alpha+digit>+) $/, { $commit = $0; "" });
➤ rakudobrew build-panda
Cloning into 'panda'...
remote: Counting objects: 3577, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 3577 (delta 2), reused 0 (delta 0), pack-reused 3567
Receiving objects: 100% (3577/3577), 600.22 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1531/1531), done.
Checking connectivity... done.
Current branch master is up to date.
===SORRY!===