Skip to content

Instantly share code, notes, and snippets.

View alerque's full-sized avatar
🩺
Coding as best I can in between dealing with my daughter's medical issues.

Caleb Maclennan alerque

🩺
Coding as best I can in between dealing with my daughter's medical issues.
View GitHub Profile
@tarleb
tarleb / list-formats.lua
Last active April 26, 2024 14:55
list-formats.lua
--- Lists the formats that support all the extensions given on the command line.
--
-- Usage:
--
-- pandoc lua list-formats.lua [extensions,...]
--
-- Example:
--
-- $ pandoc lua list-formats.lua native_numbering citations
-- docx
@nathanlesage
nathanlesage / export_comments.lua
Created June 11, 2022 13:43
A Pandoc filter for exporting HTML comments
-- Default: Don't export comments
local comments = nil
function Meta (meta)
-- If there is a "comments" field in the YAML frontmatter, extract this
if meta.comments then
comments = pandoc.utils.stringify(meta.comments)
end
return meta
end
@simonmichael
simonmichael / paypaljson
Created June 22, 2021 21:21
updated scripts for downloading paypal transactions for hledger
#!/bin/bash
# Download recent transaction history from Paypal as JSON,
# and print on stdout.
#
# Requirements: a Paypal developer account, curl, jq (just for pretty-printing)
#
# brew install jq
#
# Limitations:
# - sees only the last 30 days of history
@tzok
tzok / 1-out.md
Last active November 25, 2020 12:44
How to use pantable using Docker

1 2 3


A B C


from tensorfont.dataset import prepare_training_data
from tensorfont.generators import RandomPair
prepare_training_data()
def kern_generator():
rpg = RandomPair(196, 196, 76, "training")
gen = rpg.generator()
while True:
font, left, right = next(gen)
img1, perturbation = rpg.get_image(font, left, right, perturbation_range= [-100,100])
@justvanrossum
justvanrossum / generateOTTagsModule.py
Last active August 20, 2020 08:50
Scrape OT tag definitions and descriptions from OT spec site (script, language and feature tags)
import os
import re
def parse(data):
start = data.find("<tbody>")
end = data.find("</tbody>")
data = data[start+7:end]
for chunk in re.findall(r"<tr>.+?</tr>", data, re.DOTALL):
fields = re.findall(r"<td>(.+?)</td>", chunk, re.DOTALL)
@noamross
noamross / criticmarkup.lua
Last active August 30, 2023 12:08
A pandoc filter for MS Word track changes to criticmarkup
-- a lua filter for panodoc
-- run pandoc your_word_doc.docx --track-change=all -t markdown --lua-filter=criticmarkup.lua
-- TODO: Detect substitutions in adjacent insertion/deletions
-- TODO: capture whole comment hightlight rather than just start point of comment
function Span(elem)
if elem.classes[1] and elem.classes[1] == "insertion" then
local opener = { pandoc.RawInline(FORMAT, "{++ ") }
local closer = { pandoc.RawInline(FORMAT, " ++}") }
return opener .. elem.content .. closer
elseif
@simoncozens
simoncozens / kerningpairs.txt
Created November 9, 2015 10:36
All lower case kerning pairs - shortest text found from dictionaries using a dumb random search
jw Shahjahanpur supercalifragilisticexpialidocious acquaintanceship
dichlorodifluoromethane insightfulnesses jl Erzgebirge vx kx Overijssel
solemnifying roofgarden boxberries fq substratosphere bxs Gewurztraminer
disconnectedly jg Thanksgivings bugbears Allhallowmas labdanums pq adjt
chymotrypsin sleepwalked kibitka awlworts unobjectionable sheqel
magnetohydrodynamics anthropomorphize goldfields Chappaquiddick Moskva clxii
misjudgment tx Panmunjom px earthquake outperform mx Netzahualcoyotl Skopje
bandwidths clavicytherium clampdown zx convolvulaceous honeysuckle qf fz
Gelbvieh succinylsulfathiazole sixfold bogtrotter subcultural pkwy eurhythmy
Ecbatana qx jimjams cml crowfeet prajna Flaxman Kafkaesque weekday Reykjavik
@mpickering
mpickering / gist:f1718fcdc4c56273ed52
Created December 7, 2014 00:53
LaTeX Argument Parser
{-# LANGUAGE ViewPatterns #-}
module InTex where
import Text.Pandoc.JSON
import Text.Pandoc
import Data.List
main :: IO ()
main = toJSONFilter readFootnotes
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.