Skip to content

Instantly share code, notes, and snippets.

View AlexDaniel's full-sized avatar

Aleks-Daniel Jakimenko-Aleksejev AlexDaniel

  • Tallinn, Estonia
View GitHub Profile
@AlexDaniel
AlexDaniel / gist:103ac74c97d56d8c5f12
Created August 18, 2014 19:20
readelf -s "$(dpkg -L libxkbcommon0 | grep -m 1 libxkbcommon.so.0)"
Symbol table '.dynsym' contains 143 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 FUNC GLOBAL DEFAULT UND __snprintf_chk@GLIBC_2.3.4 (2)
2: 00000000 0 FUNC GLOBAL DEFAULT UND strcmp@GLIBC_2.0 (3)
3: 00000000 0 FUNC GLOBAL DEFAULT UND __vfprintf_chk@GLIBC_2.3.4 (2)
4: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTab
5: 00000000 0 FUNC GLOBAL DEFAULT UND secure_getenv@GLIBC_2.17 (4)
6: 00000000 0 OBJECT GLOBAL DEFAULT UND stderr@GLIBC_2.0 (3)
@AlexDaniel
AlexDaniel / gist:d8c7333f181b41cc64a6
Created June 28, 2015 06:51
perl6 problem full output
$ time ./asc-to-svg pins.ASC B
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
#!/usr/bin/env perl6
8
< 1 >
0 < 1 > 1
< 1 < 2 > 3 >
6 < 4 < 1 > 1 > 1
< 1 < 1 < 1 > 6 > 1 >
1 > 1
< 1 >
1 < 1
@AlexDaniel
AlexDaniel / qqx
Created October 3, 2015 11:08
Perl6 qqx usage
Audio-Encode-LameMP3/t/030-encode.t- ok($buf.elems > 0, "and there are some elements");
Audio-Encode-LameMP3/t/030-encode.t- $out-fh.write($buf);
Audio-Encode-LameMP3/t/030-encode.t- $out-fh.close;
Audio-Encode-LameMP3/t/030-encode.t-
Audio-Encode-LameMP3/t/030-encode.t- if ( "/usr/bin/file".IO.x ) {
Audio-Encode-LameMP3/t/030-encode.t: like qqx/file $out-file }/, rx/MPEG/, "and it's a MP3 file";
--
Audio-Encode-LameMP3/t/030-encode.t- ok($buf.elems > 0, "and there are some elements");
Audio-Encode-LameMP3/t/030-encode.t- $out-fh.write($buf);
Audio-Encode-LameMP3/t/030-encode.t- $out-fh.close;
@AlexDaniel
AlexDaniel / save-me-from-texas.creole
Last active March 14, 2017 01:01
Save me from Texas

⚠⚠⚠⚠⚠⚠⚠ ↓↓↓ PAGE MOVED ↓↓↓ ⚠⚠⚠⚠⚠⚠⚠

I moved this page to rakudo wiki. A lot of people wanted to add stuff, but gists are not editable. A wiki is a more appropriate place for this kind of stuff. Rakudo wiki is possibly not the best place for it, but for now that will do.

Plus, GitHub gists totally suck when unicode characters are involved. There's also no preview option here. So I'm glad that it is being moved.

⚠⚠⚠⚠⚠⚠⚠ ↑↑↑ PAGE MOVED ↑↑↑ ⚠⚠⚠⚠⚠⚠⚠

Recently Perl 6 got support for various unicode characters (½ ¹ ∞ × ÷, see this link for a full list), but I don't think that we are done. Here is a list of things to think about.

