RSSAmplifier

Blog

Josh's Cool Dev Blog

josh.is-cool.devRSS feed ↗21 posts

Latest posts

Svelte state sharing? Just use classes. They're fine.

Who here remembers Stores from Svelte 4? // counter.ts import { writable } from ' svelte/store ' ; export const count = writable ( 0 ) ; In Svelte 5, Stores are out and Runes are in. Universal reactivity baby! // counter.svelte.ts export const count = $state ( { value : 0 } ) ; The problem is there are too many different ways to share state across modules. Basically, after…

Offloading SVG transitions to the GPU using layers

Previously I wrote about leveraging steps() in CSS animations to enhance SVG transitions performance by essentially "lowering the framerate" of the transition. This worked well, but ultimately it wasn't enough, because CSS fill isn't GPU accellerated. In order to get silky smooth fading between two complex SVGs, I needed to make sure work was being offloaded to the GPU. In modern…

Using steps() for performant CSS transitions

I've used a lot of CSS transitions over the years. Shifting between values in a smooth fashion is pretty easy with a simple one-liner. transition: background-color 2s; But what if you have a lot of transitions? What if you have too many transitions? Your browser tries to run them as fast as your monitor's refresh rate allows (60 times per second, or more). This can be pretty taxing.…

A brief interlude into Gleam concurrency

I've been learning Rust for a while now. The other day I came across this little project called Gleam . It's a functional programming language. It's written in Rust. It compiles to JavaScript and Erlang. It borrows a lot of the good bits from Rust while hiding away a lot of the lower-level stuff. It feels kinda like Rust-lite. I was intrigued, so I took a quick look into it. If…

A custom Mastodon favicon while you wait

Admin-uploadable custom favicons are officially coming ! But until then, if you are running your own Mastodon instance, you can still do it. This is the easiest way that I've found to do it. I'll lay it out here, so it's handy for future me, or someone else. In /etc/nginx/sites-enabled/mastodon add something like this: location ^ ~…

Compiling the Zed code editor on Linux

Hello World! Coming to ya from my ThinkPad running Arch Linux with KDE Plasma 6. I'm typing this sentence into Zed right now, a new code editor from the devs who brought us Atom back in the day. There are no binaries available for Linux yet, but don't worry, for extra fun we can compile the code ourselves! Just clone the repo , then follow the instructions here . Basically it's a…

Installing Umami analytics

Real quick post. Umami I saw the other day on Evan Boehs ' blog. Wanted to try it out myself. So I did. It's tracking analytics right now on this page. I went the self-hosted route. Real easy install. Already had a PostgreSQL container on my Proxmox box, so I just had to spin up a new container, install Node.js, and go through the installation instructions . I pointed my Caddy server to…

ASUS ROG Strix X570-i Gaming motherboard chipset fan you need to calm down

TL;DR If you have an ASUS ROG Strix X570-i Gaming motherboard (or similar) and are having issues with a constant high-pitched fan noise, try the instructions here to enable ASPM and then these instructions to alter the fan curve. A very niche post, but here it is. I recently flashed the latest BIOS on my motherboard. It all went fine, but then the sound was back again. I'd completely wiped it…

In-browser WebAssembly we trust

Rust compiles to machine code, which runs as an executable file on your computer. You can also compile it to WebAssembly (Wasm for short) and have it run in the browser. Until recently, if you wanted to add interactivity to a web page, or do a bunch of calculations in-browser, you'd use JavaScript. Now that Wasm is supported in all modern browsers, we can use Rust (or another compatible…

Running a Mastodon instance entirely free forever

My single-user Mastodon instance has been ticking away for a while now, over a year at least. All up, I've paid zero dollars to keep it running. I've had a few people ask me to write up something about it, so here it is. If you're comfortable logging into a Linux server via SSH and running commands you shouldn't have any major troubles setting it up, but it will take a few…

Test early test often: writing tests in Rust is super easy and (kinda) fun!

