Skip to content

Instantly share code, notes, and snippets.

Heikki Lehvaslaiho heikkil

Block or report user

Report or block heikkil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
#!/usr/bin/env perl
# Turn consecutive non-empty lines of plain text into paragraphs
local $/ = "\n\n"; #paragraph separator
while (<>) {
# Replace newlines inside paragraphs by spaces and remove multiple spaces
heikkil /
Created Feb 7, 2014
Testing simple OOP approach to FASTA parsing
#!/usr/bin/env perl
package FastaSeq;
#use Mo qw'build default builder coerce is required';
use Mo;
has id => ();
has descr => ();
has seq => ();
heikkil / obogrep
Created Apr 21, 2014
grep for obo ontology files
View obogrep
#!/usr/bin/env perl
=head1 NAME
obogrep - grep obo entries with a string
B<obogrep> [B<--version> | [B<-?|-h|--help>] | [B<-g|--debug>] |
[B<-v|--invert-match>] | [B<-c|--count>] |query obofile
heikkil / user-rules.xml
Last active Aug 29, 2015
New Plain English rules for LanguageTool 2.7
View user-rules.xml
<category name="Redundant Phrases" type="style">
<!-- main source -->
<!-- some rules belonging to other categories included -->
<!-- xxx marks optional edge tokens that cause an error if uncommented -->
<rule id="ABUNDANCE" name="abundance">
View gist:d79445c345e55e3cc3b5
_c_enter _q_uote _e_macs-lisp _L_aTeX:
_l_atex _e_xample _p_erl _i_ndex:
_a_scii _v_erse _P_erl tangled _I_NCLUDE:
_s_rc ^ ^ plant_u_ml _H_TML:
_h_tml ^ ^ ^ ^ _A_SCII:
("e" (progn (hot-expand "<s") (insert "emacs-lisp") (forward-line)))
("p" (progn (hot-expand "<s") (insert "perl") (forward-line)))
heikkil / elfeed-link-and-note
Last active Nov 5, 2016
Elfeed configuration for emacs focusing on functions and bindings to copy and link to web pages
View elfeed-link-and-note
heikkil / counsel-yank-fish-history.el
Created Jan 29, 2016
Search fish history using ivy mode
View counsel-yank-fish-history.el
;; mod from
(require 'dash)
(defun counsel-yank-fish-history ()
"Yank the fish history"
(let (hist-cmd collection val)
(shell-command "history -r") ; reload history
(setq collection
(split-string (with-temp-buffer (insert-file-contents (file-truename "~/.config/fish/fish_history"))
heikkil /
Last active Feb 16, 2017
Action script for feh to create a copy of the current image
# ~/bin/
DIR=`dirname "$1"`
if [ ! -d $DIR/copied ]; then
mkdir $DIR/copied
cp "$1" $DIR/copied
heikkil /
Last active Feb 16, 2017
Action script for feh to remove the current image
# ~/bin/
DIR=`dirname "$1"`
if [ ! -d $DIR/removed ]; then
mkdir $DIR/removed
mv "$1" $DIR/removed
heikkil / orphan_raw
Created Feb 4, 2016
delete raw image files without matching jpgs in the same directory
View orphan_raw
#!/usr/bin/env perl
use Modern::Perl;
use File::Find;
use Getopt::Long;
use constant PROGRAMME_NAME => 'orphan_raw';
use constant VERSION => '0.2';
'v|version' => sub{ print PROGRAMME_NAME, ", version ", VERSION, "\n";
You can’t perform that action at this time.