Skip to content

Instantly share code, notes, and snippets.

View frederik-elwert's full-sized avatar

Frederik Elwert frederik-elwert

View GitHub Profile
@frederik-elwert
frederik-elwert / add_music.py
Created March 12, 2021 19:51
Script for converting music or audio books into the format and directory structure required by TonUINO
#!/usr/bin/env python3
import sys
import argparse
import logging
import shutil
import subprocess
from pathlib import Path
MAX_DIRS = 99
@frederik-elwert
frederik-elwert / degender.lua
Created September 19, 2022 11:23
Simple lua filter to replace intra-word colons as a degender symbol with * or a configurable marker (like _)
--- Replace intra-word colons with gender star or gap
--
-- Copyright 2022 Frederik Elwert <[email protected]>
--
-- LICENSE
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to
-- deal in the Software without restriction, including without limitation the
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
#!/usr/bin/env python3
import sys
import argparse
import logging
import datetime
import csv
from pathlib import Path
from holidays.countries.germany import Germany
function Div(el)
if (el.attributes.lang == "zh") then
return {pandoc.RawBlock("latex", "\\begin{otherlanguage}{chinese}"),
el,
pandoc.RawBlock("latex", "\\end{otherlanguage}")}
end
end
function Span(el)
if (el.attributes.lang == "zh") then
@frederik-elwert
frederik-elwert / pandoc_converter.py
Created November 5, 2024 16:53
Nautilus extension to allow for converting Markdown files via pandoc. Copy to ~/.local/share/nautilus-python/extensions/
#!/usr/bin/env python3
import os
import re
import subprocess
from multiprocessing import Process
from pathlib import Path
from typing import Dict, List, Optional
from urllib.parse import unquote