Skip to content

Instantly share code, notes, and snippets.

View moritz's full-sized avatar

Moritz Lenz moritz

View GitHub Profile
@moritz
moritz / gist:2829783
Created May 29, 2012 18:03
"parrot" bug admins (really just p6 at this point, parrot is long gone.)
People marked with * should remain active bug admins
acme (Leon Brocard)
allison (Allison Randal)
ambs (Alberto Simoes)
ask (Ask Bjoern Hansen)
*bacek (Vasily Chekalkin)
bbkr (Pawel Pabian)
*bernhard (Bernhard Schmalhofer)
boemmels (J�rgen B�mmels)
@moritz
moritz / reverse-sort.pl
Created March 12, 2012 11:08
reverse sort optimizashun?
#!/usr/bin/env perl
use strict;
use warnings;
use List::Util 'shuffle';
use Benchmark 'cmpthese';
my @unsorted = shuffle 1 .. 1000;
sub reverse_sort {
my @sorted = reverse sort @unsorted;
@moritz
moritz / gist:1704555
Created January 30, 2012 14:06
RT #77474
multi sub infix:<merge> (@ [], @y) is default { @y };
multi sub infix:<merge> (@x, @ []) { @x };
multi sub infix:<merge> (@x [$x, *@xtail], @y [$y,*@ytail]) {
if $x < $y { $x, (@xtail merge @y) }
elsif $x > $y { $y, (@x merge @ytail) }
else { $x, (@xtail merge @ytail) }
}
my @hamming := (1, (@hamming X* 2) merge (@hamming X* 3) merge (@hamming X* 5));
#!perl6
class For { }
class If {
has $.value;
method perl { "If.new($.value)" }
method Str { "<MANGLED_IF $.value>" }