Skip to content

Instantly share code, notes, and snippets.

View tadzik's full-sized avatar
🐴

Tadeusz Sośnierz tadzik

🐴
View GitHub Profile
@tadzik
tadzik / 1.md
Last active March 15, 2019 12:43

1

Zwykliśmy się zastanawiać, co jest straszniejsze: świadomość, że nie jesteśmy sami we wszechświecie, czy też idea mówiąca, że jesteśmy. Osobiście dodałbym do tego zestawu trzecią opcję: co jeśli umrzemy nie poznając odpowiedzi?

Jasnoczerwone światło. Ten charakterystyczny szum, gdy zdaję się słyszeć całą „maszynerię” wewnątrz swojego organizmu. Dopiero później docierają do mnie dźwięki otoczenia, charakterystyczne piski i buczenie urządzeń medycznych. Ostrożnie otwieram oczy.

#!/usr/bin/env perl6
use lib 'lib';
use Module::Toolkit;
my $mt = Module::Toolkit.new;
multi MAIN('is-installed', $what) {
say $mt.is-installed: $what;
}
class A {
#| foo bar baz dupa
method b {
}
}
A.^find_method('b')[0].WHY.say
┌─[tadzik@yavin]─[~]
└─[%]─> cat json-bug.pl
my $json = '{"foo":[]}';
my ($tiny, $fast);
{
use JSON::Tiny;
$tiny = from-json $json;
}
{
use JSON::Fast;
weechat::register("think", "tjs", "0.1", "GPL3", ".o O ( think )", "", "");
weechat::hook_command("think", "Think", "", "", "", "think", "");
sub think {
my (undef, $buffer, @args) = @_;
weechat::command($buffer, ". o O ( " . $args[0] . " )", $channel);
return weechat::WEECHAT_RC_OK;
}
┌─[tadzik@ubuntu]─[~]
└─[%]─> npm install typescript
npm http GET https://registry.npmjs.org/typescript
npm http 304 https://registry.npmjs.org/typescript
typescript@1.5.3 node_modules/typescript
┌─[tadzik@ubuntu]─[~]
└─[%]─> cd node_modules/typescript/bin
┌─[tadzik@ubuntu]─[~/node_modules/typescript/bin]
└─[%]─> cat tsc
#!/usr/bin/env node
┌─[tadzik@dagobah]─[~]
└─[%]─> cat test.pl
use 5.018;
my @closures;
for my $i (1..10) {
push @closures, sub { say "I'm sub number $i" }
}
> panda install Inline::Perl5
==> Fetching Inline::Perl5
==> Building Inline::Perl5
gcc -Wall p5helper.c `perl -MExtUtils::Embed -e ccopts -e ldopts` -shared -o /home/tadzik/src/github.com/perl6-community-modules/uri/.panda-work/1431180714_1/blib/lib/Inline/p5helper.so -fPIC -g
/usr/bin/ld: /home/tadzik/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC
/home/tadzik/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux/CORE/libperl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:6: recipe for target '/home/tadzik/src/github.com/perl6-community-modules/uri/.panda-work/1431180714_1/blib/lib/Inline/p5helper.so' failed
make: *** [/home/tadzik/src/github.com/perl6-community-modules/uri/.panda-work/1431180714_1/blib/lib/Inline/p5helper.so] Error 1
Compiling lib/Inline/Perl5.pm6 to mbc
gcc -Wall p5helper.c `perl -MExtUtils::Embed -e ccopts -e ldopts` -shared -o /home/tadzik/src/github.com/perl6-community-modules/uri/.panda-work/1431179775_2/blib/lib/Inline/p5helper.so -fPIC -g
/usr/bin/ld: /home/tadzik/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC
/home/tadzik/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux/CORE/libperl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:6: recipe for target '/home/tadzik/src/github.com/perl6-community-modules/uri/.panda-work/1431179775_2/blib/lib/Inline/p5helper.so' failed
make: *** [/home/tadzik/src/github.com/perl6-community-modules/uri/.panda-work/1431179775_2/blib/lib/Inline/p5helper.so] Error 1
Compiling lib/Inline/Perl5.pm6 to mbc
==> Testing Inline::Perl5
===SORRY!===
unable to find Inline/p5helper.so IN @*INC
grammar Foo {
token TOP { <bottom> }
token bottom { <?> }
}
class Foo::Actions {
method TOP($/) {
my $grmr := Metamodel::GrammarHOW.new_type(name => 'BNFGrammar');
$grmr.^add_method('TOP', token { <foo> });
$grmr.^add_method('foo', $<bottom>.ast[0]);