Skip to content

Instantly share code, notes, and snippets.

View imkh's full-sized avatar

Mehdi Kharraz imkh

View GitHub Profile
@imkh
imkh / README.md
Last active July 29, 2021 19:33
Split all landscape images in a directory in half

split_landscape.sh

Find all landscape images in a directory (sub directories included) and split them in half from right to left. For the opposite direction, remove the magick -reverse option on line 32.

Requires imagemagick (brew install imagemagick on macOS).

$ cd [directory]
$ ./split_landscape.sh
@imkh
imkh / README.md
Created July 21, 2021 17:01 — forked from daniel-j/README.md
Converts images in a directory to a comic/manga EPUB3 ebook. Can be used to convert extracted CBZ/CBR to EPUB3.

images2epub.py

Converts a directory of images into a modern EPUB3 ebook. Use a tool to extract CBZ/CBR/CBT files and then run this program to generate a nice fixed-layout EPUB ebook of it. You can optionally set the reading direction to right-to-left (e.g. for manga). For Kobo ereaders, use the file extension .kepub.epub to get the modern reader and correct reading direction.

Usage

Install dependencies with pip install imagesize lxml

@imkh
imkh / refined-imkh
Last active March 28, 2018 14:52
Oh-My-Zsh custom theme & prompt
#!/usr/bin/env zsh
# Define prompts
#
PROMPT="%(?.%F{magenta}.%F{red})❯%f " # Display a red prompt char on failure
RPROMPT="%F{8}${SSH_TTY:+%n@%m}%f" # Display username if connected via SSH