Skip to content

Instantly share code, notes, and snippets.

View labster's full-sized avatar

Brent Laabs labster

View GitHub Profile
@labster
labster / gist:5496330
Last active December 16, 2015 20:59
JAPH 1
use v6;
print $("reHTona tsuj".flip.tclc, Mu.^methods.grep(/p.**2l$/).tclc, "hacker\n");
my role IO::FileTestable { }
my class IO::Handle does IO::FileTestable { }
class IO is IO::Handle { ; }
my class IO::Path is Cool does IO::FileTestable {
#also does IO::FileTestable;
}
class Foo {
method baz ($a, $b?) {
if ! defined $b || $b eq '' {
$b = $*CWD;
}
say $a, $b;
}
}
@labster
labster / IO::Path proposal
Created March 28, 2013 22:08
new spec for IO::Path
=head2 IO::Path
class IO::Path is Cool does IO::FileTest { }
Holds a path of a file or directory. The path is generally divided
into three parts, the I<volume>, I<directory> and I<base name>.
On Windows, the volume is a drive letter like C<C:>, or a UNC network volume
like C<\\share\>. On UNIX-based systems, the volume part is empty.
@labster
labster / hashsub
Created March 4, 2013 00:28
syntax error with sub in the middle + hash access
my %bar;
sub foo {
1;
}
%bar<z> = 'quux';