Skip to content

Instantly share code, notes, and snippets.

View Xliff's full-sized avatar
🏠
Working from home

Xliff Xliff

🏠
Working from home
View GitHub Profile
@Xliff
Xliff / moar-blead-errors.md
Created March 24, 2024 10:09
More Bleeding...
+++ Preparing MOAR build directories
++++++ Building MOAR backend
+++ Generating  gen/moar/stage1/nqpmo.nqp
+++ Compiling   gen/moar/stage1/ModuleLoader.moarvm
+++ Generating  gen/moar/stage1/NQPCORE.setting
+++ Generating  gen/moar/stage1/QASTNode.nqp
+++ Generating  gen/moar/stage1/QRegex.nqp
+++ Generating  stage 1 nqp-config.nqp
+++ Generating  gen/moar/stage1/MASTNodes.nqp
@Xliff
Xliff / multisort.md
Created March 3, 2024 03:13
Easy Multisort
  my @h = ( 
    { 
      name => "albert", 
      age => 40, 
      size => 2 
    }, 
    { 
      name => "andy", 
 age => 22, 
@Xliff
Xliff / RakuSegfaultFeb2024.md
Created February 27, 2024 16:31
Raku Segfault Bug Report - Feb 27, 2024

I have the following C code:

#include <glibtop.h>
#include <glibtop/procwd.h>
#include <glibtop/proclist.h>

#include <stdio.h>

#include <unistd.h>
@Xliff
Xliff / subs-by-infocant.md
Last active December 23, 2023 06:23
Raylib Bindings Sorted By Invocant.

Check out this little gem!

use Raylib::Bindings;

for MY.WHO
      .pairs
      .grep( *.key.starts-with("\&") )
      .values
 .categorize(
@Xliff
Xliff / Promisify.md
Created September 8, 2023 22:29
Running an asyncronous piece of code at a later date

I have a piece of asyncronous code I would like to run at a later date. I figured a Promise would suit this purpose fine.

So far this is what I have:

sub makePromise ( $o, $m, :$in = 0, :$args = @() ) {
  my $p = Promise.new;

 for $args {
@Xliff
Xliff / IMPL-CURRIED.md
Last active August 27, 2023 10:28
Where is the RakuAST Error, Here?
RakuAST::StatementList.new(
  RakuAST::Statement::Use.new(
    module-name => RakuAST::Name.from-identifier("Cro::HTTP::Router")
  ),
  RakuAST::Call::Name.new(
    name => RakuAST::Name.from-identifier("route"),
    args => RakuAST::ArgList.new(
      RakuAST::Block.new(
        body => RakuAST::Blockoid.new(
@Xliff
Xliff / FlameParser.md
Last active July 31, 2023 07:36
On Parsing ElectricSheep Flame Files....

Over the weekend, I wrote a module to do just that. It's early days still, as I'm sure there are tags that are not covered. I'll need to find the spec and have a nice long sit down before it's complete.

Here's what I have, though.

Have fun!

use XML::Class;
@Xliff
Xliff / BQNListOp.md
Last active June 13, 2023 11:07
To Raku - The BQN List Operator

The BQN list operator can readily transfer into Raku. It's basically the same as Raku's list operator: ,. There is a small devil in the detail and that can be illustrated in the following example:

multi sub infix:<> ($a, $b) { 
  infix:<,>($a, $b) 
}

say 1‿2‿3; # ((1 2) 3)
@Xliff
Xliff / BQN-Raku-Range.md
Last active June 15, 2023 03:14
BQN in Raku - Why not? Here's the range operator: ↕

I was just introduced to BQN, recently. While it won't be my first choice of language until I understand it a lot more, it does provide an interesting insight into all things Listy.

So I thought I might grab some low hanging fruit and bring some of that BQN goodness into Raku, a language that I -am- using on the daily.

Here's an implementation for the Range operator (↕):

multi sub prefix:<>(List() $l) { 
@Xliff
Xliff / BartAndLambda.md
Last active May 23, 2023 08:48
AI's are Writing in Raku, now!

I went to [bart.gooogle.com] and asked it: "How do you write lambda functions in Raku?"

Here's how it responded:

===

To write lambda functions in Raku, you can use the following syntax:

Code snippet