In the middle of the desert you can say anything you want
BurntSushi/bttf: A command line tool for datetime arithmetic, parsing, formatting and more.
I use wolframalpha for most of my casual date ops etc. but the project is cool and I may need it.
But the most interesting bit is the documentation.
Quoting README:
I may ship arbitrary and capricious breaking changes at this point. You have been warned. […] And it doesn’t give a hoot about POSIX (other than the
TZenvironment variable).
And THIS. I either love it or hate it, can’t decide:
-h/--help
This flag prints the help output for bttf.
Unlike most other flags, the behavior of the short flag, -h, and the
long flag, --help, is different. The short flag will show a condensed
help output while the long flag will show a verbose help output.
It breaks my usual expectations but damn it’s a cool pattern that I really want to be a thing! You’re allowed to break conventions if your thing is really smarter and you’re explicit and intentional about it.
Tiny neat app that shows pages from all PDFs and allows you to rearrange the order, does one thing and does it wonderfully!
Prodigy · An annotation tool for AI, Machine Learning & NLP
First seen in Anshu Kiran Sharma - PhD Student Computer Science, Natural Language Processing’s “Once upon a kernel” @ LREC 2026
Related: Likert scale
ducaale/xh: Friendly and fast tool for sending HTTP requests o
# from README
xh http://localhost:3000/users # resolves to http://localhost:3000/users
xh localhost:3000/users # resolves to http://localhost:3000/users
xh :3000/users # resolves to http://localhost:3000/users
xh :/users # resolves to http://localhost:80/users
xh example.com # resolves to http://example.com
xh ://example.com # resolves to http://example.com
python - How to make a dict from an enum? - Stack Overflow
# Source - https://stackoverflow.com/a/60451617
# Posted by Chris Doyle
# Retrieved 2026-04-09, License - CC BY-SA 4.0
from enum import Enum
class Shake(Enum):
VANILLA = "vanilla"
CHOCOLATE = "choc"
COOKIES = "cookie"
MINT = "mint"
dct = {i.name: i.value for i in Shake}
print(dct)
NiceGUI is freaking awesome.
Resources
Useful examples
props('inline') for inline, remove for vertical; dense exists# somewhere
def create() -> None:
@ui.page('/a')
def page_a():
with theme.frame('- Page A -'):
message('Page A')
ui.label('This page is defined in a function.')
from somewhere import create
# Example 2: use a function to move the whole page creation into a separate file
# in main.py
function_example.create()
OK I think I got it! In e.g. Select | Quasar Framework look for “slots” then you can use them thus1:
sel = ui.select(
list(items),
value=item,
)
with sel.add_slot("after"):
ui.button(icon="description").props("flat no-caps").on(
"click",
lambda e: ui.navigate.to(f"/bp/{whatever}"),
)
table = ui.table()#...
with table.add_slot("body-cell-ColumnName"):
with table.cell("ColumnName"):
# button w/ cell text
ui.button().props("""
:innerHTML="props.value"
""").on(
"click",
js_handler="() => emit(props.row.SomeColumnName)",
handler=lambda e: ui.navigate.to(f"/sth/{e.args}"), # e.args is cell content
)
# conditionals
.props(""" flat no-caps
:label="props.value !== 'N/A' ? props.value : ''"
""")
with ui.link(target="/sd"):
ui.button("Show", icon="description")
with ui.link(target=target_link).classes("no-underline"):
ui.item_label("look ma no underline!")
Ref: Badge: Floating - Quasar Playground but that’s quasar-heavy. Strangely not mentioned in the official quasar docs either. After playing with this this is the python solution:
# remove the floating prop and add one of these classes.
# Removing the prop is useful if using e.g. both top-left and top-right
# then they are on an identicafl height
ui.badge(faiss_dist_str, color="light-blue-10").props(
# "floating"
).classes("absolute-top-left")
ui.table(rows=rows).props("flat bordered").on(
"row-click",
lambda e: ui.navigate.to(f"/pr/{e.args[1]['ISIN']}"),
)
The row-click event comes from quasar: https://quasar.dev/vue-components/table#qtable-api
ui.run(..., fastapi_docs=True) to make documentation available
nicegui/examples/api_requests/main.py at main · zauberzeug/nicegui
async def show_new_quote():
async with httpx.AsyncClient() as client:
response = await client.get('https://zenquotes.io/api/quotes')
quote = random.choice(response.json())['q']
label.text = f'“{quote}”'
From the FAQ:
# (..) app.on_startup(setup)
# def setup():
# if CFG.debug_mode:
import asyncio
loop = asyncio.get_running_loop()
loop.set_debug(True)
loop.slow_callback_duration = 0.05
ui.upload(
auto_upload=True, on_upload=lambda e: handle_upload(e)
).classes("max-w-full")
async def handle_upload(e: events.UploadEventArguments):
with tempfile.NamedTemporaryFile(delete=False, prefix="uns") as tmp:
save_path = Path(tmp.name)
await e.file.save(save_path)
return save_path
element.run_method('focus')
focuses the element, I could connect this to ui.keyboard | NiceGUI to do nice keyboard-centric focus of important fields!
Ref: element.run_method(‘focus’) not working · Issue #1092 · zauberzeug/nicegui (not documented elsewhere I could find)
Validating in real time based on a pydantic BaseModel!: Real-Time Form Validation in Python Using Pydantic | by Aman Deep | Medium
Using a variable globally defined outside a function creates issues. E.g. globally WHAT=‘ever’ and then inside a function. TODO better description.
I know enough German to judge but not enough to write grammatically myself, and this is a pattern I don’t want to forget.
This is SO MUCH BETTER than anything else I’ve used for this! For very short snippets it’s golden
For the main file, see: 240116-1701 LaTeX best practices
[review/final] etc.\setlength{\itemsep}{0pt} \setlength{\parskip}{0pt} and friends\setlength{\belowcaptionskip}{0}
\setlength{\abovecaptionskip}{10pt}1 <- default values\looseness-1TODOs in the text!\bottomrules helps if distance between table and caption too small\mbox to avoid breaks, \- within word to mark break wordsexist [1,3]!\TODO and any custom commands/macros you created\enquote{} everywhere~ is \textasciitilde: check any estimate numbers (~50%)!% is \%; check all percentages!\ is \textbackslash-,--,--- are the safest — look and remove pasted UTF8 ones\references (Figure~\ref{fig:somefig})
\autoref!