Skip to content

Instantly share code, notes, and snippets.

🐫
open source

E. Choroba choroba

🐫
open source
  • Prague, Czech Republic
Block or report user

Report or block choroba

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
@choroba
choroba / quote-region.el
Created Aug 29, 2018
Emacs lisp: quote region
View quote-region.el
(defun quote-region (from to char)
"Surround region in quotes or brackets"
(interactive "r\ncChar:")
(let ((to (+ to 1))
(chars (case char
(?\( (list "(" ")"))
(?\[ (list "[" "]"))
(?\{ (list "{" "}"))
(?\< (list "<" ">"))
(t (list char char)))))
View md5sum
#!/usr/bin/perl
use warnings;
use strict;
use feature qw{ say };
use Digest::MD5 qw{ md5_hex };
say 'Same' if md5_hex('240610708') == md5_hex('QNKCDZO');
say for md5_hex('240610708'), md5_hex('QNKCDZO');
@choroba
choroba / req
Last active Mar 26, 2018
required moose attributes
View req
#!/usr/bin/perl
use strict;
use feature qw{ say };
use warnings;
{ package My;
use Moose;
my $m = 1;
View sykora.pl
#!/usr/bin/perl
use warnings;
use strict;
use feature qw{ say };
my $coef = 0.75;
my %shape = (
1 => { z => { c => 'bbbw', s => '0001' },
b => { c => 'bbwb', s => '0010' },
View git-oldest
#!/usr/bin/perl
use warnings;
use strict;
use feature qw{ say };
use Time::Piece;
open my $GIT, '-|', qw{ git log --name-status --reverse };
my $date;
View hash as a poor man's switch
#!/usr/bin/perl
use warnings;
use strict;
use Carp qw{ confess };
use List::Util qw{ shuffle };
use Test::More tests => 5;
use Benchmark qw{ cmpthese };
my @ATTRS;
View .emacs
(tool-bar-mode 0)
(menu-bar-mode 0)
(setq inhibit-splash-screen t)
(setq text-mode-hook 'turn-on-auto-fill)
(auto-compression-mode t)
(setq next-line-add-newlines t)
(setq truncate-partial-width-windows nil)
@choroba
choroba / coverages
Last active Jan 31, 2016
Coverage::History
View coverages
#!/usr/bin/perl
use warnings;
use strict;
use feature qw{ say };
use HTML::TableExtract;
use Time::Piece;
use XML::XSH2;
sub shell {
View gist:8579226ae5b662013fae
#!/usr/bin/perl
use warnings;
use strict;
use Benchmark qw(cmpthese);
use Test::More;
my $String = "ATGC" x 1000;
my @Genes = qw(A T G C);
my %Count;
View gist:4be98adb9425bd40ba0d
#!/usr/bin/perl
use warnings;
use strict;
use Test::More tests => 3;
{ my @list;
sub init {
my %elem;
You can’t perform that action at this time.