Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ktejnora on github.
  • I am karel82 (https://keybase.io/karel82) on keybase.
  • I have a public key ASCkD1G5R3JAYi2B1b53rfmPi3bL0eSs7dKYSKYPx2FGWwo

To claim this, I am signing this object:

@ktejnora
ktejnora / convert.zsh
Created June 12, 2017 08:19
Imagemagick batch remove left and right border from image
for img in *png; do \
mv ${img} ${img}.bak ; \
convert ${img}.bak \
-gravity west -background white -splice 5x0 -background black -splice 5x0 -trim +repage -gravity West -chop 5x0 \
-gravity east -background white -splice 5x0 -background black -splice 5x0 -trim +repage -gravity east -chop 5x0 ${img:r}.png ;
done
@ktejnora
ktejnora / List 2 Pairs
Created January 21, 2015 21:59
Java 8 Create list of pairs from List of items. Java does not have Pair and groupBy uses AtomicInteger trick.
package cz.tejnora.pokusy;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;