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
use 5.016; | |
use warnings; | |
# See: http://news.ycombinator.com/item?id=5141179 | |
# | |
# This fasta.pl is a port of fasta.rb and is 2.6 times quicker than original alioth fasta.pl | |
use constant IM => 139968; | |
use constant IA => 3877; | |
use constant IC => 29573; |
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
use 5.016; | |
use warnings; | |
# Inspired by: http://news.ycombinator.com/item?id=5024754 | http://news.ycombinator.com/item?id=5025485 | |
# (port of) - https://gist.github.com/3755270 | |
package Bear { | |
sub new { | |
my ($class, $porridge, $chair, $bed) = @_; | |
bless { |
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
[~]$ date | |
Wed 30 May 2012 13:01:15 BST | |
[~]$ perlbrew install perl-5.16.0 | |
Fetching perl-5.16.0 as /Users/barry/perl5/perlbrew/dists/perl-5.16.0.tar.gz | |
Installing /Users/barry/perl5/perlbrew/build/perl-5.16.0 into ~/perl5/perlbrew/perls/perl-5.16.0 | |
This could take a while. You can run the following command on another shell to track the status: | |
tail -f ~/perl5/perlbrew/build.log |
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
# | |
# see http://perl.plover.com/idiocy/Addition.pm by MJD | |
# | |
use 5.014; | |
use warnings; | |
{ | |
package Compute; | |
use Carp; |
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 AnotherPerson; | |
use Moose; | |
use namespace::autoclean; | |
has _firstname => (is => 'rw', isa => 'Str', accessor => 'firstname'); | |
has _lastname => (is => 'rw', isa => 'Str', accessor => 'lastname' ); | |
} | |
my $you = AnotherPerson->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
arity := block ( | |
"You provided #{call argCount} args" interpolate println | |
call evalArgs foreach (arg, "... #{arg}" interpolate println) | |
) | |
// "call evalArgs" is a shortcut for "call message argsEvaluatedIn(call sender)" | |
var := "test" | |
arity call( "1", 2 + 2, var ); | |
arity call |
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=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=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 |