à̴̵̶̷̸̡̢̧̨̛̖̗̘̙̜̝̞̟̠̣̤̥̦̩̪̫̬̭̮̯̰̱̲̳̹̺̻̼͇͈͉͍͎́̂̃̄̅̆̇̈̉̊̋̌̍̎̏̐̑̒̓̔̽̾̿̀͂͆͊͋͌̕̚ͅ͏͓͔͕͖͙͚͐͑͒͗͛ͣͤͥͦͧͨͩͪͫͬͭͮͯ҃҄҅҆҇͘͜͟͢͝͞͠͡҈҉߲߫߬߭߮߯߰߱߳ఀ᩿᪵᪶᪷᪸᪹᪺᪽፝፞፟᪰᪱᪲᪳᪴᪻᪼᪾⃒⃓⃘⃙⃚᷐᷎᭬᷂᷊᷏᷽᷿᭫᭭᭮᭯᭰᭱᭲᭳᷀᷁᷃᷄᷅᷆᷇᷈᷉᷋᷌᷑᷒ᷓᷔᷕᷖᷗᷘᷙᷚᷛᷜᷝᷞᷟᷠᷡᷢᷣᷤᷥᷦᷧᷨᷩᷪᷫᷬᷭᷮᷯᷰᷱᷲᷳᷴ᷵᷾⃐⃑⃔⃕⃖⃗⃛⃜᷼᷍⃝⃞⃟⃠⃡⃢⃣⃤⃥⃦⃪⃫゙゚⃨⃬⃭⃮⃯⃧⃩⃰⳯⳰⳱ⷠⷡⷢⷣⷤⷥⷦⷧⷨⷩⷪⷫⷬⷭⷮⷯⷰⷱⷲⷳⷴⷵⷶⷷⷸⷹⷺⷻⷼⷽⷾⷿ꙯꙰꙱꙲︧︨︩︪︫︬︭𐇽ꙴꙵꙶꙷꙸꙹꙺꙻ꙼꙽ꚞꚟ꛰꛱꣠꣡꣢꣣꣤꣥꣦꣧꣨꣩꣪꣫꣬꣭꣮꣯꣰꣱︠︡︢︣︤︥︦︮︯𐍶𐍷𐍸𐍹𐍺𑌀𖫰𖫱𖫲𖫳𖫴𝅧𝅨𝅩𝅥𝅦𝅮𝅯𝅰𝅱𝅲𝅻𝅼𝅽𝅾𝅿𝆀𝆁𝆂𝆊𝆋𞣐𞣑𞣒𞣓𞣔𞣕𞣖𝅭𑍦𑍧𑍨𑍩𑍪𑍫𑍬𑍰𑍱𑍲𑍳𑍴𝆅𝆆𝆇𝆈𝆉𝆪𝆫𝆬𝆭𝉂𝉃𝉄
@AlexDaniel
AlexDaniel / keybase.md
Last active August 19, 2016 15:18
keybase.md

Keybase proof

I hereby claim:

  • I am AlexDaniel on github.
  • I am alexdaniel (https://keybase.io/alexdaniel) on keybase.
  • I have a public key whose fingerprint is E1A5 75CC C2D5 8C7A A560 9FE1 4710 D9D4 34A4 A3C6

To claim this, I am signing this object:

@AlexDaniel
AlexDaniel / false-christmas-tree.p6
Last active January 29, 2016 13:13
False Christmas Tree
#!/usr/bin/env perl6
say
𑁣
< 𐌡 >
𐅵 < ⅴ > 𑁪
< 𐅵 < ໑ > ໐ >
𐅵 < ౸ < ⅴ > 𑁧 > 𑁪
< 𐅵 < 𐅵 < ⅴ > ᧚ > 𑁧 >
𐧁 > 𐧁
< 𐧁 >
@AlexDaniel
AlexDaniel / splits.md
Last active February 17, 2016 16:52
Array splits

Is there a cute Perl 6 way to take an array (say ‘a’..‘d’) and get all head/tail partitions of it (e.g. (<a>, <b c d>), (<a b>, <c d>), (<a b c>, <d>))?

Sure! Pick one:

my @a = a..e; say (@a[^$_, $_..*] for 1..^@a);
my @b = a..e; say (1..^@b).map: {@b[^$_, $_..*]};
my @c = a..e; say (@c.rotor($_, ∞, :partial) for 1..^@c);
my @z = a..e; say @z[0..*-2].keys.map: {@z[0..$_, $_^..*]}; # same as b
my @d = a..e; say (1..^@d).map: {@d.rotor: $_, ∞, :partial};
my class a {
has @.b;
method get-flat { @!b.map(|*.get-flat); }
method p {
say 'A: ', WHAT $.get-flat;
# why doesn't this loop act like D: below?
for self.get-flat() -> $c {
say 'B: ', $c.perl
}
}