A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
Google Chrome Developers says:
The new WOFF 2.0 Web Font compression format offers a 30% average gain over WOFF 1.0 (up to 50%+ in some cases). WOFF 2.0 is available since Chrome 36 and Opera 23.
Some examples of file size differences: WOFF vs. WOFF2
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)) |
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 |
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
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 |