This file contains hidden or 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 | |
| #Write sane perl | |
| use strict; | |
| use warnings; | |
| use feature 'say'; | |
| #Use some modules which are sufficiently round wheels | |
| use Text::CSV; | |
| use Getopt::Long; |
This file contains hidden or 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,1+$k...@list.end -> $i { say "$i" } } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
| > |
This file contains hidden or 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 QAST:from<NQP>; | |
| sub BioInfo::seq(Str $sequence) is export { | |
| use BioInfo::Parser::FASTA::Grammar; | |
| use BioInfo::Parser::FASTA::Actions; | |
| BioInfo::Parser::FASTA::Grammar.parse($sequence, actions => BioInfo::Parser::FASTA::Actions).ast; | |
| } | |
| sub EXPORT(|) { | |
| role BioInfo::Grammar { |
This file contains hidden or 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 strict; | |
| use feature 'say'; | |
| use Data::Dumper; | |
| use List::MoreUtils 'zip'; | |
| #Implement something similar to the Perl6 X meta operator | |
| #probably not the best implementation in the world | |
| sub X { |
OlderNewer