Skip to content

Instantly share code, notes, and snippets.

View jimkring's full-sized avatar
💭
CI/CD

Jim Kring jimkring

💭
CI/CD
View GitHub Profile
@jimkring
jimkring / fastui_breadcrumb_component.py
Last active May 20, 2024 03:38
build a breadcrumb component for fastui
from fastui import components as c
from fastui.events import GoToEvent
def build_breadcrumb(links: list[tuple[str, str]]) -> c.Div:
"""
Returns a fastui `Div` component that behaves as a bootstrap `breadcrumb`.
`links` input is a list of tuples like [(display_text, url_string), ...].
Each link becomes a sub `Div` marked with the bootstrap `breadcrumb-item` class.
@jimkring
jimkring / image.py
Last active May 2, 2024 00:16
fastui raw html component example
import io
import base64
from typing import Union
from PIL import Image # requires `pillow` package
from fastui.components import Iframe
def iframe_from_html_raw(
raw_html: str,
@jimkring
jimkring / configparser_labview.py
Created December 16, 2023 22:23
A python ConfigParser that works better when reading INI files created with LabVIEW.
import configparser
class ConfigParserLabVIEW(configparser.ConfigParser):
"""
A ConfigParser that handles LabVIEW-generated config files with fewer errors than the default configparser:
- disables the interpolation feature
- disables the strict validation feature
- removes double-quotes from around values
"""
JKI CONTRIBUTION LICENSE AGREEMENT
Thank you for your contribution to JKI software project(s). In order to clarify the intellectual property rights in the project(s), and to grant licenses to the project(s) to others, James Kring, Inc. (“JKI”) requires that you accept this Contributor License Agreement (“Agreement”). This license is for your protection as a Contributor as well as the protection of JKI, its users, and its licensees; you may still license your own Contributions under other terms.
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to JKI. Except for the license granted herein to JKI and recipients of software distributed by JKI, You reserve all right, title, and interest in and to Your Contributions and retain the right to license and distribute them separately under the terms of your choice.
1. Definitions. “You” (or “Your”) shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreemen