Skip to content

Instantly share code, notes, and snippets.

View tadzik's full-sized avatar
🐴

Tadeusz Sośnierz tadzik

🐴
View GitHub Profile
$ ls
bar bug.pl foo
$ cat bug.pl
'foo'.path.copy('bar');
$ rakudobrew current
Currently running parrot-HEAD
$ perl6 bug.pl
$ rakudobrew switch jvm-HEAD
Switching to jvm-HEAD
$ perl6 bug.pl
┌─[tjs@feather]─[~]
└─[%]─> php
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mhash.ini on line 1 in Unknown on line 0
Cannot load Zend Extension Manager - it was built with configuration 1.2.0, whereas running engine is API220100525,NTS
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/mhash.so' - /usr/lib/php5/20100525+lfs/mhash.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/suhosin.so' - /usr/lib/php5/20100525+lfs/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
<?php
echo"foo"
?>
foo% ┌─[tjs@feather]─[~]
@tadzik
tadzik / gist:6474908
Created September 7, 2013 11:44
Rakudo/jvm panda blocker
sub indir (Str $where, Callable $what) {
my $old = cwd;
LEAVE chdir $old;
chdir $where;
$what()
}
sub batman {
indir 'foo', {
fail "NO";
$ ./perl6 -e 'my Buf $content = Buf.new(); say "alive"'
alive
$ ./perl6 -e 'my Buf $content .= new(); say "alive"'
java.lang.NullPointerException
in method dispatch:<.=> at src/gen/CORE.setting:1140
@tadzik
tadzik / gist:6219412
Last active December 21, 2015 00:19
Proposal for new select()
# modelled after Go's select statement
# if something from selectors is ready, run it
# if more than one is ready, pick one at random
# if nothing is ready and there's a default, run the default
# otherwise, block on the non-ready tasks
#
# it'd be so much more elegant if we had tail recursion :]
use Test;
table here!
===========
first row with spaces bla bla
second row with spaces ble ble
third-and-last row with spaces
OZOOOZZZZZZZZZZZZZZZZZZ$$ZZZZZ$$$$$$$$$Z$I$$$$$$$$ZZ$$$$$$$$$$$$$7$$7$$$777I?++=
OOOZOZZZZZZZZZOOOZZZZZ$$$$$ZZZZZZZZZZZZ?77~?+~?+77I$ZZ$$$$$Z$$$$$7III??++++=====
OZOOOOZZ$$$$ZZZOZZZ$$$$$$$$$$$ZZZZZZ$I?+:,,,,,~~.:~,II?$$$77I??++++========++???
ZZZZZZZZ$$$$$ZZZZZZ$$$$77I+=~~=~~~,....... .. ...,~$ZZ8OZ$7?===+++++?II77$$$7
ZZZZZZZZZ$$$ZZZZZZ$$$?+,,,,...,,,.... ...........:=88NDNDDDZI??III77$$ZZZZZ7I
ZZZZZZZZZ$$$ZZZZZ$$+:,,......,,.... ........,,,,,,:~=$8NMNNN8$$$ZZZZZOOOO8O7I?
ZZZZZZZZZZ$$ZZZOI~.,... ..,:,:,.. ...,,,,,,,.,,,,,::::~+Z8DMMDDOZ888888888DZ7I??
ZZZZ$ZZZ$$$$$$?~,... ..::=+$$ZO+,.,,:,,::::,:,,,:::::~=+I7MMNNO888D88OOOO$I???I
ZZZZZZZ$$$Z$$?~,.. ...,~?IZODNNN87:::~~:::::::::::::::~~~=778O7IZZZZZZ$$$7I??I77
┌─[tadzik@yavin]─[~]
└─[%]─> cat bin/perl6
#!/bin/sh
CURRENT=`cat ~/.rakudobrew/CURRENT`
if [ $CURRENT = 'jvm' ]; then
~/.rakudobrew/run-jvm "$@"
elif [ $CURRENT = 'parrot' ]; then
~/.rakudobrew/run-parrot "$@"
┌─[tadzik@yavin]─[~]
└─[%]─> rakudobrew
Usage:
/home/tadzik/bin/rakudobrew current
/home/tadzik/bin/rakudobrew switch [jvm|parrot|moarvm]
┌─[tadzik@yavin]─[~]
└─[%]─> rakudobrew current
Currently running jvm
┌─[tadzik@yavin]─[~]
└─[%]─> cat test.sh
#!/bin/sh
echo "Argumenty wywołania: $*"
┌─[tadzik@yavin]─[~]
└─[%]─> bash test.sh -e 'say "Hello"'
Argumenty wywołania: -e say "Hello"