This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl6 | |
| sub get_primes(int $n) { | |
| return () if $n < 2; | |
| return (2) if $n == 2; | |
| my int @s = (); | |
| loop (my int $i = 3; $i <= $n; $i+=2) { | |
| @s.push($i); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| multi sub infix:<+>(Unit $x, Unit $y) { | |
| if (not $x.isSameUnit($y)) {die "Units do not match.";} | |
| return Unit.new(magnitude => $x.magnitude + $y.magnitude, units => $x.units); | |
| } | |
| my $a = Units::Unit.new(magnitude => 1.2, units => ("m" => 1)); | |
| my $b = Units::Unit.new(magnitude => 5.0, units => ("m" => 1)); | |
| say $a + $b; |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Processing https://docs.raku.org/ | |
| List of broken links and other issues: | |
| https://github.com/Raku/doc/blob/master/CONTRIBUTING.md | |
| Line: 84 | |
| Code: 200 OK | |
| To do: Some of the links to this resource point to broken URI fragments | |
| (such as index.html#fragment). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| path-iterator |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use nqp; | |
| { | |
| constant $read-file = "README.md".IO; | |
| $read-file.IO.r; | |
| for ^1000 { | |
| my $p = Proc::Async.new( | «/bin/cat $read-file» ); | |
| my $output = ''; | |
| $p.stdout.tap: -> $s { $output ~= $s; }; | |
| await $p.start; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use nqp; | |
| my $html; | |
| my $proc = run "wget", "-o", "/dev/null", "-O", "-", "https://www.fimfiction.net/bookshelf/149291/", :out; | |
| $html = $proc.out.slurp-rest; | |
| say "html is " ~ $html.chars ~ " chars"; | |
| nqp::force_gc; | |
| say "/proc/$*PID/statm".IO.lines[0].split(/\s/)[5] * 4096 / 1024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl6 | |
| use lib ‘data/all-modules/softmoth/p6-Template-Mustache’; | |
| use v6; | |
| #use v6.d.PREVIEW; | |
| use Template::Mustache; | |
| my $html = q:to/EOF/; | |
| <html> | |
| {{> head }} |