The holy grail of image formats: SVG cross-codec-compilation & AVIF

The holy grail of image formats: SVG cross-codec-compilation & AVIF

Photos and text or diagrams in the same image file, at a small size, without losing cripsness

With essentially all browsers being some variation of evergreen now, we can start tossing out old assumptions, like how stark the tradeoff is between filesize, image quality, and features (like transparency) in image compression, especially in images that mix photos with other graphics (like lineart or text).

Minimal WebComponent to parse file selectors into bytearrays

Minimal WebComponent to parse file selectors into bytearrays

Extending the HTMLInputElement and using custom events for easy hooks

I’m in the process of moving the (non-wasm parts) of my web front-end for cega over to vanilla Jasvacript WebComponents. I’ve liked how much it cleans up and encapsulates the logic without even needing a framework. The hooks for parsing the file into a byte array on the client-side (for passing to the wasm) were an obvious extraction point, so I pulled it out to a gist micro-project: file-byte-reader.

Simpler direct handling of HTML file input in Rust wasm

Simpler direct handling of HTML file input in Rust wasm

Dropping Yew and just calling the wasm_bindgen exported function directly

Earlier I figured out how to get HTML file input selectors being called from my Rust code using yew but eventually the complexity of doing everything in essentially js translated to Rust grated on my sensibilities. I can handroll the basic HTML and Javascript easier (and maybe wrap stuff neatly in a WebComponent) and then call out to my Rust lib when I need it.

Easy-peasy comments on a static site - without needing another service

If you are already using Mastodon to share your content, why not use it as the hub of discussion for your content

Since I’m running a statically generated site via Jekyll, adding comments takes some addition thought. The last time I was looking into this Disqus was starting to take off, but using a third party service for something like this never quite sat right (and some privacy issues they went through later proved that out).

Using Ruby's #.extend on instances to avoid modifying a base class

Using Ruby's #.extend on instances to avoid modifying a base class

Making a Scrabble word-finder by adding subtraction and overloading the subset operator on #.tally supplied frequency hashes

I choked a bit on a tech screen today (at least by my own standards), by rushing to a solution too quickly, instead of working out a proper tested class. So after dinner I thought I’d revisit it and see what a cleaner solution might look like.

Using Ruby enum_for to implement multiple paths enumerating the same Enumerable

Using Ruby enum_for to implement multiple paths enumerating the same Enumerable

Idiomatic breadth-first versus depth-first tree-traversals in Ruby

Anyone who has gotten very far in a basic “implement this data structure” tech-screen, using Ruby, hopefully knows about just making your class an Enumerable and implementing #each to get all of the methods of that Mixin, which people are used to using on collections in any Ruby project. Less obvious is how you tackle a more complex case, like trees (another interview classic), which have different possible traversal methods of even the same instance.

Handling FormData and file inputs in Rust Wasm

Handling FormData and file inputs in Rust Wasm

Pull requests and example usage of yew, gloo, and web-sys

I submitted some pull requests for additional examples to the top level library I’m using for Rust Wasm, yew. Some of the underlying tech and libraries have advanced since most of the examples were created, and there wasn’t a simple one for a very common use case: using a form with multiple fields, including a file-input selector.

Pagination


© 2024. No rights reserved.