Skip to content

Instantly share code, notes, and snippets.

@jkr
jkr / err_test.py
Last active November 15, 2016 15:22
import string
import random
import subprocess as sp
import re
def generate_thingy(x, y, z):
txt = ''.join(random.choice(string.ascii_lowercase) for i in range(x))
lab = ''.join(random.choice(string.ascii_lowercase) for i in range(y))
sep = ''.join(random.choice(string.ascii_lowercase + string.punctuation) for i in range(z))
return bytes("[%s]{.%s}%s _hi_" % (txt, lab,sep), encoding='utf-8')
13 6 3 ;_@ [wexitvlaphsmu]{.qtjuuh};_@ _hi_
20 12 4 }^!% [hzxvifvhewjocnklmfoy]{.mnckzybsvbjc}}^!% _hi_
8 1 3 ='_ [adjzfqon]{.g}='_ _hi_
21 15 2 }? [cavjraznbumxszdhdvhss]{.uolrmkulfygxdia}}? _hi_
10 12 4 ux\u [tvflhqxexq]{.vcybvletpwxj}ux\u _hi_
24 18 2 `] [mvqwmcsqdptbppyfyojvgcsg]{.uacrijjclumvrpehqi}`] _hi_
12 4 4 $[*= [igntoitqfinx]{.jzab}$[*= _hi_
18 12 2 ^] [wejapxayzkjmriqpmb]{.szqvgcefmdrv}^] _hi_
15 9 2 |' [oudjwguorqgilwu]{.jlouesmbm}|' _hi_
13 7 2 ). [jlhgopnjopcre]{.qfpynlo}). _hi_
@jkr
jkr / numerical-reference.hs
Created August 23, 2014 12:56
Numerical references to sections in pandoc. To be used with `--number-sections`
{-# LANGUAGE PatternGuards #-}
{- This filter allows for numerical section references. It should be
used with "--number-sections", since it uses a similar numbering
scheme. It works by using the link notation: given a header with a
given id, we can refer to that number by using a link with `#` in it:
My Header {#my-header-id}
=========
@jkr
jkr / dumbdowner.py
Created June 20, 2014 15:01
Convert smart markdown to dumb markdown
#!/usr/bin/env python3
import sys
if sys.version_info[0] != 3:
sys.exit("Must use python3")
replacements = {0x2013: '--',
0x2014: '---',
0x201c: '"',
0x201d: '"',