Skip to content

Instantly share code, notes, and snippets.

View j6s's full-sized avatar
✉️
hello@j6s.dev

Johannes Hertenstein j6s

✉️
hello@j6s.dev
View GitHub Profile
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

Multiple sys_category fields in one table

When your table has more than 1 field with relations to sys_category you will run into problems because the MM relation table sys_category_record_mm will only store which table a category belongs to - but not the specific field.

You need to extend sys_category_record_mm like this:

Add the following to your extension's ext_tables.sql:

CREATE TABLE sys_category_record_mm (
@lovasoa
lovasoa / README.md
Last active June 30, 2021 16:23
ODT to HTML conversion

#Ophir.php

Important note

This code is not up to date. It is now hosted at https://github.com/lovasoa/ophir.php

PHP script that converts ODT to HTML

ophir.php is a lightweight script that parses an open document file and outputs a simple HTML file, with very few tags (contrarily to most other tools that do the same).

Features

Currently, the script parses bold (b tag), italic (i tag), underline (u tag), quotations (blockquote tag), images (using data URIs), links, headings (h1, h2, ...), lists (ul and li), tables (table tr and td) annotations and footnotes.