Skip to content

Instantly share code, notes, and snippets.

View jleedev's full-sized avatar
🧙‍♀️

Josh Lee jleedev

🧙‍♀️
  • Pittsburgh
View GitHub Profile
from collections.abc import Buffer
import io
import os
from pathlib import Path
import subprocess
import textwrap
import numpy as np
import pandas as pd
import polars as pl
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jleedev
jleedev / sdf.py
Last active August 23, 2024 15:26
sdf font preview
import io
from pathlib import Path
import sys
import unicodedata
from google.protobuf.message_factory import GetMessages
from google.protobuf.descriptor_pb2 import FileDescriptorSet
glyphs_pb = b'\n\xe3\x02\n\x0cglyphs.proto\x12\x0bllmr.glyphs"\x9d\x01\n\x05glyph\x12\x0e\n\x02id\x18\x01 \x02(\rR\x02id\x12\x16\n\x06bitmap\x18\x02 \x01(\x0cR\x06bitmap\x12\x14\n\x05width\x18\x03 \x02(\rR\x05width\x12\x16\n\x06height\x18\x04 \x02(\rR\x06height\x12\x12\n\x04left\x18\x05 \x02(\x11R\x04left\x12\x10\n\x03top\x18\x06 \x02(\x11R\x03top\x12\x18\n\x07advance\x18\x07 \x02(\rR\x07advance"a\n\tfontstack\x12\x12\n\x04name\x18\x01 \x02(\tR\x04name\x12\x14\n\x05range\x18\x02 \x02(\tR\x05range\x12*\n\x06glyphs\x18\x03 \x03(\x0b2\x12.llmr.glyphs.glyphR\x06glyphs"?\n\x06glyphs\x12.\n\x06stacks\x18\x01 \x03(\x0b2\x16.llmr.glyphs.fontstackR\x06stacks*\x05\x08\x10\x10\x80@B\x02H\x03'
import collections
import itertools
# Before you can call send, you have to call next to drive it to the first
# yield point. What if it never yields? Then the first call to next will raise
# StopIteration on it.
def parse_message():
print('parse_message')
ret = []
@jleedev
jleedev / input
Created July 14, 2022 18:37
Interstate ref mismatch
[out:json];
rel[type=route][route=road][network="US:I"][ref];
way(r)[ref!~"^I "];
rel(bw)[type=route][route=road][network="US:I"][ref];
out tags;
package main
import (
"crypto/tls"
"fmt"
"io"
"log"
"net/http"
"sync"
"time"
number of times every unique US:* network is seen
number of times every unique token is seen after splitting on colons