Skip to content

Instantly share code, notes, and snippets.

View maxludden's full-sized avatar

maxludden maxludden

  • Upstate New York
  • 23:45 (UTC -04:00)
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maxludden
maxludden / maxlogo.svg
Created April 10, 2025 19:23
maxludden's logo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maxludden
maxludden / rich_logger.py
Last active June 1, 2025 04:30
A loguru logger that uses rich to print to the console.
"""Create a rich.console.Console sink for a loguru.Logger.
This module provides a custom sink for the loguru logger that uses the rich library to format and display log messages in a visually appealing way. It also includes functions to set up logging, manage run counts, and handle log file creation and cleanup.
It is designed to be used in Python projects that require structured and colorful logging output, especially for long-running processes or applications where tracking progress and errors is important.
The module includes:
- A custom RichSink class that formats log messages with colors and styles.
- Functions to create and configure a rich console and progress bar.
- Functions to find the current working directory and manage log files.
- A function to increment and write the run count to a file.
@maxludden
maxludden / get_name.py
Created May 13, 2024 15:46 — forked from pklaus/get_name.py
Extracting font names from TTF/OTF files using Python and fontTools
#!/usr/bin/env python
"""
From
https://github.com/gddc/ttfquery/blob/master/ttfquery/describe.py
and
http://www.starrhorne.com/2012/01/18/how-to-extract-font-names-from-ttf-files-using-python-and-our-old-friend-the-command-line.html
ported to Python 3
"""
@maxludden
maxludden / index.html
Created June 30, 2023 14:25
Layering background gradients
<!-- The gradient backgrounds are applied to the body -->
@maxludden
maxludden / .gitignore
Created December 22, 2022 23:43
Max's standard .gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python