Skip to content

Instantly share code, notes, and snippets.

View choroba's full-sized avatar
🐫
open source

E. Choroba choroba

🐫
open source
  • Prague, Czech Republic
View GitHub Profile
@choroba
choroba / git-rebase.sh
Created February 28, 2020 14:40
Git rebase with copy
#!/bin/bash
set -eu
tmp=$(mktemp -d)
cd "$tmp"
git init
git config user.email abc@example.com
echo file a > a.txt
echo file b > b.txt
@choroba
choroba / quote-region.el
Created August 29, 2018 21:59
Emacs lisp: quote region
(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)))))
#!/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 March 26, 2018 14:21
required moose attributes
#!/usr/bin/perl
use strict;
use feature qw{ say };
use warnings;
{ package My;
use Moose;
my $m = 1;
@choroba
choroba / sykora.pl
Last active February 23, 2018 23:48
Sýkora
#!/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' },
#!/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;
#!/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;
(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 January 31, 2016 22:23
Coverage::History
#!/usr/bin/perl
use warnings;
use strict;
use feature qw{ say };
use HTML::TableExtract;
use Time::Piece;
use XML::XSH2;
sub shell {
#!/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;