[1]
Full list of imagemagick color names.
Note
This post is a thought [2]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: /static/https://imagemagick.org/script/color.php
[2]: /thoughts/
GitHub Stars
GitHub stars posts
1859 posts
latest post 2026-05-24
Publishing rhythm
External Link
X (formerly Twitter) Ā· twitter.com [1]
Iām going to give this trick a shot on my sites, and see how I like it.
* {
min-width: 0
}
Down in the comments @adamwathan [2] goes on to say.
Basically every layout overflow bug ever boils down to some flex or grid child needing min-width: 0 š
Oh and @ryanflorence [3] also says in the comments.
I ⦠do this.
Note
This post is a thought [4]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://twitter.com/adamwathan/status/1734696245015494711
[2]: https://twitter.com/adamwathan/
[3]: https://twitter.com/ryanflorence
[4]: /thoughts/
External Link
tushar.lol [1]
Nice message by @tusharsadhwani [2].
Write it down.
You had to dig deeper than face value at something.
Write it down.
You had to combine multiple pages of docs.
Write it down.
Someting was simply not obvious to you at first and it took someone else to give you that ah ha moment.
Write it down.
You had a small discovery that had a marginal impact on your day.
Write it down.
A blog does not have to be a Blog, it can be small meaningful posts. There are absolutely no rules. If you think you are going to end up with too many posts, that is a solvable problem, make a search, curate your favorite posts, make multiple feeds.
At the end of the day.
Write it down.
This post itself is a thought, the smallest component to my blogging strategy.
Write it down.
Note
This post is a thought [3]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://tushar.lol/post/write-a-blog/
[2]: https://twitter.com/sadhlife
[3]: /thoughts/
Path Operation Advanced Configuration - FastAPI
FastAPI framework, high performance, easy to learn, fast to code, ready for production
fastapi.tiangolo.com [1]
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 # [2]
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/", include_in_schema=False)
async def read_items():
return [{"item_id": "Foo"}]
trailing slash # [3]
Iāve had better luck just routing both naked and trailing slash routes in fastapi [4]. 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.
from fastapi import FastAPI
app = FastAPI()
@app.get("/items")
@app.get("/items/", include_in_schema=False)
async def read_items():
return [{"item_id": "Foo"}]
favicon.ico # [5]
Now you do not need to deploy favicons to your api in any way, it is nice to have it in your browser tab, but more importantly ...
Protect API docs behind authentication? Ā· Issue #364 Ā· fastapi/fastapi
Basic Question Does FastAPI provide a method for implementing authentication middleware or similar on the docs themselves (e.g. to protect access to /docs and /redoc)? Additional context My company...
GitHub Ā· github.com [1]
You can protect your fastapi [2] docs behind auth so that not only can certain roles not run certain routes, but they cannot even see the docs at all. This way no one that shouldnāt be poking around can even discover routes they shouldnāt be using.
Here is the soluteion provided by @kennylajara [3]
from fastapi import FastAPI
from fastapi.openapi.docs import get_redoc_html, get_swagger_ui_html
from fastapi.openapi.utils import get_openapi
import secrets
from fastapi import Depends, FastAPI, HTTPException, status
from fastapi.security import HTTPBasic, HTTPBasicCredentials
app = FastAPI(
title="FastAPI",
version="0.1.0",
docs_url=None,
redoc_url=None,
openapi_url = None,
)
security = HTTPBasic()
def get_current_username(credentials: HTTPBasicCredentials = Depends(security)):
correct_username = secrets.compare_digest(credentials.username, "user")
correct_password = secrets...
Looking for inspiration? llmware [1] by llmware-ai [2].
Unified framework for building enterprise RAG pipelines with small, specialized models
References:
[1]: https://github.com/llmware-ai/llmware
[2]: https://github.com/llmware-ai
Cancel subscriptions
Cancel subscriptions immediately or at the end of the subscription period with proration options, invoice handling, and automatic cancellation after failed payment attempts.
stripe.com [1]
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.
Note
This post is a thought [2]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://stripe.com/docs/billing/subscriptions/cancel#canceling
[2]: /thoughts/
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 [1] and sqlmodel
on sqlite. My billing integration is going to be all Stripe.
Stripe Subscription Cancellations Docs # [2]
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.
[3]
User Model # [4]
This is the part of the user model that includes the cancel and reactivate
methods. It pretty much follows the stripe guide.
class UserBase(SQLModel, table=False): # type: ignore[call-arg]
username: str = Field(unique=True)
full_name: str
email: str
email_verified: bool = False
disabled: bool = False
signup_date: Optional[datetime] = Field(default_factory=datetime.utcnow)
stripe_customer_id: Optional[str]
def cancel_subscription(self):
for subscription in self.active_sub...
External Link
stripe.com [1]
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.
date = datetime.fromtimestamp(invoice.next_payment_attempt)
amount = invoice.amount_due
currency = invoice.currency
Note
This post is a thought [2]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://stripe.com/docs/api/invoices/upcoming
[2]: /thoughts/
Search
Use the search APIs to look up and retrieve objects in your Stripe data. Using search is a faster alternative to paginating through all resources.
stripe.com [1]
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.
stripe.Price.search(query="active: 'true' and product: 'prod_P8SfwtxJ45cWE2'")
Note
This post is a thought [2]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://stripe.com/docs/search#search-query-language
[2]: /thoughts/
stripe-keys-and-ids.tsv [1]
tsv
Prefix Description Notes
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
aliacc_ Alipay Account ID Identifier for an Alipay account.
ba_ Bank Account ID Identifier for a Bank Account object.
btok_ Bank Token ID Identifier for a Bank Token object.
card_ Card ID Identifier for a Card object.
cbtxn_ Customer Balance Transaction ID Identifier for a Customer Balance Transaction object.
ch_ Charge ID Identifier for a Charge object.
cn_ Credit Note ID Identifier for a Credit Note object.
cs_live_ Live Checkout Session ID Identifier for a checkout Session object in live mode.
cs_test_ Test Checkout Session ID Identifier for a checkout Session object in test mode.
cus_ Customer ID Identifier for a Customer object.
dp_ Dispute ID Identifier for a Dispute object.
evt_ Event ID Identifier for an Event object.
fee_ Application Fee ID Identifier for an Application Fee object.
file_ File ID Identifier for a File object.
fr_ Application Fee Refund ID Identifier for an Application Fee Refund object.
iauth_ Issuing Authorization ID Identifier for an Issuing Authorization object.
ic_ Issuing Card ID ...
-
Dang this is such a good message. I canāt exactly relate to being forced into the overworking situation that PirateSofware is talking about. I can relate to being conditioned to feeling a certain way and changing that is very difficult. I can also relate to not feeling like I am getting enough done in the day. Sometimes a bit of separation is good.
Note
This post is a thought [1]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: /thoughts/
[1]
Iāve been using tailwind for a few months now and I can still say Iām loving
it. Iāve been using it to create some rapid prototypes that may or may not
ever become something, a document that is likely to go to print (a resume), and some quick
dashboards.
I started using Tailwind a few month back # [2]
A few months back in september of 2023 I made a case for
tailwindcss [3]. And have been
using it on quite a few projects since.
- values are well thought out
- itās really easy to use
- classes that make sense
- tree shakable
fokais.com # [4]
I started working on fokais.com only a few weeks ago, Itās going to be a SAS to
make blogging easier. Iāve started hosting some tools for this blog that I
really like that I think I can turn into a service. Itās been fantastic to
quickly pump out new pages with tailwind.
[5]
HTMX # [7]
tailwind and htmx are a match made in heaven. They both really lean on
Location of Behavior over Separation of concerns. They do really well at
making small components that you can throw on and endpoint and stack into any
page. With tailwind I just configure it to look at all my templates, and I can
guarantee that the styles will be in app.css, ...
External Link
stackoverflow.com [1]
Get those print colors exact
body{
-webkit-print-color-adjust:exact !important;
print-color-adjust:exact !important;
}
Note
This post is a thought [2]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://stackoverflow.com/questions/3893986/css-media-print-issues-with-background-color#answer-14784655
[2]: /thoughts/
page-break-after CSS property - CSS | MDN
The page-break-after CSS property adjusts page breaks after the current element.
MDN Web Docs Ā· developer.mozilla.org [1]
Iām working on something that might go to print, so I want the page breaks to happen somewhat in my control as the content author. As I do my writing I break my content up in to many short sections using h2, sometimes an h3. These are generally short sections that go together, should stay together, and typically are not too lengthy to cause a large white space in print.
I found a way in css to only allow page breaks to happen on h2 and h3, and it turned out perfect, suck it WSIWIG editors
* {
page-break-before: avoid;
}
h2,
h3 {
page-break-before: auto;
}
Note
This post is a thought [2]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-after
[2]: /thoughts/
Go by Example
gobyexample.com [1]
Fantastic resource for learning go. You work through small examples quickly, learning single concepts along the way.
Note
This post is a thought [2]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://gobyexample.com/
[2]: /thoughts/
How to Build a Website or App - Syntax #696
This podcast episode covers a wide range of topics related to building a website or web application from start to finish.
syntax.fm [1]
Great tips in this one. They discuss everything from front end to backend, databases and ORMS, here are a few of my favorite points.
- Use good data or good fake data
- make it have some variation like long and short text
- Donāt use a database if you need one, static content is eaiser to manage
- end to end test, (does the site load page x)
- You DONT NEED all this complexity, you can deploy a site with HTML [2] and CSS.
Note
This post is a thought [3]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://syntax.fm/show/696/how-to-build-a-website-or-app
[2]: /html/
[3]: /thoughts/
External Link
X (formerly Twitter) Ā· twitter.com [1]
Textual is so sick, Will just made a live markdown editor in the terminal!
Note
This post is a thought [2]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://twitter.com/willmcgugan/status/1729158038551220477
[2]: /thoughts/
External Link
X (formerly Twitter) Ā· twitter.com [1]
Fastapi [2] passes flask in GitHub stars!
[1]
Note
This post is a thought [3]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://twitter.com/tiangolo/status/1729153717956715007
[2]: /fastapi/
[3]: /thoughts/
-
Nice take by @t3dotgg [1]. Some of the old patterns that go deep into webdev, MVC, separation of concerns, REST, are things we are told to believe on day one, thrown so many things, no mental bandwidth, or experience to form our own opinions we must take them as fact. Rarely do we take these facts and revisit them with our new understandings years later.
Note
This post is a thought [2]. Itās a short note that I make
about someone elseās content online #thoughts
References:
[1]: https://twitter.com/t3dotgg
[2]: /thoughts/