Published

All published posts

2457 posts latest post 2026-04-19
Publishing rhythm
Apr 2026 | 40 posts

Most bloggers on my twitter blog right into a file that goes on git. I kinda expected to have more database folk. I have my blog in markdown on git and the editing experience is top notch. I can just find files edit them in MY EDITOR, push them and I got a post. I am running thoughts in a sqlite database with a fastapi backend, and holy crap the instant nature of posting feels so much better. Both sides have good points.

I am working on fokais.com’s signup page, and I want to hide the form input during an htmx request. I was seeing some issues where I was able to prevent spamming the submit button, but was still able to get one extra hit on it.

It also felt like nothing was happening while sending the email to the user for verification. Now I get the form to disappear and a spinner to show during the request.

Let’s start off with the form. It uses htmx to submit a post request to the post_request route. Note that there is a spinner in the post_request with the htmx-indicator class.

The intent is to hide the spinner until the request is running, and hide all of the form input during the request.

...

DataDog ddqa is building out a textual app and deploying it with pyapp. They have CI setup to fully build and cross compile their textual tui into github releases that you can just download from their releases page. This is something I am looking at for markata. This would be pretty sweet to be able to make it just work on places like windows. It would also be interesting to try to build a full desktop app with pyapp.

Excluding routes from fastapi docs, can be done from the route configuration using `include_in_schema`. This is handy for routes that are not really api based or duplicates.

From the Docs #

from fastapi import FastAPI app = FastAPI() @app.get("/items/", include_in_schema=False) async def read_items(): return [{"item_id": "Foo"}] 

trailing slash #

I’ve had better luck just routing both naked and trailing slash routes in fastapi. I’ve had api’s deployed as a subroute to a site rather than a subdomain, and the automatic redirect betweens them tended to always get messed up. This is pretty easy fix for the pain is causes just give vim a yyp, and if you don’t want deuplicates in your docs, ignore one.

...

This is a handy guide to cancelling stripe subscriptions.

# Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys import stripe stripe.api_key = "sk_test_51ODvHtB26msLKqCAPBAo1qkBBuIfT5tQBX6YFWCLMsPixIExxITCRVa9tNCIqkdQS8olhR79NYXsFWBPKsM3LbGO00zEcNQfNI" stripe.Subscription.modify( "sub_49ty4767H20z6a", cancel_at_period_end=True, )

You can even inverse it by flipping True to False and re activate the subscription.

Today I am working on fokais.com, trying to get to a point where I can launch by workig through stripe integrations. This is my first time using stripe, so there has been quite a bit to learn, and I am probably building in more than I need to before launching, but I am learning, and not in a rush to launch.

I am building the fokais backent in python primarilyt with fastapi and sqlmodel on sqlite. My billing integration is going to be all Stripe.

Here is a link to the stripe docs for your refrence, especially if you want to see how to cancel subscriptions in other languages. They include code samples for many popular languages.

This is the part of the user model that includes the cancel and reactivate methods. It pretty much follows the stripe guide.

...

You can find your customers next billing date through the stripe api by using Invoice. and passing in customer, customer_details, subscription, or schedule.

import stripe stripe.api_key = "sk_test_51ODvHtB26msLKqCAPBAo1qkBBuIfT5tQBX6YFWCLMsPixIExxITCRVa9tNCIqkdQS8olhR79NYXsFWBPKsM3LbGO00zEcNQfNI" invoice = stripe.Invoice.upcoming(customer="cus_NeZwdNtLEOXuvB")

Within the invoice, you can find the next_payment_attempt as a epoch.

Stripe has it’s own query language for querying data. I’m just getting into using it and it seems pretty good so far. I needed to lookup the price for products. I was able to find prices for my product using the python api as shown below.