Skip to content

Instantly share code, notes, and snippets.

Zoffix Znet zoffixznet

Block or report user

Report or block zoffixznet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zoffixznet
zoffixznet / query
Created Jul 13, 2018 — forked from Whateverable/query
greppable6
View query
if[^{]+(?<!\!)=(?!=)[^{]+\{
View gist:eb5f33295282296d1627f9c149f991d2
<VirtualHost *:80>
ErrorLog ${APACHE_LOG_DIR}/error.<REDACTED>.ca.log
ServerName <REDACTED>.ca
ServerAlias www.<REDACTED>.ca
<Proxy *>
Require all granted
</Proxy>
ProxyRequests Off
@zoffixznet
zoffixznet / sh.sh
Last active Oct 5, 2017
Bump Rakudo's NQP/MoarVM versions
View sh.sh
alias bump-it='rm -fr nqp &&
git clone https://github.com/perl6/nqp/ &&
cd nqp &&
git clone https://github.com/MoarVM/MoarVM/ &&
cd MoarVM &&
git describe > ../tools/build/MOAR_REVISION &&
cd ../ &&
git commit -m '\''Bump MoarVM'\'' tools/build/MOAR_REVISION &&
git describe > ../tools/build/NQP_REVISION &&
cd ../ &&
View p6.p6
# Just some setup for the files we'll be reading:
'file1'.IO.spurt: "a\nb\nc";
'file2'.IO.spurt: "d\ne\n";
'file3'.IO.spurt: "f";
my $line;
# CatHandle accepts any mix of Cool:D, IO::Path, IO::Handle, IO::Pipe:
my $kitty = IO::CatHandle.new: 'file1', 'file2'.IO, 'file3'.IO.open,
:on-switch{ $line = 1 }; # define what to do on handle switch
View gist:8a7649e454d0f2b73a1a5420338c2fe7
t/spec/S02-types/baghash.rakudo.moar (Wstat: 256 Tests: 265 Failed: 1)
Failed test: 250
Non-zero exit status: 1
t/spec/S02-types/mixhash.rakudo.moar (Wstat: 256 Tests: 236 Failed: 1)
Failed test: 219
Non-zero exit status: 1
t/spec/S06-signature/types.t (Wstat: 512 Tests: 18 Failed: 2)
Failed tests: 11-12
Non-zero exit status: 2
t/spec/S32-exceptions/misc.rakudo.moar (Wstat: 1536 Tests: 427 Failed: 6)
@zoffixznet
zoffixznet / bash.sh
Last active Apr 19, 2017
Rakudo REPL OSX History File Fix
View bash.sh
alias perl6repl='perl6 -e '\''
use nqp;
sub MAIN (*%adverbs) {
REPL.^mixin(
role {
has IO::Path $!history-file;
method history-file (--> Str:D) {
return $!history-file.absolute if $!history-file.defined;
$!history-file = $*ENV<RAKUDO_HIST>
View IO-kills.md
View md.md

⚠️⚠️⚠️ IMPORTANT ⚠️⚠️⚠️

This document is kept for archival purposes only and does not necessarily describe implemented reality. Do NOT assume the behaviour described here is how things are meant to work. Use the Perl 6 Specification or consult with core developers for that purpose.

View md.md

Summary of the changes to the original IO Action Plan

  1. Instead of using mutually-exclusive named arguments to .seek, split it into three methods instead: .seek-from-start, .seek-from-current, .seek-from-end. Discussion
  2. Add :joiner argument to .exension that defaults to empty string if $replacement is an empty string or to a . if $replacement is not an empty string. Usage examples and discussion
  3. Deprecate IO::Path.chdir in 6.d; remove it in 6.e. Discussion
  4. Deprecate $*SPEC in 6.d; remove it in 6.e. This depends on how successful the plan is when implemented in a module first. Details
View p6.p6
constant N = 10000;
constant DIV = 5;
constant CORES = 32;
constant batch = N div CORES;
(0, batch … N, N).rotor(2 => -1).flat.map({$^a^..$^b}).race(:batch).map(*.grep(* %% DIV).sum).sum.say;
You can’t perform that action at this time.