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 LibXML::Raw; | |
use LibXML::Parser::Context; | |
my $raw = xmlMemoryParserCtxt.new: :string<foo>; | |
my LibXML::Parser::Context $*XML-CONTEXT .= new: :$raw; | |
sub structured-error-cb($ctx, xmlError:D $err) { | |
$*XML-CONTEXT.structured-error($err); | |
} | |
$*XML-CONTEXT.raw.SetStructuredErrorFunc: &structured-error-cb; | |
for 1..250 { | |
$raw.ParseDocument; |
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
#!/usr/bin/env raku | |
use PDF::IO::Reader; | |
#| strip non-deterministic data from ps2pdf output. | |
#| Ensure multiple runs produce exactly the same binary output | |
#| see https://www.mail-archive.com/[email protected]/msg763682.html | |
sub MAIN( | |
Str $file-in, #= input PDF | |
Str $file-out = $file-in, #= output PDF (optional) | |
Str :$id = "wôBÚ¦Øå³§\x[9D]¡tõpÍ\x[16]", |
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 JSON::Fast; | |
sub MAIN(Str $meta6 = 'META6.json') { | |
## rename modules | |
my Hash $meta = from-json($meta6.IO.slurp); | |
my $module-updates = 0; | |
my $script-updates = 0; | |
for $meta<provides>.sort { | |
my $old = .value; |
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
# The Following has about 1/6 chance of failing: | |
buf8.new((^134).pick xx 4).decode; | |
CATCH { default {die "BANG!"} } | |
note "click"; |
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 PDF; | |
use PDF::API6; | |
my PDF::API6 $pdf .= open: "/tmp/idaho.pdf"; | |
my PDF $fdf .= open: "/tmp/flds.fdf"; | |
my @pdf-fields = $pdf.fields.map: *.key; | |
my @fdf-fields = $fdf<Root><FDF><Fields>.map: *.<T>; | |
.say for @fdf-fields (-) @pdf-fields; |
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; | |
enum MyEnum <zero one two three>; | |
my $a = 3; | |
given $a { | |
when one {say "one"} | |
when two {say "two"} | |
when three {say "three"} |
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
npm http 304 https://registry.npmjs.org/sha1 | |
npm http GET https://registry.npmjs.org/nqp-js-io | |
npm http 404 https://registry.npmjs.org/nqp-js-io | |
npm ERR! TypeError: Object.keys called on non-object | |
npm ERR! at Function.keys (native) | |
npm ERR! at installTargetsError (/usr/lib/node_modules/npm/lib/cache.js:708:24) | |
npm ERR! at /usr/lib/node_modules/npm/lib/cache.js:638:10 | |
npm ERR! at saved (/usr/lib/node_modules/npm-registry-client/lib/get.js:148:7) | |
npm ERR! at /usr/lib/node_modules/graceful-fs/polyfills.js:133:7 | |
npm ERR! at Object.oncomplete (fs.js:108:15) |
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
.mode columns | |
.headers on | |
.width 80 | |
select | |
case when r.name = "" then "<anon>" else r.name end || " / " || r.file as "name/file", | |
r.line as "line", | |
sum(entries) as entries, | |
sum(case when rec_depth = 0 then inclusive_time else 0 end)/1000.0 as "inclusive(s)", | |
sum(exclusive_time)/1000.0 as "exclusive(s)" | |
from |
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
class C { | |
has $!foo; | |
method foo is rw { | |
say "foo"; | |
$!foo; | |
} | |
has $!bar; | |
method bar is rw { | |
Proxy.new( |
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 repeat(Str $input --> Rat) { | |
my $phrase := :36($input); | |
my $l := (36 ** $input.chars) - 1; | |
$phrase/$l; | |
} | |
say (repeat('sixrocks') * 36 ** 40).base(36); |
NewerOlder