Skip to content

Instantly share code, notes, and snippets.

View jessestricker's full-sized avatar
:shipit:
do it

Jesse Stricker jessestricker

:shipit:
do it
  • 04:44 (UTC +02:00)
View GitHub Profile
@jessestricker
jessestricker / update_wallpaper.py
Created April 17, 2023 14:30
Update the GNOME desktop wallpaper with a random image from Unsplash.
#! /usr/bin/env python3
import argparse
import logging
import subprocess
from pathlib import Path
import dbus
import requests
@jessestricker
jessestricker / unicode-symbols.md
Last active January 3, 2024 14:50
A collection of the most useful Unicode symbols, which are not easily available on common keyboard layouts.

Unicode symbols

A collection of the most useful Unicode symbols, which are not easily available on common keyboard layouts.

Punctuation

Glyph Name USV
En Dash U+2013
@jessestricker
jessestricker / printers.py
Created July 14, 2023 07:14
printing tables and trees
from collections.abc import Callable, Collection, Iterable
from enum import Enum
from typing import TypeVar
class Alignment(Enum):
LEFT = "<"
CENTER = "^"
RIGHT = ">"
@jessestricker
jessestricker / README.md
Last active September 14, 2023 16:37
KaTeX support for rustdoc

KaTeX support for rustdoc

To install, place both files in the .cargo directory next to your Cargo.toml file.

<project-dir>
├ .cargo/
│ ├ config.toml
│ └ katex.html
@jessestricker
jessestricker / notation.md
Created October 12, 2024 19:38
Extended Backus-Naur Form (EBNF) as used by the W3C XML specification.

Notation

The formal grammar of XML is given in this specification using a simple Extended Backus-Naur Form (EBNF) notation. Each rule in the grammar defines one symbol, in the form

symbol ::= expression
@jessestricker
jessestricker / lexicographicOrder.kt
Created December 20, 2024 22:31
Comparator that compares lists lexicographically.
/**
* Returns a comparator that compares lists _lexicographically_ using the given [elementComparator].
*/
internal fun <T> lexicographicOrder(elementComparator: Comparator<T>): Comparator<List<T>> =
object : Comparator<List<T>> {
override fun compare(listA: List<T>, listB: List<T>): Int {
val iteratorA = listA.iterator()
val iteratorB = listB.iterator()
while (iteratorA.hasNext() && iteratorB.hasNext()) {
val elementA = iteratorA.next()
@jessestricker
jessestricker / terminal.py
Created January 1, 2025 23:19
Python library for terminal colors and styles.
from collections.abc import Iterable
from dataclasses import dataclass
from enum import Enum
from typing import Self
_ESC = "\x1b"
_CSI = _ESC + "["
def _sgr(codes: Iterable[int]) -> str: