212 results for "":
Generating a docker image with nix
There it is. The final installment.
Over the course of this series, we’ve built a very useful Rust web service that shows us colored ASCII art cats, and we’ve packaged it with docker, and deployed it to https://fly.io.
We did all that without using nix
at all, and then in the last few chapters,
we’ve learned to use nix
, and now it’s time to tell docker build
goodbye,
along with this whole-ass Dockerfile
:
Isaac rubs his back on non-existent doors
Haven’t blogged in a while. Life’s fine, project are a-plenty, but I just wanted to make a more lasting post about one particular issue that struck me as funny when programming Paper Isaac.
Bugs, bugs, bugs
What’s infuriating when letting others play an early prototype is that you hear constantly the same things. Some bugs are non-trivial to fix, some you’re just not motivated to fix now… sometimes you just have your head elsewhere, gotta focus, or are elbow-deep in some other piece of code and the damn walls can wait.
Fast font packing for fun and profit
Being creative is hard work, let’s go optimizing instead! My graphics engine dye was pretty naive about displaying text, and it was wasteful. Let’s see how I made it all better with this one weird tip.
Disclaimer: Even after a few years I’m still very much an OpenGL newbie. Please don’t hit me with crowbars.
Once upon a time, OpenGL was easy to use - and also falling out of relevancy as far as high-performance 3D graphics were concerned. But it wasn’t all bad! You could basically pick up any library out there and integrate it with your existing GL project. Not that it’s a good idea, but it usually just worked.
sam, homebrew-mingw, etc.
I want to write blog posts, but right now I have too much to do.
So instead, here are bullet points:
I wrote an ooc tool named sam, which helps you keep your git repos up-to-date, and helps to remind you what to push when switching workstations. It’s pretty neat, and portable.
A while ago, I started working on homebrew for Windows, or rather, for MinGW+MSYS. Provided you have msysgit and Ruby in your PATH, it’ll let you brew install most packages. I’ve tested a few dozen, send in your pull requests anytime.
Day 10 (Advent of Code 2020)
Day, 10! Day, 10!
Okay, Day 10.
Again, the problem statement is very confusing - but what it all boils down to is this. We have a list of numbers:
16
10
15
5
1
11
7
19
6
12
4
To which we need to add 0
and whatever the maximum was, plus three:
16
10
15
5
1
11
7
19
6
12
4
0
22
From there on, if we take them in order, we’ll have gaps of 1 and gaps of 3:
Cracking Electron apps open
I use the draw.io desktop app to
make diagrams for my website. I run it on an actual desktop, like Windows or
macOS, but the asset pipeline that converts .drawio
files, to .pdf
, to
.svg
, and then to .svg
again (but smaller) runs on Linux.
So I have a Rust program somewhere that opens headless chromium, and loads just the HTML/JS/CSS part of draw.io I need to render my diagrams, and then use Chromium’s “print to PDF” functionality to save a PDF.
Day 9 (Advent of Code 2022)
The Advent of Code is not a sprint: it’s a marathon: sometimes you’ve got to stop and smell the roses.
I… what? That’s not.. have you done a marathon before?
No, and I haven’t taken any creative writing classes either, I think you can tell. Anyway: Day 8 was a bit aggravating for me. In 2020 I gave up AoC after Day 14 I think, and then I skipped a year. It doesn’t help that it overlaps some holidays and stuff, but!
The virtue of unsynn
Addressing the rumors
There have been rumors going around, in the Reddit thread for facet, my take on reflection in Rust, which happened a bit too early, but here we are, cat’s out of the bag, let’s talk about it!
Rumors that I, podcaster/youtuber fasterthanlime, want to kill serde, serialization / deserialization framework loved by many and which contributed greatly to Rust’s success, and I just wanted to address those rumors and say that…
Day 4 (Advent of Code 2022)
Part 1
Let’s tackle the day 4 challenge!
In this one, we get an input like this:
2-4,6-8
2-3,4-5
5-7,7-9
2-8,3-7
6-6,4-6
2-6,4-8
Each line has two ranges: the first line has ranges containing 2, 3, 4, and 6, 7, 8. We must count how many pairs have ranges where one fully contains the other.
In Rust, we can express this with “inclusive ranges”
(std::ops::RangeInclusive),
and those implement Iterator
, so we can do: