-
Webmention test
- https://webmention.rocks/test/1
- https://webmention.rocks/test/2
- https://webmention.rocks/test/3
- https://webmention.rocks/test/4
- https://webmention.rocks/test/5
- https://webmention.rocks/test/6
- https://webmention.rocks/test/7
- https://webmention.rocks/test/8
- https://webmention.rocks/test/9
- https://webmention.rocks/test/10
- https://webmention.rocks/test/11
- https://webmention.rocks/test/12
- https://webmention.rocks/test/13
- https://webmention.rocks/test/14
- https://webmention.rocks/test/15
- https://webmention.rocks/test/16
- https://webmention.rocks/test/17
- https://webmention.rocks/test/18
- https://webmention.rocks/test/19
- https://webmention.rocks/test/20
- https://webmention.rocks/test/21
- https://webmention.rocks/test/22
- https://webmention.rocks/test/23/page
-
Haven't updated in a while, so I thought I'd take some time to describe the site in general.
Basic organization
What we have here is a system that strives to be as self-contained as possible in a monolothic docker-compose. By "monolithic", I mean that every container in the docker-compose should be defined and configured right in the same repository. There are a few components that exist as their own repos, but only with good reason.
I want to minimize the moving parts involved in migrating the site. It should be as close as possible to git pull followed by docker-compose up.
emacs org-mode static site
I couldn't live with myself if I didn't use these tools for this. It would hurt my soul. For those not in the know, emacs is a text editor and org-mode is an emacs major mode / file format for documents. Every post on this site exists primarily as an org-mode source file that gets exported to HTML and served directly by the nginx web server. You can see the org-mode files here.
Export is handled by a custom HTML export backend that marks up posts using microformats2 classes so the HTML is easily parsed by tools like mf2py. org-publish is used to build the org files and copy any static files that may be generated. After export, a Makefile takes over which does the following:
- For each .html file, builds a corresponding .mf2.json file containing the output of parsing the file with mf2py.
- For each directory, builds an items.json file containing a list of all the posts described by .mf2.json files.
- For each items.json file, builds a corresponding index.html containing a feed of posts. This will need to be paginated soon, making index2.html and so on when a dir gets too full, but for now it just puts everything in one big file.
Thus each directory ends up with an index.html that is built once and served directly by nginx, no database involved. When a source file hasn't changed, make will do nothing, so only index files whose inputs have changed get rebuilt. The .mf2.json for each post and items.json files for each directory are also served, if you want to see them.
Along with making the HTML files, the build process involves org-roam, which is essentially a system for caching certain properties of org-mode files and headlines in a sqlite database. What I most care about at the moment is that it automatically gathers all the links into a place easily queried by other code, so I don't have to parse for them myself.
Django for apps
There's an of Django running at https://rolledgoats.gg/apps/ for anything that needs a database.
org-roam
A little glue app so that I can access what's in the org-roam database from Django. I use this to gather the links from all the pages and send webmentions.
Webmention
This one defines a Webmention endpoint at https://rolledgoats.gg/apps/webmention/receive. If you host a page that links to a page here, you can send a webmention to that endpoint, and it'll display on the page (eventually: that part isn't set up yet and will be subject to moderation time).
It also acts as a caching webmention sender. There is a management command that gathers links from the org-roam database, sending a webmention when pages change. This isn't actually part of the HTML build system yet, I've just been running it manually.
Wordle
Just a Wordle clone. I like the idea of self hostable games that smaller communities can use without having to be part of a global app, so there'll be more of this kind of thing in the future.
Forĝejo
A standard forĝejo instance hosted at https://sghetti.dev. A couple of the repos here are part of the docker-compose system, but exist as their own repos, namely https://sghetti.dev/goats/rggg-org and https://sghetti.dev/goats/rggg-export.el.
rggg-org is the org-mode sources for the HTML pages on the site. It's a separate repo so that it can have a webhook that publishes any changed HTML files after a push.
rggg-export.el is the emacs lisp source for the custom export backend, so when it changes it rebuilds the whole site, regardless of what has changed.
-
Advent of Code Day 8: Playground is complete!
Went for python again today. That puts python at the top of the repo language breakdown, so I'll try to avoid it for the rest of Advent (I'll try to go for yet-unused languages or ones near the bottom of the list). But boy, do those collections and itertools simplify these kinds of problems. Shoutout to my homies
defaultdict(set)anditertools.combinations❗ Honorable mentions go tomapandsorted.Today was the easiest part 2 relative to part 1 (or maybe, tied with day 4, which I think is still my favorite so far).
-
Advent of Code Day 7: Laboratories is complete!
Finally did python today. Wasn't too bad.
-
Advent of Code Day 6: Trash Compactor is complete!
Clojure gets added to the list. I laughed out loud at the twist for part 2. It's not very fast, but I had fun doing it. It's also not very long (in bytes of source), given its brute force complexity and how long it took to write.
-
Advent of Code Day 5: Cafeteria is complete!
Did AutoLISP on this one, and it sucked. I forgot to reason about how this works again, specifically that the real problem inputs contain big fat 64 bit ints, which aren't available in AutoLISP. So I had to perform the manual gradeschool arithmetic method on digit strings.
Then it turns out the sample input doesn't cover the edge cases in the real input. So I had to do a little squint-eyed search to find someone else's test case that I could run against.
I don't feel too bad tho, as the running joke on the subreddit for today is "system ran out of memory trying to store every number".
-
Advent of Code Day 4: Printing Department is complete!
Got C out of the way today. Nothing insightful to report; just brute forced both parts with nested for loops.
-
Advent of Code Day 3: Lobby is complete!
I haven't done any rust in a while. You could say I'm a bit…rusty.
Part 1 was totally straightforward, and I kick myself for forgetting there'd be a part 2 and not immediately realizing it was going to ask for more digits. I could have just done the general solution right away.
This one even has a test suite!
-
Advent of Code Day 2: Gift Shop is complete!
Went for javascript this time (on node for CLI goodness). I figure I better get it out of the way now and save more fun languages for later more difficult problems. (Idea: one of the days should be some kind of polyglot docker compose microservice hell.)
Not much to comment on here: this one seems even more straightforward than day 1. I imagine it can be boiled down to a crazy one-liner. At least the string parsing was a little shorter today.
-
Advent of Code Day 1: Secret Entrance complete! See my solution over at sghetti.dev.
Since it's still early and simple, I went for r5rs scheme. There's something so satisfying about programming in a language with barely a standard library at all. Later, I'm sure the lack of basic facilities like reading a file line-by-line will become too annoying to deal with. But for the first problem, it was fine.
I'm toying with the idea of doing each day in a different language, but we'll see. I'd rather complete the whole thing in python than burn out trying to do day 12 in AutoLISP because I wasted all my good languages on the early days.
-
Wordle is up on the app server❗
-
First post!