Skip to content

Instantly share code, notes, and snippets.

View awwaiid's full-sized avatar

Brock Wilcox awwaiid

View GitHub Profile
ok 1 - Simple 1 works
ok 2 - Real simple 2 works
not ok 3 - We have prepended values!
# Failed test 'We have prepended values!'
# at roman-mark.pl line 35.
# got: 'IIII'
# expected: 'IV'
ok 4 - We have Vs
ok 5 - seventeen and stuff
not ok 6 - nineteen and stuff
awwaiid@misao:~/dcpm$ perl randori-2010301-roman.pl
shift on reference is experimental at randori-2010301-roman.pl line 25.
shift on reference is experimental at randori-2010301-roman.pl line 68.
ok 1 - Simple 1 works
ok 2 - Real simple 2 works
ok 3 - We have prepended values!
ok 4 - We have Vs
ok 5 - seventeen and stuff
ok 6 - nineteen and stuff
ok 7 - twenty and stuff
# namespace
class A::B {
# "Smiley" type adverb Str:D
# Named param -- adverb with default True value
method say-hi(Array[Str:D] :$names) {
# precedence dropper
say $names.map: {"hi $_"};
}
}
awwaiid@misao:~/projects/perl6/lang/Inline-Ruby$ cat hiya.csv
id, name
1, andy
2, bella
3, chad
4, dua
awwaiid@misao:~/projects/perl6/lang/Inline-Ruby$ PERL6LIB=lib perl6
> use Inline::Ruby::Sweet
> ruby_require 'csv', ['CSV']
Requiring ruby module csv
> use Inline::Ruby::Sweet;
> "require 'json'":rb
«true»:rb
> my $json = 'JSON.parse(File.read("/home/awwaiid/lag.json"))':rb ; 5
5
> $json.count
«36071»:rb
> $json[0]
«{"order_id"=>1173786, "marketplace_id"=>1, "order_placed"=>"2015-10-13T20:28:59-04:00", "order_created"=>"2015-10-13T20:28:59-04:00", "lag"=>0.382000207901001}»:rb
> $json[0]["marketpalce_id"]
$ ./universal-greetings.p6
Hello from the Perl Universe!!!
#!/usr/bin/perl
use strict;
use IO::Handle;
STDOUT->autoflush();
STDERR->autoflush();
print "1\n";
my $is_swapped = `xmodmap -pke | grep 'keycode 10 = exclam'`;
@awwaiid
awwaiid / 01 hive.rb
Last active December 24, 2015 06:09
Everyone adds a line, one at a time!
#!/usr/bin/env ruby
if ARGV == ['who', 'is', 'this?']
puts "THIS IS SPARTA!!!"
end
puts (words = File.read('/usr/share/dict/words')).length
good_words = words.split.select {|w| w.size > 6}
puts good_words.sample(3).join(' ')
Thread.new{ STDERR.<< ", \n A PLAY IN 3 PARTS.\n\n============ PAGE " }
puts good_words.length
puts File.read(__FILE__).split.detect{|_| _ =~ /SPARTA/}
@awwaiid
awwaiid / -
Created December 20, 2015 06:22
01:17 < TEttinger> m: say "␤" for ^10
01:17 <+camelia> rakudo-moar 091ee7:
01:17 -!- Irssi:
01:17 -!- Irssi:
01:17 -!- Irssi:
01:17 -!- Irssi:
01:17 -!- Irssi:
01:17 -!- Irssi:
01:17 -!- Irssi:
01:17 -!- Irssi: