External Link stackoverflow.com Its sad that this is not the accepted answer.
Posts tagged: webdev
All posts with the tag "webdev"
214 posts
latest post 2026-07-05
Publishing rhythm
External Link stackoverflow.com This is how you fix the stupid corner section of a double scroll bar being white on a dark theme site. The question included an example image where you can see white squares everywhere there are horizontal and vertical scroll bars.
This is an interesting problem. I want to make a solution for this on htmx -patterns. I would make user specific routes with an rather than serving the whole page, serve a partial with s to fill in user specific data with a no cache on the cdn level.
So cool to see ROX build this over the course of a day.
jinja has a loop variable that is very handy to use with htmx. Whether you want to implement a click to load more or an infinite scroll this loop variable is very handy.
{% for person in persons %}
<li
{% if loop.last %}
hx-get="{{ url_for('infinite', page=next_page) }}"
hx-trigger="intersect once"
hx-target="#persons"
hx-swap='beforeend'
hx-indicator="#persons-loading"
{% endif %}
{{ person.name.upper() }} -
{{ person.phone_number }}
</li>
{% endfor %}
Now for every chunk of contacts that we load we will trigger the infinite scroll by loading more once the last one has intersected the screen.
Great episode covering a seemingly simple topic. What I really benefitted from was hearing all the different use cases, from logging, debugging, to a/b testing, caching, and auth. I hadn’t even thought of it being applied to a router. I thought of it being applied for an entire application. This seems very useful for things like an admin router, all routes would need to have the admin role to get in.
![[None]] I’ve been using these decorators to modify the behavior of specific routes. It will do things like 404 admin only routes in a way that looks just like fastapi ’s default, or only allow certain roles into the route, or redirect unauthenticated users to login. After listening to yesterday’s syntaxfm I’m now really thinking about middleware and the benefits it might have. middleware would make it easy to apply things like admin to an entire admin router, so you wont forget it on any one admin route. It will look cleaner as the admin checker is only applied once per router, not once per route.
Simon Willison (@simonw) on X TIL Google Chrome has a --headless option you can use to take a screenshot from the CLI that's built into the default installation X (formerly Twitter) · twitter.com Huh, so this is just built right into the chrome cli.
![[None]] jinja’s in fastapi does not account for https by default, there is probably a better way, but this is a way that allows me to configure when I use http vs https.
![[None]]
605: Jim Nielsen on Subversive URLs, Blogging + AI, and Design Engineers Jim Nielsen joins us to about URLs and linking as the new subversive way to maintain the web, paying for news in Canada, should content creators be worried about AI, the case for design engineers, … ShopTalk · shoptalkshow.com An absolute fantastic episode about blogging, thinking about a web1.0 kind of world today, and what it means moving forward. Web 1.0 is robust, you own your own destiny, you own your data, you can do what you want. There is no platform to tell you what you can and cannot do. But the future web is stealing your data to build AI models, spam sites are duplicating your content and stealing your SEO. You may or may not care, but at the end whether you get traffic or now you own your web 1.0 sites.
Placehold Placehold is a simple, fast and free image placeholder service to generate SVG, PNG, JPEG, GIF, WebP and AVIF placeholder images for your project. placehold.co This is a handy placeholder generator for generating placeholder items like images, and videos.
tailwind and markdown
This post is a bit of an experiment to see what I can do. Lets start with a block of pink text. I build my blog with my own static site generator called markata Setup Tailwind for Jinja Still Loving Tailwind This text should be pink This text should be not pink Now will it work with bulleted lists Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est This block will not be pink. Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est Inline classes # Now within a [paragraph]{.text-pink-500} can we add [inline classes] Pros # lorem ipsum dolor [Cons] # lorem ipsum dolor Classes on images # Attrs does not like ‘/’ characters in its cl…
Great take on low code. I have definitely felt the pressure of being presented low code options, “look it does almost everything you need, and you can do it without code.” Granted there are tons of great low code environments that serve their markets well (things like zapier). As pointed out here when they fall short rather than being hard, it goes to nearly impossible. As Theo points out here many applications follow an 80/20 rule. 80% of the app is really easy to put together, and takes about 20% of the time, probably less. What no code does is it takes that 80% that is already easy, makes it even easier ( pitches it as faster whether or not that is true), and makes the last 20% of the project impossibly hard to create and maintain, so you just should have picked a tool that had the capability of doing the whole thing from the start anyways.
Template Designer Documentation — Jinja Documentation (3.1.x) jinja.palletsprojects.com html code generated by my jinja templates generally look half garbage because of indents and whitespace all over the place. I just learned about these pesky Whitespace Control characters that can get rid of the whitespace added from templating. You can also strip whitespace in templates by hand. If you add a minus sign (-) to the start or end of a block (e.g. a For tag), a comment, or a variable expression, the whitespaces before or after that block will be removed:
bunny.net - The Global Edge Platform that truly Hops Hop on bunny.net and speed up your web presence with the next-generation Content Delivery Service (CDN), Edge Storage, and Optimization Services at any scale. bunny.net · bunny.net bunny.net looks like an interesting cloudflare alternative.
External Link stackoverflow.com After struggling to get dependencies inside of middleware I learned that you can make global dependencies at the app level. I used this to set the user on every single route of the application without needing Depend on getting the user on each route.
Handling Errors - FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi.tiangolo.com This page shows how to customize your fastapi errors. I found this very useful to setup common templates so that I can return the same 404’s both programatically and by default, so it all looks the same to the end user.
logs with FastAPI and Uvicorn · Issue #1508 · fastapi/fastapi Hello, Thanks for FastAPI, easy to use in my Python projects! However, I have an issue with logs. In my Python project, I use: app = FastAPI() uvicorn.run(app, host="0.0.0.0", port=8000) And when... GitHub · github.com Setting an additional log handler to the uvicorn logger for access logs in fastapi was not straightforward, but This post was very helpful.
External Link stackoverflow.com Here is a full example from the post.