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 perl6 | |
use v6; | |
grammar BioInfo::Parser::Tree::Newick { | |
rule TOP { | |
<tree>+ | |
} | |
rule tree { |
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 bash | |
blue='\033[34m' | |
cls='\033[0m' | |
echo -e "$blue"`date +[%H:%M:%S]`' Cloning fresh Rakudo repo'"$cls" | |
git clone https://github.com/rakudo/rakudo.git | |
echo -e "$blue"`date +[%H:%M:%S]`' Checking out Plano 2014.01 tagged release'"$cls" | |
cd rakudo | |
git checkout Plano |
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
my @list = ('P','P','G','A','P','T','A','T','T','A'); | |
for 1..4 -> $k { for 1,[email protected] -> $i { say "$i" } } |
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 Mojolicious::Lite; | |
get '/:n' => sub { | |
my $self = shift; | |
$self->render('index'); | |
}; | |
app->start; | |
__DATA__ |
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
Perl6 compiled with rakudobrew about ten minutes ago perl6 version 2014.04-96-g375404d built on MoarVM version 2014.04-29-ga109e8d | |
test.p6 is just: say "Hello"; | |
$ perl6 --target=mbc --output=test.moarvm test.p6 | |
Then | |
$ moar --libpath="/home/oates/.rakudobrew/moar-HEAD/install/languages/nqp/lib" --libpath="/home/oates/.rakudobrew/moar-HEAD/install/languages/perl6/lib" --libpath="/home/oates/.rakudobrew/moar-HEAD/install/languages/perl6/runtime" test.moarvm | |
Segmentation fault (core dumped) |
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 perl6 | |
use v6; | |
class Bio::Sequence { | |
has Str $.id = ""; | |
has Str $.comment = ""; | |
has Str $.sequence = ""; | |
} | |
class Bio::Sequence::Amino is Bio::Sequence { |
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
convert input.jpg -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 output.jpg |
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 warnings; | |
use strict; | |
use Data::Dumper; | |
sub sql { | |
my ($sql,%data) = @_; | |
my @parameters; | |
foreach my $placeholder ($sql =~ /:([a-zA-Z_]+)/g) { | |
if (ref $data{$placeholder} eq 'ARRAY') { |
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
#Take an arrayref of numbers or a delimited string and returns a list of start-end pairs for runs of values above a threshold | |
sub runencode { | |
my ($probs,%opts) = @_; | |
#Some default optional parameters | |
$opts{delimiter} //= ','; | |
$opts{threshold} //= 0.5; | |
$opts{cmp} //= sub {$_[0] >= $_[1]}; | |
#If a string was passed split it into values |
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
TOP | |
> | |
| record | |
> | |
| | id | |
> | |
| | * MATCH "hello" | |
> | |
| | comment | |
> |