This file contains 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 v6.d; | |
use NativeCall; | |
class winsize is repr('CStruct') { | |
has uint16 $.rows; | |
has uint16 $.cols; | |
has uint16 $.xpixels; | |
has uint16 $.ypixels; | |
method gist() { |
This file contains 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
#ifdef _WIN32 | |
#include <windows.h> | |
#endif | |
#define MAX_PATH_LENGTH 260 | |
void transform_path(char *path) { | |
#ifdef _WIN32 | |
// Check if path is already a long path | |
if (strlen(path) >= 7 && strncmp(path, "\\\\?\\", 4) == 0) { |
This file contains 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
C:\Users\ugexe>raku --ll-exception -e "use lib '.'; use Test;" | |
read from dirhandle failed: 123 | |
at SETTING::src/core.c/Rakudo/Internals.pm6:1345 (C:\Users\ugexe\.rakudobrew\moar-2021.10\install\share\perl6\runtime/CORE.c.setting.moarvm:next) | |
from SETTING::src/core.c/Rakudo/Internals.pm6:1374 (C:\Users\ugexe\.rakudobrew\moar-2021.10\install\share\perl6\runtime/CORE.c.setting.moarvm:pull-one) | |
from SETTING::src/core.c/Any-iterable-methods.pm6:326 (C:\Users\ugexe\.rakudobrew\moar-2021.10\install\share\perl6\runtime/CORE.c.setting.moarvm:pull-one) | |
from SETTING::src/core.c/Any-iterable-methods.pm6:335 (C:\Users\ugexe\.rakudobrew\moar-2021.10\install\share\perl6\runtime/CORE.c.setting.moarvm:pull-one) | |
from SETTING::src/core.c/CompUnit/Repository/FileSystem.pm6:283 (C:\Users\ugexe\.rakudobrew\moar-2021.10\install\share\perl6\runtime/CORE.c.setting.moarvm:dist-from-ls) | |
from SETTING::src/core.c/CompUnit/Repository/FileSystem.pm6:238 (C:\Users\ugexe\.rakudobrew\moar-2021.10\install\share\perl6\runtime/CORE. |
This file contains 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
os: Visual Studio 2015 | |
platform: x64 | |
install: | |
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64' | |
- choco install strawberryperl | |
- SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH% | |
- git clone https://github.com/rakudo/rakudo.git %APPVEYOR_BUILD_FOLDER%\..\rakudo | |
- cd %APPVEYOR_BUILD_FOLDER%\..\rakudo |
This file contains 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
# perl|perl6 words.pl word_list.txt f o o b a r b a z | |
my @ARGV = do { sub eval { &EVAL(@_) }; eval( ("0" and q|@*ARGS| or q|@ARGV|) ) }; | |
sub polyslurp ($_) { "0" and (return "{$_.IO.slurp}") or (return do { open(my $fh, $_[0]); join("", <$fh>); }) }; | |
my $filename = shift(@ARGV); | |
my @words = split("\n", polyslurp($filename)); | |
my $input_letters = {}; | |
$input_letters{lc($_)} += 1 for @ARGV; |
This file contains 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
sub eval($_) { &EVAL($_) }; | |
sub polyint($_) { "0" and (return Int($_[0])) or (return int($_[0])) }; | |
sub script_size { "0" and (return 0+eval('$*PROGRAM.IO.s')) or (return 0+eval('-s $0')) }; | |
#`() use isms; sub infix:«<<»($a,$b) { $a +< $b }; | |
my $digits = script_size() + 1; | |
my (@out, @a); | |
my ($b, $c, $d, $e, $f, $g, $i, $d4, $d3, $d2, $d1); | |
$b = $d = $e = $g = $i = 0; |
This file contains 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
my @ARGV = do { sub eval { &EVAL(@_) }; eval( ("0" and q|@*ARGS| or q|@ARGV|) ) }; | |
my $numbers_tried = 0; | |
my $numbers_found = 0; | |
NUMBERS: while ($numbers_found != @ARGV[0]) { | |
$numbers_tried++; | |
my $state = $numbers_tried; | |
while ($state != 1) { |
This file contains 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
my @ARGV = do { sub eval { &EVAL(@_) }; eval( ("0" and q|@*ARGS| or q|@ARGV|) ) }; | |
my @state = (1,); | |
for (1 .. @ARGV[0]) { | |
print(join(" ", @state), "\n"); | |
my @row = map &{ sub ($_) { @state[$_] + (@state[$_ + 1] // 0) } }.(), (0 .. ($_ - 2)); | |
@state = (); | |
push(@state, 1); | |
push(@state, $_) for @row; | |
push(@state, 1); | |
} |
This file contains 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
sub polymin (*@_) { (@_[0] > @_[1]) and (return @_[1]) or (return @_[0]) } | |
sub polymax (*@_) { (@_[0] > @_[1]) and (return @_[0]) or (return @_[1]) } | |
sub polychars (*@_) { 0+grep &{ sub ($_) { $_ ne "" } }.(), split("", @_[0]) } | |
sub polytern (*@_) { (@_[0]) and (return @_[1]) or (return @_[2]) } | |
sub dld (*@_) { | |
my $source = @_[0]; | |
my $target = @_[1]; | |
my $max = @_[2]; | |
my $sourceLength = polychars($source); |
This file contains 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
# PERL6LIB="/Users/ugexe/repos/CompUnit-Repository-InstallationWithHook/lib"\ | |
# perl6 -I /Users/ugexe/repos/zef /Users/ugexe/repos/zef/bin/zef\ | |
# -to="CompUnit::Repository::InstallationWithHook#/Users/ugexe/.rakudobrew/moar-blead-master/install/share/perl6/site"\ | |
# install /Users/ugexe/repos/zef | |
class CompUnit::Repository::InstallationWithHook is CompUnit::Repository::Installation { | |
method short-id { 'inst-with-hook' } | |
method path-spec { $.short-id ~ '#' } | |
multi method install(Distribution $dist) { | |
return unless my $result = callsame(); |
NewerOlder