Skip to content

Instantly share code, notes, and snippets.

@ojkelly
ojkelly / init.lua
Last active March 30, 2021 04:57
My hammerspoon config
local usbWatcher = nil
-- This is our usbWatcher function
-- lock when yubikey is removed
function usbDeviceCallback(data)
-- this line will let you know the name of each usb device you connect, useful for the string match below
hs.notify.show("USB", "You just connected", data["productName"])
-- Replace "Yubikey" with the name of the usb device you want to use.
if string.match(data["productName"], "Yubikey") then
if (data["eventType"] == "added") then
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
from fontTools.pens.basePen import BasePen
def pointOnCurve(p1, c1, c2, p2, value):
dx = p1[0]
cx = (c1[0] - dx) * 3.0
bx = (c2[0] - c1[0]) * 3.0 - cx
ax = p2[0] - dx - cx - bx
dy = p1[1]
cy = (c1[1] - dy) * 3.0
import time, random
g = CurrentGlyph()
if g is not None:
path = g.naked().getRepresentation("defconAppKit.NSBezierPath")
xMin, yMin, xMax, yMax = g.box
xMin = int(round(xMin))
yMin = int(round(yMin))
xMax= int(round(xMax))
yMax = int(round(yMax))
@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@sloria
sloria / bobp-python.md
Last active April 29, 2024 17:14
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens