Skip to content

Instantly share code, notes, and snippets.

View KrisShannon's full-sized avatar

Kris Shannon KrisShannon

View GitHub Profile
@KrisShannon
KrisShannon / keybase.md
Created March 9, 2020 07:16
keybase.md

Keybase proof

I hereby claim:

  • I am KrisShannon on github.
  • I am krisshannon (https://keybase.io/krisshannon) on keybase.
  • I have a public key whose fingerprint is 80D7 BCE7 50DD 755E 3BA0 5313 EF0B 86E7 85CC F24B

To claim this, I am signing this object:

@KrisShannon
KrisShannon / iostat.md
Created January 23, 2018 13:07
iostat <-> node_exporter
iostat iostat definition node_exporter definition
rd_ios reads_completed_total
rd_merges reads_merged_total
rd_sectors read_bytes_total / 512
rd_ticks read_time_seconds_total * 1000
wr_ios writes_completed_total
wr_merges writes_merged_total
wr_sector written_bytes_total / 512
wr_ticks write_time_seconds_total * 1000
@KrisShannon
KrisShannon / gist:1594445
Created January 11, 2012 12:30
Perl6 LTM Semantics
L.T.M.P. = Longest Term Matching Prefix
P.P. = Partially procedural (the L.T.M.P. cannot extend beyond this construct)
L.T.M.P. will match the whole construct of anything which is not P.P.
FOO BAR
P.P. if either FOO or BAR are P.P.
if FOO is not P.P. then the L.T.M.P is FOO followed by the L.T.M.P of BAR
otherwise the L.T.M.P is the L.T.M.P of FOO
@KrisShannon
KrisShannon / LTM-Hell.pm
Created January 11, 2012 04:44
LTM Backtracking Hell
grammar LTM-Hell {
rule TOP { [ <a> | <b> ] }
token a { [ xxxxx { fail } | xxx {} xx ] }
token b { [ xxxx {} x ] }
}
@KrisShannon
KrisShannon / summary.txt
Created January 9, 2012 20:54 — forked from moritz/summary.txt
nqp qbootstrap test summary with recursive proto hack - https://github.com/KrisShannon/nqp/tree/qbootstrap-proto-hack
Test Summary Report
-------------------
t/nqp/34-rxcodeblock.t (Wstat: 256 Tests: 2 Failed: 0)
Non-zero exit status: 1
Parse errors: Bad plan. You planned 12 tests but ran 2.
t/nqp/38-quotes.t (Wstat: 0 Tests: 7 Failed: 3)
Failed tests: 5-7
t/nqp/39-pointy.t (Wstat: 256 Tests: 17 Failed: 13)
Failed tests: 5-17
Non-zero exit status: 1
@KrisShannon
KrisShannon / ramble.md
Created January 5, 2012 12:38 — forked from masak/ramble.md
I'm thinking about macros again

Macros and closures are a bit alike. Here's I'll try to nail down one of their differences.

Closures

A closure is a function which carries with it a lexical environment. The returned block below, for example, carries around the lexical environment containing the variable $counter:

sub create-counter(Int $start-value) {
    my Int $counter = $start-value;
    return { $counter++ };

}

constant @primes = 2, 3, -> $n is copy { repeat { $n += 2 } until $n %% none @primes ... * > sqrt $n; $n; } ... *;
multi factors(1) { 1 }
multi factors(Int $remainder is copy) {
gather for @primes -> $factor {
if $factor * $factor > $remainder {
take $remainder if $remainder > 1;
last;
}
@KrisShannon
KrisShannon / gist:1552773
Created January 3, 2012 00:20 — forked from softmoth/gist:1552700
submethod BUILD()
#! /usr/bin/env perl6
class Vocab {
has Str $.word;
has Str @.synonyms = [];
my %words;
submethod BUILD(:$!word, :@!synonyms, *@pos, *%nam) {
note "Vocab BUILD(): ", @pos.perl, %nam.perl;