Skip to content

Instantly share code, notes, and snippets.

View anthrotype's full-sized avatar
🤔
debating umlauts

Cosimo Lupo anthrotype

🤔
debating umlauts
  • London
View GitHub Profile
@Zamua
Zamua / apply-claude-code-2.0.76-lsp-fix.sh
Last active January 8, 2026 14:34
script to patch claude-code 2.0.76 to fix lsp plugin
#!/bin/bash
#
# Claude Code LSP Fix
# ====================
# Fixes the LSP plugin bug: https://github.com/anthropics/claude-code/issues/13952
#
# THE BUG:
# Claude Code's LSP manager has an empty initialize() function that should
# load and register LSP servers from plugins, but instead does nothing.
# This causes "No LSP server available for file type" errors.
@behdad
behdad / py
Created June 2, 2020 17:11
unionfind.py
from __future__ import print_function, division, absolute_import
#from fontTools.misc.py23 import *
class UnionFind(object):
def __init__(self, items):
self._sets = dict((x,set([x])) for x in items)
self._map = dict((x,x) for x in items)
def _union_pair(self, a, b):
import collections
import io
import itertools
import logging
import os
import sys
from pathlib import Path
from pprint import pprint
from typing import Dict, List, Tuple
@typemytype
typemytype / pathOpsDrawBotTest.py
Last active August 20, 2018 08:31
visual tests for pathops
import pathops
from booleanOperations.booleanOperationManager import BooleanOperationManager
import time
import math
print("pathops version:", pathops.__version__)
f = CurrentFont()
@typesupply
typesupply / speed.py
Last active June 14, 2018 17:30 — forked from typemytype/quick_ufoLibTest.py
Test for ufoLib validation and speed improvements.
"""
This compares the speed of experimental changes in ufoLib
with the experimental ufoLib in fontTools. This requires the
"Roboto-Regular.ufo" font to be located next to this script.
"""
import os
import shutil
import timeit
import cProfile
import sys
sys.path.insert(0, '/Users/frederik/Downloads/fonttools-ufoLib/Lib')
import os
import shutil
import ufoLib
from fontTools.pens.basePen import NullPen
@adrientetar
adrientetar / ufoLib.md
Last active December 26, 2019 14:13
Technical note on the design of a new UFO library.

Thoughts on fontTools.ufoLib

w.r.t. my experience with defcon and ufoLib. Some of the functionality I discuss (notifications, etc.) definitely shouldn't go into fontTools however we ought to make fontTools.ufoLib "compatible" with these extra features. I'm sure we can do simple and versatile.

IMO fontTools.ufoLib should basically be written from scratch (with copy-pasting here and there) since ufoLib/defcon have significant bloat and apparently we want to use lxml.

General comments

Avoid the check-and-use pattern

# Python3 port of http://algs4.cs.princeton.edu/code/edu/princeton/cs/algs4/UF.java.html
class DisjointSet:
"""
Execution: python disjoint_set.py < input.txt
Data files: http://algs4.cs.princeton.edu/15uf/tinyUF.txt
http://algs4.cs.princeton.edu/15uf/mediumUF.txt
http://algs4.cs.princeton.edu/15uf/largeUF.txt
Weighted quick-union by rank with path compression.
@ebraminio
ebraminio / pangocairodrawtext.ipynb
Last active June 23, 2018 09:12
PangoCairo Draw Text
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.