Skip to content

Instantly share code, notes, and snippets.

Avatar

Aleks-Daniel Jakimenko-Aleksejev AlexDaniel

  • Tallinn, Estonia
View GitHub Profile
@AlexDaniel
AlexDaniel / ootut2.pm6
Last active Mar 18, 2020 — forked from wildwildtrees/ootut2.pm6
bug free, but bugs out when follow is called with "Cannot invoke this object (REPR: Null; VMNull)" if I change self.id to self!id in method follow in role Follow line 52
View ootut2.pm6
our %world = {} ;
role Identifier {
has $.id is rw ;
}
role Container {
has @.contents is rw ;
method add($item) {
@!contents.push($item) ;
@AlexDaniel
AlexDaniel / query
Created Oct 19, 2019 — forked from Whateverable/query
greppable6
View query
≠|≤|≥
@AlexDaniel
AlexDaniel / query
Created Sep 28, 2019 — forked from Whateverable/query
evalable6
View query
.say for ^888
View role-import.p6
# MAIN
require ($*PROGRAM.parent.absolute ~ "/to_require.pm") <required_role> ;
my $c = 1 does required_role ;
View gist:092458de72b918a2873c4429b427500a
use v6;
my int $max = 2_000_000 × 4;
# find all primes up to $max using The Sieve of Erathostenes
my int @a = (0..$max);
for (2..($max div 2)) -> int $i {
my int $j = 2;
@a[$i * $j++] = 1 while $i * $j <= $max;
}
@AlexDaniel
AlexDaniel / Foo.pm6
Last active Oct 5, 2018 — forked from mwienand/Foo.pm6
re-export p6
View Foo.pm6
use FooBar;
module Foo {
sub foo is export { "foo" ~ bar() }
}
sub EXPORT {
FooBar::EXPORT::DEFAULT::
}
View foo.p6
#use Slang::Tuxic;
#use Text::CSV;
#use File::Find;
my $csv_line = foo; # Text::CSV.new (eol => "\n");
my $cols = 49;
my @IO-object-list = < a b c >; #find(:dir</home/user1/documents/animals>, :type<file>, :name(/armadillos_201<[4..8]>.*\.csv/));
for @IO-object-list -> $IO-object {
View gist:227c34f20d638d0b339947c744d05bc8
use v6;
my Int @cache is default(0);
my $sum89 = 0;
for (1..567) -> $i {
@cache[$i] = calc-chain($i);
}
for (1..400_000) -> $i {
@AlexDaniel
AlexDaniel / query
Last active Jul 13, 2018 — forked from Whateverable/query
greppable6
View query
if[^{]+=(?!=)[^{]+\{
@AlexDaniel
AlexDaniel / query
Created Jun 25, 2018 — forked from Whateverable/query
greppable6