This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.014; | |
use warnings; | |
use LWP::UserAgent; | |
use JSON 'decode_json'; | |
# Simple script to get MetaCPAN users that use Hacker News (http://news.ycombinator.com/) | |
my $ua = LWP::UserAgent->new; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MooseBase; | |
use Moose; | |
use Class::MOP; | |
# One Base Class to Rule Them All! | |
# | |
# see: https://www.destroyallsoftware.com/blog/2011/one-base-class-to-rule-them-all | |
# https://github.com/garybernhardt/base/blob/master/lib/base.rb | |
# http://news.ycombinator.com/item?id=2963525 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env io | |
# see - http://news.ycombinator.com/item?id=1626018 | |
Hash := Object clone do ( | |
with := method ( | |
hash := Map clone | |
call message arguments foreach (arg, | |
# arg = k(v) for eg. t(0) | |
k := arg name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env io | |
# see : http://news.ycombinator.com/item?id=2144880 | |
executeInReverse := method ( | |
m := call argAt(0) | |
stmts := list() // list of statements (ie. messages) | |
loop ( | |
rest := m next // rest of messages after current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env io | |
# see: http://news.ycombinator.com/item?id=2610243 | |
# http://news.ycombinator.com/item?id=2612686 | |
doFile("x_load_me.io") | |
# 1 | |
1 to(10) map(*2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Charging Objects in Io | |
# | |
# See "Charging Objects in Ruby" | |
# - http://timeless.judofyr.net/charging-objects-in-ruby | |
# - http://news.ycombinator.com/item?id=2022107 | |
Rules := Object clone do ( | |
rules := list() | |
+ := method (obj, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.012; | |
use warnings; | |
use autobox::Core; | |
use Continuity; | |
Continuity->new( port => 9292 )->loop; | |
sub main { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.012; | |
use warnings; | |
use autobox::Core; | |
my $expose = []; # expose an Array object (singleton) | |
my $app = sub { | |
my ($func, @attrs) = $_[0]->{PATH_INFO}->split('/')->tail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env io | |
Object webapp := method ( | |
block (reqMsg, | |
p := reqMsg split("/") | |
self doMessage(p first asMessage setArguments( p rest map(asMessage) )) | |
) | |
) | |
doRelativeFile("webserver.io") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.012; | |
use warnings; | |
use Net::GitHub::V2::Repositories; | |
my $github = Net::GitHub::V2::Repositories->new( | |
owner => 'mirrors', repo => 'perl', | |
); |