Skip to content

Instantly share code, notes, and snippets.

View kba's full-sized avatar

Konstantin Baierer kba

View GitHub Profile
@itod
itod / split_keyboards.md
Last active May 6, 2024 10:50
Every "split" mechanical keyboard currently being sold that I know of
@xero
xero / ascii.cheatsheet
Created January 31, 2015 07:47
box drawing cheat sheet for ascii art
╓─────[ box drawing cheat sheet ]
╙────────────────────────────────────── ─ ─
─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┌ ┍ ┎ ┏
┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛ ├ ┝ ┞ ┟
┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯
@Zehkul
Zehkul / Convert Script – README.md
Last active December 16, 2023 07:19
Script to quickly convert and crop videos from within mpv

#README:

This script for mpv intends to offer the fastest and simplest way to convert parts of a video—while you’re watching it and not really more work intensive than making a screenshot. A short demonstration: https://d.maxfile.ro/omdwzyhkoa.webm

##Installation:

You need:

  • yad (at least 0.26) (AUR)
@aelkiss
aelkiss / mets1to2.xsl
Last active September 11, 2023 20:37
Transformation from METS1 to METS2
moved to https://github.com/mets/METS1to2
@bertsky
bertsky / cudatest.sh
Last active June 10, 2023 23:51
OCR-D workflow for coverage tests, esp. CUDA support
set -e
# select first CUDA device (in case there are multiple, which may fail due to [a recent Tensorflow problem](https://github.com/qurator-spk/eynollah/issues/99))
export CUDA_VISIBLE_DEVICES=0
# check we are not running into [this bug](https://github.com/shapely/shapely/issues/1598)
python3 -c "from shapely.geometry import Polygon; import torch; torch.randn(10).cuda()"
# validate CUDA support is working in TF and Torch (not an exhaustive test)
python3 -c "import torch; print(torch.cuda.is_available())"
@b2m
b2m / Dockerfile
Last active March 25, 2022 10:27
Put browse-ocrd into a docker container
FROM python:3.7
RUN apt-get update \
&& apt-get install -y --no-install-recommends libcairo2-dev libgtk-3-bin libgtk-3-dev libglib2.0-dev libgtksourceview-3.0-dev libgirepository1.0-dev gir1.2-webkit2-4.0 pkg-config cmake \
&& pip3 install -U setuptools --use-feature=2020-resolver \
&& pip3 install browse-ocrd --use-feature=2020-resolver
ENV GDK_BACKEND broadway
ENV BROADWAY_DISPLAY :5
@jbarth-ubhd
jbarth-ubhd / abbyy2page.pl
Created January 14, 2022 12:46
minimalistic ABBYY XML to PAGE XML
#!/usr/bin/perl
use strict;
use utf8;
use XML::LibXML;
use XML::Quote;
binmode STDOUT, ":utf8";
my $dom=XML::LibXML->load_xml(location=>$ARGV[0]);
my $root=$dom->documentElement;
@cneud
cneud / pdf2tif.bat
Created August 22, 2018 16:29
PDF to TIF conversion for OCR on Windows (using imagemagick & ghostscript)
convert -density 300 -depth 8 -alpha Off -limit area 1 foo.pdf foo_%04d.tif
@mikegerber
mikegerber / jpageviewer-profile.sh
Last active July 13, 2021 15:18
jpageviewer alias/function that looks for a mets.xml, i.e. in a OCR-D workspace. For use in `~/.zshrc` or similiar.
_jpageviewer_jar=~/opt/jpageviewer/JPageViewer.jar
if [ -e "$_jpageviewer_jar" ]; then
jpageviewer() {
# --resolve-dir defaults to the file's directory
_jpageviewer_resolve_dir=`dirname "$1"`
# ... unless a mets.xml file exists one directory down (OCR-D workspace)
if [ -e "$_jpageviewer_resolve_dir"/../mets.xml ]; then
_jpageviewer_resolve_dir="$_jpageviewer_resolve_dir"/..
fi
import {default as fetch} from 'node-fetch';
const { pdf } = require("pdf-to-img");
import {tmpdir} from "os";
import {createWriteStream, createReadStream} from 'fs';
import * as fsp from 'fs/promises'
import * as archiver from 'archiver';
import {ArchiverError} from "archiver";
import * as path from "path";
import {Parser, Builder} from "xml2js";