Skip to content

Instantly share code, notes, and snippets.

@oxplot
oxplot / svglinkify.md
Last active November 25, 2022 11:27
Add hyperlinks to PDFs created by Inkscape
@xiaopc
xiaopc / draw_table.py
Last active April 29, 2024 08:27
Draw a table using only Pillow
from PIL import Image, ImageFont, ImageDraw
from collections import namedtuple
def position_tuple(*args):
Position = namedtuple('Position', ['top', 'right', 'bottom', 'left'])
if len(args) == 0:
return Position(0, 0, 0, 0)
elif len(args) == 1:
return Position(args[0], args[0], args[0], args[0])