Skip to content

Instantly share code, notes, and snippets.

reneeb@perl-services:~/community$ perl -E ' open $wfh, ">", "large_file.txt"; say $wfh $_ for 0 .. 1_000_000; close $wfh; open my $fh, "<","large_file.txt"; my $line; for ( ;<$fh>; ) { $line = $. } say $.; <STDIN>'
1000001
=> 18083 reneeb 20 0 29924 3952 1972 S 0,0 0,1 0:00.50 perl
reneeb@perl-services:~/community$ perl -E ' open $wfh, ">", "large_file.txt"; say $wfh $_ for 0 .. 1_000_000; close $wfh; open my $fh, "<","large_file.txt"; my $line; for ( <$fh> ) { $line = $. } say $.; <STDIN>'
1000001
=> 18101 reneeb 20 0 174m 148m 1988 S 0,0 1,9 0:00.70 perl
my $seq = FastaSeq->new(id => 'A1');
$seq->seq('atcg');
#print Dumper $seq;
my $in = ReadFasta->new(infile => 't/test.fa');
my $s = $in->next_seq();
print ">", $s->id, " ", $s->descr, "\n";
print $s->seq, "\n";
my $in = ReadFasta->new(infile => 't/test.fa');
my $s = $in->next_seq();
print ">", $s->id, " ", $s->descr, "\n";
print $s->seq, "\n";
$in->next_line;
$s = $in->next_seq();
print ">", $s->id, " ", $s->descr, "\n";
73907c0 -> schreiben
#!/usr/bin/perl
use warnings;
use strict;
use Daemon::Control;
use Cwd qw(abs_path);
Daemon::Control->new(
{
name => "OTRS",
authordb@ubuntu:~$ perl community/memory_stats.pl
--- Memory Usage ---
start: 15380480
stop: 25378816 - delta: 9998336 - total: 9998336
--- Memory Usage ---
authordb@ubuntu:~$ cat community/memory_stats.pl
use Memory::Stats;
my $stats = Memory::Stats->new;
#!/usr/bin/env perl
use strict;
use warnings;
use Parallel::ForkManager;
use Mojo::UserAgent;
use Data::Dumper;
use Pye;
use strict;
use warnings;
use feature qw/signatures say/;
use Time::Piece;
use Mojo::UserAgent;
use HTML::TableExtract qw(tree);
my $time = localtime;
@reneeb
reneeb / gist:9291767
Created March 1, 2014 15:51
Pye logging
use strict;
use warnings;
use Parallel::ForkManager;
use Mojo::UserAgent;
use Data::Dumper;
use Pye;
my $pm = Parallel::ForkManager->new( 4 );
@reneeb
reneeb / gist:9293984
Created March 1, 2014 17:52
cucumber tiny
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
use Test::Cucumber::Tiny;
my $cuc = Test::Cucumber::Tiny->ScenariosFromYML( "test.yml" )
->Given(