ollama is the easiest to get going local llm tool that I have tried, and seems to be crazy fast. It feels faster than chat gpt, which has not been the experience I have had previously with running llm’s on my hardware.
Posts tagged: thought
All posts with the tag "thought"
Controlling overflow with tailwindcss
Default scrollbars on a dark theme website are just the ugliest thing. This page covers all the pseudo selectors needed to style the scrollbar.
Wincent (Greg Hurrel) has a pretty solid and fast zshrc. I recently grabbed his completion section and it seems to be working better than whatever I had.
zsh completion snippet
All the hover, select, autofil, focus combinations have left me confused on how to consistently get my form elements styled in dark mode
This snippet from CSS tricks has fixed all the different states for me to give me full control.
arel is a “Lightweight browser hot reload for Python ASGI web apps”
I just implemented this on my thoughts website using fastapi, and it’s incredibly fast and lightweight. There just two lines of js that make a web socket connection back to the backend that watches for changes.
When in development mode, this snippet gets injected directly on the page and does a refresh when arel detects a change.
import os import arel from fastapi import FastAPI, Request from fastapi.templating import Jinja2Templates app = FastAPI() templates = Jinja2Templates("templates") if _debug := os.getenv("DEBUG"): hot_reload = arel.HotReload(paths=[arel.Path(".")]) app.add_websocket_route("/hot-reload", route=hot_reload, name="hot-reload") app.add_event_handler("startup", hot_reload.startup) app.add_event_handler("shutdown", hot_reload.shutdown) templates.env.globals["DEBUG"] = _debug templates.env.globals["hot_reload"] = hot_reload @app.get("/") def index(request: Request): return templates.TemplateResponse("index.html", context={"request": request}) # run: # DEBUG=true uvicorn main:app --reload
I just discovered arel for hot reloading python applications when content changes from this snippet that implements it for fatapi.
...
I need to learn regex capture groups better. This is so dang powerful. I really like the \v that bob uses here, it really does cut down on the terseness of all the special characters.
I wanted to replace all occurrences of:
name,[email protected],0,171,,2023-09-21
With:
...
HATEOAS gonna hate. More and more htmx seems like the js library for backend devs. So rather than making 55 rest calls here, just make an endpoint that does what you want it to do with one, or a few requests.
Ben Johnson was on the Changelog a few years back covering his work on litestream, and talks about why he chose to go open source, but not open contribution.
You should have a good reason to move off of sqlite.
I just learned that the term PITR means Point In Time Recovery. I have never seen this term, but it is most often referred to in relation to database recoveries.
Very inspiring talk, TLDR, you probably don’t need a database server. sqlite will probably be faster, simpler to maintain, and simpler to test your application.
`litestream` is a sick cli tool for steaming replicas of sqlite. It automatically does daily snapshots, and streams all of the writes to the replica live.
install #
Install is fast using installer, no compilation, just copy the binary and run.
As applications scale to the edge, to put compute as close to the user as possible, database queries back to the master node get slower and slower. Enter sqlite replication, put the database wtih the application code and replicate from master.
SQLite is the next big database trend. with more horizontal scaling, close to user read heavy applications, having your database in the same application stack makes a lot of sense. Tools like litestream are going to enable global distribution in an impressive way.
Fly.io’s solution to sqlite managed backups.I definitely want to look into this a bit, but moreso the tech under the hook litestream.
This is a sick looking bash script generator for installing binaries off of github releases. it reccomends curl into bash, but you could curl into install.sh and toss that in your dotfiles repo or wherever.
Install installer with installer
podman comes with a nice command for generating systemd service files (units).
Pagefind is absolutely insane. I’ve tried a number of static site searches, and found them all hard to get get going, clunky and not the best experience as a user or developer.
I setup pagefind in about 2 minutes on my site where it found and indexed 833 pages in 2 minutes.
The only downside I see so far is that it is a lot of bandwidth to the user. On simulated slow 3G you can definitly feel it, but not terrible. Anything slower and its going to start feeling frustrating.
edit: I have actually fully deployed it on waylonwalker.com, and its fast!
...