Properties in C++20

C++ doesn't support getter/setter style properties. But you can get pretty darn close with templates or macros. #include <iostream> #include "properties.h" using namespace std; class User { private: int mId; int mWeight; public: // Non-auto property only supporting get (runtime check) property<int> Id { { .get = [this]…

Getting MacOS BigSur + ESP8266 to Play Nice

I ran across The "do not be alarmed" clock on HackerNews and thought that would be a fun little project to play around with. It's been an awful long time since I've done anything with hardware and I haven't played with anything "Arduino" yet so I made my way over…

Building a Custom Shelf for My Daughter

So we're expecting a baby here in the next week or two and my wife wanted a shelf/armoire/ambry(?) thing that matched our crib and changing dresser (see pictures of the store bought crib and dresser below). I drew up some plans in the free version of SketchUp and…

Showing Firefox close tab on tab hover

I switched from Chrome to Firefox a few months ago. For the most part...it feels roughly the same but there was one subtle difference that finally irked me to the point of googling: having to right click on a tab to close it. In Chrome, when you hover over…

Using() block hell in C#

So the other day I was working on transforming streams for an encryption layer for work. I ended up having some code that looked similar to this: public async Task SendAsync(byte[] data, Delegate next) { using (var stream = ...) { using (var encryptStream = ...) { using (var encodeStream = ...) { using (var reader = ...) { await next(...); } } } } } public…

Page Up & Page Down with Kilo Editor

I've recently started going through this brilliant article on creating your own text editor (read: nano/pico clone). If you've never built one this article breaks it down into easy to follow chunks. If you do go through it, you might notice the same thing I did. Page Up and…

VSCode, GDB, and Debugging an OS

I've been spending some time going through Philipp Oppermann's amazing blog series, Writing an OS in Rust. Digging into operating systems has been on my todo list for years now and I couldn't pass up the opportunity when I ran across this series on Hacker News. Phillip has done a…