It's extremely tempting to simply not write tests. You could forever keep saying "I'll learn how to write tests later" or "Any errors will just show up in production and I'll just catch them there" ... aaaaand I've fallen into that trap many times. This time let's tackle testing in Rust head-on, up front! Tests are super simple. Tests make your code better, and they make…

A trip to the library in Rust

Why write code you don't have to? Chances are someone's already written it and put a crate up on crates.io . A "crate" in Rust is just another name for a library or package, code that you can use in your own project. The other day I wanted a randomly generated string of text so I could manually append it to a CSS class name to make (pretty) sure it was unique. Let's write an…

What cargo new gives you

Last time we used cargo new to generate a new Rust app. Let's take a look inside. Run tree to print the directory structure. . ├── Cargo.lock ├── Cargo.toml └── src └── main.rs There's also a hidden dotfile .gitignore and the .git folder, but don't worry about those for now. The Cargo.lock file is generated by Cargo by cargo run and it's for dependency tracking and that's…

Nature keeps evolving Rustaceans

You can't fight nature. We're learning Rust OK? Evolution time. Let's gooooo! First up, install Rust . curl -- proto ' =https ' -- tlsv1 .2 - sSf https://sh.rustup.rs | sh That will give you rustc and cargo and rustup and other stuff. Let's make a new project and scuttle into the directory. cargo new hello cd hello Run the project. cargo run You just ran your first…

Running Runes locally with Svelte 5 pre-release alpha

I noticed Svelte published some v5 pre-releases. Previously you could only try out Svelte Runes by using the online playground . Now you can run them locally. Here's how. You'll need: Node.js . pnpm - Svelte uses it, but npm should work too. Download one of the version 5 pre-releases from the Svelte releases page and extract it. Or you could just clone the repo to get the bleeding edge…

Switching filesystems in Arch Linux

So you wanna jump from one moving train to another for fun? You could just do a fresh install. Or you could try this. Basically we're going to reinstall your base system, then restore all your old files over the top. This means you can avoid reinstalling all your old programs and settings etc. After many failed attempts, this is what worked for me. Recording it here for future reference and…

Dark web for dummies

Get a censor-proof completely anonymous web service on the dark web in 15 minutes or your money back! Your very own .onion address. Why would you want this? Well, the New York Times has one , (good for getting around that pesky NYTimes paywall). Also handy if you want to publish information that is vulnerable to censorship. What you need: An Internet connection. A Linux server . The Tor browser…

WiFi and Bluetooth can coexist peacefully on 2.4 Ghz

I wonder who decided it might be a good idea to put Bluetooth and WiFi on the same 2.4 gigahertz spectrum? It was relatively easy to enable Bluetooth and connect my wireless headphones in Arch Linux. I noticed however that afterwards my internet connection would inexplicably slow to a crawl whenever I connected. Disconnect, and it would be fine again. Connect, and again, virtually nothing —…

One does indeed simply install Arch Linux

A poll I ran on Mastodon recently forced me, against my will, to attempt an install of Arch Linux again. ...Multiple hours of frustration later... Here's how to install Arch the easy way. Download and make a bootable USB of the Arch Linux ISO . DON'T FOLLOW THE INSTALL GUIDE. Boot into the USB and run iwctl and follow these instructions to connect — basically device list , station…

A static site with Zola

There are a few static site generators out there, like Jekyll , Hugo , Gatsby , 11ty , Pelican , Hexo , Nikola , Metalsmith , Middleman , etc. I chose Zola to power this blog because it's simple, super speedy, easy to customise, and written in Rust . Much of the frustration fun in running your own blog is the setup, so here's probably the quickest and dirtiest guide to getting a blog up…

An initial test post

Hello! No time to write a proper post right now, but I wanted to make sure that the blog was working. I'll be back soon with something good. I promise. In the meantime. Here's some Rust code: fn main ( ) { println! ( " Hello, world! " ) ; } Thanks for reading! Josh.