Skip to content

Instantly share code, notes, and snippets.

@DaveMessina
DaveMessina / sample_bashrc_pfb2014
Created October 15, 2014 20:19
example bashrc, mostly to setup a user's perl environment
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Perl setup
export PERL_LOCAL_LIB_ROOT="$HOME/perl5";
export PERL_MB_OPT="--install_base $HOME/perl5";
@DaveMessina
DaveMessina / git-find-blob.pl
Created June 6, 2010 18:25
git-find-blob: pass a blob SHA1 and find commits which contain it
#!/usr/bin/perl
use 5.008;
use strict;
use Memoize;
# by Aristotle Pagaltzis <http://stackoverflow.com/users/9410/aristotle-pagaltzis>
# taken from thread http://stackoverflow.com/questions/223678/git-which-commit-has-this-blob
# on 6 june 2010
my $usage =
@DaveMessina
DaveMessina / memtest.pl
Created June 4, 2010 11:40
get memory size of a data structure
#!/usr/bin/perl
# $Id$
# created by Dave Messina on 2010-04-28
use Modern::Perl;
use Devel::Size qw(total_size);
my %hash;
say "Empty: ", total_size (\%hash), ' bytes';
@DaveMessina
DaveMessina / Autodownload the latest REBASE
Created June 3, 2010 18:10
Autodownload the latest REBASE
#!/usr/bin/perl
use Bio::Restriction::EnzymeCollection;
use Bio::Restriction::IO;
my $io = Bio::Restriction::IO->new('-format' => 'withrefm',
'-current' => 1);
my $rebase_collection = $io->read;
my $re = $rebase_collection->get_enzyme( 'EcoRI' );