Moving From Zamrazac to Hugo

- 9 mins read

Moving over

One of my goals for my sabbatical since last November has been upgrading my blogging infra. This is now done.

I went from an old (read: Ubuntu 19 or so?) VPS running Nginx hosting static files generated by my Zamrazac static site generator to a NixOS 24.11 VPS running Nginx hosting static files generated by Hugo with a slightly-modified Poison theme (as well as self-hosted analytics via Plausible).

Why move?

My original goal with Zamrazac was “archival quality” blog posts in a language I enjoy. This turned the design space into:

Fragments from a pandemic

- 25 mins read

Embattled.

One word, neatly conveying my experiences of world and of self for near two years. What follows are pieces, images, moments, reflections–some absurd, some short, some glib, some pretty awful–on a truly bizarre time in my life.

The timeline is, to my recollection, monotonic. I cannot be certain of all, most, or perhaps any of the dates.


1.

We’re watching a dragon invade a storefront, the brazen clang and crash of cymbals causing us to wince only occasionally as we enjoy the proceedings.

Adventures in bookmark parsing

- 8 mins read

Introduction

I’m working on a bookmark manager, and one of the minor features I want is to import all my old Firefox bookmarks.

This adventure has been…an adventure.

At least one other person has tackled this problem over in Node, but I’m taking stabs at it in Elixir because that’s kind of my schtick.

On Mozilla exports

From Firefox you can have it export all of your bookmarks as an HTML file.

Book: Walkway

- 16 mins read

Introduction

Finished Cory Doctorow’s 2017 Walkaway: A Novel today. I probably still need to get my review up of Mussolini’s biography, but I kinda just want some escapism, so I read this.

The author

Doctorow isn’t a new author for me–I’ve enjoyed his Makers and really enjoyed his short story “When Sysadmins Ruled the Earth”, as well as his 28c3 talk on “The coming war on general computation. He’s something like 50 now (Wikiedpia has his birth year as 1971), and has been most prolific in the last two decades. Lots of awards, editor at Boing-Boing and frequent contributor, and generally well-regarded author.

While I was fiddling around with my weird hack project (more on that someday), I had an idea for how to use maps in Elixir.

I hadn’t noticed, but you can use more than just strings and atoms as keys…and so, I give you a quick and dirty grid implementation.

defmodule SvgWorld.Simulation.Grid do
  require Record
  Record.defrecord(:grid, map: %{})

  def init(), do: grid(map: %{})

  def insert_into_grid(grid(map: map) = g, x, y, value) do
    new_map = Map.put(map, {x,y}, value)
    grid(g, map: new_map)
  end

  def get_from_grid(grid(map: map), x, y) do
    Map.get(map, {x,y}, :not_found)
  end

  def values_in_grid(grid(map: map), start_x, start_y, end_x, end_y) do
    Map.keys(map)
    |> Enum.filter( fn {x,y} -> x >= start_x and x < end_x and y >= start_y and y < end_y end)
    |> Enum.reduce( %{}, fn(key, acc) -> Map.put( acc, key, Map.get(map, key) ) end)
  end

  @spec values_near_point_in_grid({:grid, map}, any, any, any) :: any
  def values_near_point_in_grid( grid(map: map), x, y, radius) do
    Map.keys(map)
    |> Enum.filter( fn {gx,gy} ->
      dx = gx - x
      dy = gy - y
      (radius * radius) >= ((dx*dx) + (dy*dy))
    end)
    |> Enum.reduce( %{}, fn(key, acc) -> Map.put( acc, key, Map.get(map, key) ) end)
  end
end

You can’t do reverse lookups, but that’s an easy enough addition you can make to this.

1 Weird CSS Trick

- 3 mins read

Introduction

Before we get into anything else, please behold this gross hack:

<html>
  <head></head>
  <style>
    @keyframes spin {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }

    .spinny {
      width: 100px;
      height: 100px;
      animation-name: spin;
      animation-duration: var(--theta);
      animation-iteration-count: infinite;
      animation-timing-function: linear;
    }
  </style>
  <body>
    <h1>Animation demo</h1>
    <div style="" class="spinny">:(</div>
    <div style="--theta: 4000ms" class="spinny">:)</div>
    <div style="--theta: 2000ms" class="spinny">:D</div>
    <div style="--theta: 500ms" class="spinny">XD</div>
  </body>
</html>

Please load this into a file and view it on your local machine.

Sailing the glass sea

- 13 mins read

(Disclaimer: I am not now nor have I ever been a sailor. I hope my meaning survives my nautical ignorance–if not, please email me and I’ll see what I can do. I’ve probably also made some errors in the ecology as well.)

I.

You wake up in your cabin, stretching up from your berth and groggily gathering your morning routine–the tea, the water, fresh clothes, perhaps a shave. The sun lazily crawls up through the windows and slowly slides down the wall as you rouse yourself.

On Slack and Software Teams

- 13 mins read

Introduction

I’ve worked at several companies that had some remote component for collaboration. Sometimes that meant Slack, sometimes Google Chat, sometimes something else, but the experience has given me some thoughts on what works and what doesn’t work. I’ll focus here on Slack (or similar product) practices.

Some of this stuff is aimed at anybody who uses Slack, some of it is aimed at people who are organizing teams–there is hopefully something here to help everybody.

Where I'd like to work

- 9 mins read

Introduction

A thread on Lobsters got me thinking…what would I want out of an ideal emplyoment situation?

Since I am cheerfully funemployed as of August, I figure I have the time to delve into this a bit. This is all dreaming big; I am under no illusion that any place like this actually exists. It’s naive, but after a decade in industry I think it might be nice to take a break from pragmatism. And yeah, some of these are not the way I live my life currently for one reason or another.

Comfynets and owning data

- 9 mins read

Introduction

I’ve been looking more and more at the ideas behind building comfynets–small self-hosted collections of tools and pages for communities. I’ll probably do a writeup on the sort of stuff I’d like to see in one.

Anyways, one of the bits of fallout from a backchannel I sysadmin involves the custody of data. We’ve got a chat instance setup which supports persistent messaging and so forth, but it’s backed by a database. I am currently the only one who has access to said database and I’m eventually going to be handing the whole mess off to somebody else in the community to deal with since I don’t want the responsibility anymore. Anyways, that’s a second tangent and writeup.