Long Form Posts

    Half Measures

    I’m coming to realise that one of my shortcomings is not completely following through on a task. I’ve got a habit of only doing enough to get it done quickly, knowing that the work has cracks in it and just hoping that things won’t fall through them. There are a few reasons for this and there the one’s that you expect: laziness, boredom, pressure to get something finished, wanting to move onto something else, etc.

    As you can expect, I get burned by this. And over the last several months it got to the point where it was starting to becoming a noticeable problem. So, I adopted the following rule: “no more half measures”1. If I’ve got a task to do, the I do the whole task.

    I broke that rule a few days ago. With the pressure to get something out the door, I finished the work knowing that there existed a case where it wouldn’t work properly. I was hoping to address this over the next week or so, and was not expecting (or hoping, to be more accurate) that this shortcoming will show up.

    Well, today it did. Fortunately it was just in testing but sure enough the shortcut came back to bite me, and now I’ll need to fix it.

    I guess it’s a good opportunity to reset and take this rule seriously once again.


    1. HT to Hank in Breaking Bad. ↩︎

    Day Trip: Macedon And Trentham

    I had the pleasure of taking the day off today and going for a few walks around Macedon and Trentham. Being someone that’s really into keeping with a routine, I try to do these walks at least once a year. It’s been somewhat delayed this year, due to work commitments, but with the public holiday tomorrow, I thought I was a perfect time to get outside and do them before summer rolls around.

    Below are some photos of each of the walk.

    Macedon

    The first walk was along the borders of the Macedon Regional Park, following a self-plotted course, more-or-less, along the Bendigo railway line. It’s a little difficult at times, maybe bordering on dangerous (and possibly not super legal either), so I’d probably wouldn’t recommend this. But since it follows the rail line pretty much the entire time, it’s a good opportunity to catch up on some train spotting.

    I realised today that it’s been 10 years since I first walk this particular trail. I’m wondering if it might be time to retire it. As nice as it is, there are certain aspects of it that are getting a little tiresome. Plus it’s always boggy, even during the height of summer, meaning that you’ll usually get your socks wet and your pants dirty when you walk it. Even so, walking it is always a pleasure.

    Trentham

    Following a brief lunch in Kynteon, it was time for the second walk: The Domino Trail in Trentham. This is a rail trail that travels through some really nice forest. Last time I did this, more than a year ago, the path was closed as a severe storm brought down a number of trees and I was unable to do the entire path. Fortunately the trees were cleared and the path reopened.

    I caught the rain a few times and much of the track was quite boggy given the decent amount of rain we’ve received, but overall, it was a nice day out.

    Opinionated Tips for New Micro Bloggers Coming From Twitter

    or, How I Use Micro.blog

    To all new-comers from Twitter, welcome to Micro.blog!

    No doubt you’ve received the welcome message from Jean with links on how Micro.blog is different from Twitter, but you’re probably still wondering how to get the most out of Micro.blog. And while I’m not claiming to have all the answers, I’ve put together a few tips for how I get value from writing here.

    First, the thing that took me a while to appreciate is that Micro.blog’s not so much a social media platform, at least not in the traditional sense. I mean, it certainly can be described as one, and if your goal is to connect with others online, it works just as well as any other. But in essence, it’s closer to a blogging platform, albeit one with social aspects tied to it. When you write a post, not only would it appear in the timeline of those that follow you, it will also appear on your own blog. So an option before you is to lean into this. Treat your blog as your own space on the web. Get a domain name and share it with others. Style your blog as much or as little as you want. Take a look at the plugins to see what you can add to your site. You don’t have to do this right away, but it’s well worth considering if you hope to get the most out of writing here.

    Second, write naturally. You’re not feeding an algorithm here. There’s nothing like trending topics or recommendations that takes what you write and throws it around the network. Instead, you’ll get something better: real humans reading and replying to your post. So write for humans. If a post needs to be longer than 280 characters, then it can be: no need for threads here. Also, adding hashes in front of words does nothing other than make what you write harder for others to read.

    Finally, write for yourself. The cheap endorphin rush you use to get from likes and retweets will never come, so you’ll need another way to get pleasure from writing here. What works for me is to write for myself. If I write something, I do so with the expectation that no-one else will see it. Of course, you’re writing on the open web so others can certainly see it: try not to be too much of a jerk. But even if no-one else does, as long as I get something out of what I write, that’s all I ever need.

    Of course, how and why you use Micro.blog is ultimately up to you. After all, you are the one paying $5.00 to use the service (and yes, in this case, you are the customer here, not the product). So make sure you use it in a way that works for you. And it may take a while before you find the utility you’re looking for. I’d advise patience here. You will not find the short-term rush you’ll get from Twitter. Before you is a slower path. But it’s one that can lead you towards a much better and fulfilling experience of writing online.

    Happy blogging.

    Technical Knowledge Management Update

    Finished the first pass of moving all my technical knowledge into static Markdown files. I’ve got all the files now in a Git repository hosted on Github. They’re also published as a website called TecKnow Space (pronounced “techno space”)1.

    The way I’ve done this is by writing a tool I which will checkout the source Git repository, iterate over all the source Markdown files, render them as HTML, and push them to another Git repository which is being served using GitHub pages. The tool, which is currently not open-source, was written in Go and uses go-git for the Git client, and BlackFriday as the Markdown renderer.

    The output is just a directory tree of HTML files. I did consider Hugo for a brief moment, but I wanted to avoid the complexity of including a base Hugo site here, especially given that the main reason for using Hugo is for the themes. That did mean that I had to write a tool to do this, but my thinking is that if I decided to move to Hugo, I still need something to iterate over all the Markdown files anyway, since they’re stored in a different structure than the content of a Hugo site. And some small modifications to the tool would could be made to make that happen.

    At the moment, I need to run the tool manually to regenerate the site. But, ultimately, I’d like to setup Github’s CI/CD to re-render the source files when I push changes to main. That, plus styling and optimising how I organise this information, will probably be the next step I tackle.


    1. One of those names that worked off the bat, and I grin whenever I say it. ↩︎

    Some Links To Motivational Posts That Help Me

    This post contains a bunch of links to posts and articles that motivate me in some way, either with blogging or working in public. Sometimes I feel down or self-conscious about the types of posts I make, or not posting anything at all, and I like to revisit these occasionally to help me keep it up.

    Many of these come from members of Micro.blog. To those that shared it, thank you!

    About blogging

    About development

    About working in public

    About persistence

    About other things

    I’ll update this post with any more I find along the way.

    Option Currency Symbol Reference

    A small, incomplete reference of the various currency symbols that can be produced using the Option key. Here because I always forget these, and I’ve been needing to produce these quite often lately.

    Currency Symbol Key
    Dollar $ $
    Cent ¢ Opt4
    Pound £ Opt3
    Euro ShiftOpt2
    Yen ¥ Opty

    An Alternative To The Reply All Idea For Micro.blog

    Just thinking about Micro.blog conversations and the discussion about having a way to reply all. I wonder if a better alternative is to be able to “follow” conversations, with new replies from anyone showing up in the timeline. This can be completely opt-in per conversation — including for posts that are made by you — so that those that want the old way to continue working as is don’t loose anything.

    It has one other advantage: I’ve seen conversations in Micro.blog that I had no real interest in participating in (usually because I have nothing to add) but I was interested in following along. Usually these are people asking for recommendations, and others post theirs as replies. Being able to “subscribe to new replies” would allow me to get updates to these as they come in, rather than have me check-in on the conversation thread every hour or so.

    Anyway, that’s the idea. Let me know what you think.

    The (Annoying) Way To Get the Current MacOS Appearance Scheme From the Command Line

    Ok, here’s something bizarre.

    I’m trying to get the current MacOS appearance scheme — either light or dark mode — from the terminal. The way to do this is by running this command (source):

    defaults read -g AppleInterfaceStyle
    

    If MacOS is in dark mode, this will print Dark. But if MacOS is in light mode, the command will print… an error:

    2022-10-04 09:15:18.058 defaults[35844:466643] 
    The domain/default pair of (kCFPreferencesAnyApplication, AppleInterfaceStyle) does not exist
    

    Running defaults read -g confirms what the error message says: the AppleInterfaceStyle key is not set when MacOS is in light mode.

    Why was this chosen as the way to do things? Now I need to capture and parse stderr just confirm that the reason an error occurred was because MacOS is in light mode; as oppose to some other, possibly legitimate, reason.

    A tad annoying I must say.

    Photos of Lake Tuggeranong

    This morning I went to Tuggeranong, south of Canberra. After a cafe breakfast I took a walk around the lake. It was a lovely spring morning for it: cloudy, mild but slightly on the cool side. It was also quite a decent walk: probably took an hour and 20 minutes, and I didn’t even cover the entire lake. All in all, a nice way to begin the day.

    The Australian Republic Question

    With the passing of Queen Elisabeth II, the talk of whether Australia should become a republic will probably start making the rounds once more. I don’t consider myself a royalist, and when the last referendum on the issue came around, I voted in favour of becoming a republic. The idea of having the British Royal Family as the head of state of a country halfway around the world seem anachronistic to me, and I was disappointed when the referendum failed.

    Since then, my position has been become slightly more nuanced. I still believe in the ideals of becoming a republic — in being a country that is more-or-less completely self governing. But after reading this article from Vox.com, I’ve come to see some benefits of having a head of state that is removed from the day-to-day politics of government. Sure, the stability from such a figurehead may not have been wholly constant, but that “lack [of] semblance of legitimacy” that comes from the royals being the head of state does provide some reassurance. One less divisive thing for people to think about when that position changes hands.

    So if the referendum was held today, which way would I go? I’d probably still vote “yes”, but it would have a “can we make it such that the office is not in any way marred in the politics of the day?” qualifier attached to it.

    Then again, I talking about the terms of a theoretical referendum where the proposed system is more than just replace-the-monarchy-with-a-president. Such concerns regarding the division of power might already be settled within the constitution. I really don’t know: might be worth looking up if the question were to come up again.

    Either way, we’ll see which way the winds blow.

    Detecting When GetItem On DynamoDB Returns Nothing

    I was trying to remember how best to detect when a GetItem call to DynamoDB returns no values. That is, when there’s no item with that key in the table. This is in a project that is using v2 of the Go AWS SDK.

    After poking through some old code that did this, it looks like the way to do so is to check that the returned Item field is nil:

    out, err := p.client.GetItem(ctx, &dynamodb.GetItemInput{
        Key:       key,
        TableName: tableName,
    })
    if err != nil {
        // Error getting the item
        return nil, err
    } else if out.Item == nil {
        // No item found
        return nil, nil
    }
    
    // Do the thing with out.Item
    

    Ok, I can live with this approach. I’m kinda happy that I don’t need to check the error message, since doing so using the Go AWS SDK is a bit of a pain.

    Some Photos of The Yarra Trail

    Went for a very short walk of the Yarra Trail around Heidelberg on Saturday. The evening light was really lovely so I though I’d take some photos.

    Milestone

    For a while, I’ve been trying to maintain a writing streak. I need to write at least one blog post or journal entry a day. Today that streak has been maintained for a full year.

    I will admit that the streak was not completely continuous: I had to go back a few times and retroactively add a post. But even so, I’m quite please with reaching this milestone. Onward to the next one.

    Some Things I Found Out While Browsing a Substack Newsletter in The Wayback Machine

    I did a quick search for that blog post in the the Wayback Machine. I couldn’t find the post but the Substack newsletter was there. I guess Substack does allows archiving of newsletters with the “substack.com” domain after all (if it’s something that they can even control).

    Anyway, here are a few things I’ve found out while browsing through a Substack newsletter in the Wayback Machine:

    • Clicking “Let me read it first” works: it slides away and the most recent posts show up. Guess it’s just a simple HTML overlay blocking the home page.
    • Open all links in a new tab. Just clicking them will run some JavaScript which, I guess, tries to load the post directly from Substack, resulting in an error if the newsletter is taken offline. Opening the link in a new tab will get the post directly from the Wayback Machine.
    • Clicking the archive tab seems to bring up the blog archive briefly, but then some JavaScript — which I guess is trying to load the archive from Substack? — replaces it with an error (why does everything need to be JavaScript?!) I’m guessing that the actual HTML is still there so it might be possible to get it if you disable JavaScript. I haven’t tried this though, so this is only a hypothesis.

    As for the post itself, it turns out that it was in my Feedbin archive all along, so the search in Wayback Machine wasn’t actually necessary. Now the trick is to find a way to prevent Feedbin from purging old posts. 😳

    Rebinding Keys For Quickly Resolving Conflicts in GoLand

    I’m dealing with a lot of conflicts today as I try to clear a backlog of Git rebases in my to-do pile. I’ve been using GoLand to do this, as my current Git “mergetool” is configured to Vimdiff for some reason1 and I’m not really bothered to find some other tool, at least not yet. GoLand does a pretty good job.

    Unfortunately, the default key-bindings for resolving conflicts in GoLand is far from good. About the quarter of actions are bound to keys that make sense. Half the actions, like ignoring hunks, are not bound to anything, while the last quarter are bound to keys that result in a suboptimal experience. For example, the key to accept changes for a delta use the arrow keys, whereas the key to go to the next delta is F7. What a strange default. I’d have to constantly move my hand off the arrow keys over to the Fn row if I want to go through and fix each delta. This, plus moving over to the mouse to select an action not bound to a key, makes resolving conflicts really slow.

    Fortunately GoLand allows remapping keys to pretty much anything, so I’d figured it’s time to fix this problem. I set about coming up with a nicer key-mapping scheme for resolving conflicts. I wanted to come up with one that adhered to these principals as best it can:

    1. My hands must not move from where they rest on the keyboard for almost the entire time a file is being worked upon. The only exception are actions that are invoked less frequently and have a large radius of change — such as the accepting all changes from the left or the right. I’d figured it’s still okay to use the mouse for those.
    2. The arrow keys should be used for navigation (go here) and for addressing (this one).
    3. The modifier keys should be used for choosing the operation, such as going to the next delta, or choosing or ignoring a change.

    Here’s the key-map I’ve come up with. The actions marked with an asterisk were the one’s that I needed to change. All these actions are within the “Version Control Systems > Diff & Merge” group within the “Keymap” section in preferences.

    Action Key Binding
    Previous Difference * ^
    Next Difference * ^
    Previous Conflict * ^
    Next Conflict * ^
    Accept Left Side ^
    Accept Right Side ^
    Ignore Left Side *
    Ignore Right Side *
    Confirm Merge Enter

    I’ve only tried this out as part of a single rebasing session, but already it feels so much faster. It’s taken me probably half the time to go through each file now, maybe even better. I also like the fact that most of the time I only need to hold down Ctrl and Cmd key, and use the arrows to move to and accept changes. Ignoring a change involves moving my left pinky to the Shift key, adding a bit of resistance to indicate an action that requires just that little bit more care.

    We’ll see how this goes as I deal with future conflicts, and I may make a change or to. But this is looking really promising.

    One last note: this was done in GoLand but I’d imagine it’s possible to set this key-mapping up in most, if not all, of JetBrain’s other IDEs.


    1. It was previously something else, and I have no idea how it got changed. ↩︎

    Turning Off Shared Command History in Oh My Zsh

    TL,DR: add “unsetopt share_history” to your .zshrc file

    I’ve been using Oh My Zsh at work for a few months. As far as terminal config managers go, this one works pretty well. But the default configuration does include something which I found quite annoying.

    First, a few words on how I use the terminal. I’m in the terminal constantly in my day to day. At the start of the day, I’m creating terminal tabs and running commands to do things like build the project I’m working on, start a testing session, etc. This all starts very ad-hoc, but over time these tabs take on a particular role. I may run make and git in the left-most tab, run tests in the tab next to that, have logs tailing in the one after that, etc. As I start and stop commands in each tab, they all build up a different history, which is usually visible in the terminal output itself. Eventually it comes to the point where in order to run a particular tool, I simply need to switch to the particular tab and press one or two times to get to it.

    Installing Oh My Zsh broke this workflow. Out of the box Oh My Zsh enables shared command history across each session, meaning that the commands recalled when pressing are the last commands executed in any tab. This meant that when going through the history, the recalled command would be different from the ones that I’ve entered in the tab I’m in. In addition to this resulting in pressing way more times than I used to — sometimes to the point where I gave up and simply typed the command out again — it also meant that the recalled commands differ from the ones I saw in the tab output itself. This was very jarring.

    Fortunately, this feature can be turned off simply by adding the following to your .zshrc file.

    unsetopt share_history
    

    I did just this and my old workflow was restored.

    I don’t know why shared command history was chosen as the default. Am I in the minority using the terminal this way? Maybe. But I know for certain that this group is larger than a single person. In either case, I’m glad that I was able to disable this “feature”.

    Kyneton Botanical Gardens

    Went to Kyneton with Mum and Dad today. While they went off for a bike ride, I had the opportunity to go for a walk around the botanical gardens. This was my first time there, and although the gardens themselves were not very big, it was still a pleasant experience. Here are some photos I took of that visit.

    This was followed by lunch at Little Swallow Cafe. The place was quite busy — I suspect that their reputation is such that it would be busy most of the time — but the food was very nice. We then went for a short walk around Kyneton and then drove to Malmsbury for a coffee and Devonshire tea.

    It was a little cold but the rain held off. All in all, a good day for it.

    DynamoDB JSON Attribute Types Quick Reference

    Because apparently it’s too difficult for AWS to provide an easy way to find this information.

    Atomic Types

    Type JSON Value
    Binary B String value containing the Base64-encoded binary data.
    Boolean BOOL Either true or false
    String S String value
    Number N String with the numerical value
    Null NULL Should always be true

    Collection Types

    Type JSON Value
    List L A JSON array, with each element being an attribute with a type.
    Map M A JSON object, with the keys being the map keys, and the values being an attribute with a type.

    Set Types

    Type JSON Value
    Binary Set BS A JSON array of Base-64-encoded binary data.
    Number Set NS A JSON array of string with the numerical values.
    String Set SS A JSON array of strings.

    Sources:

    More Complaining About Autocorrect on MacOS

    Earlier this morning:

    Me: (writing in my journal) Nonna, my 91 year-old grandmother…

    Autocorrect: Did you me “Donna”?

    Me: No, undo change. (continue writing) good news is that Nonna…

    Autocorrect: Did you me “Gonna”?

    I can forgive MacOS for considering nonna a spelling error, since it’s not an English word.

    But I do see why auto-correct on MacOS can be frustrating. Apart from the two completely random corrections it made for the same word, it also doesn’t seem to get the hint when I undo the change. I would have thought that action is a pretty strong signal from the user to just leave the word alone, at least for the moment.

    Write It Down

    I am feeling some very minor after-effects from the booster I took yesterday (nothing serious, just the expected cold-like symptoms). I was curious as to whether it was anything like I experienced in January, when I got my last booster. I went to my journal to see what I wrote about it. Unfortunately for me, there was nothing there.

    To be fair to my past self, there were some other events going on at the same time which I did write about. But I was left pondering this morning about why I didn’t write anything about how I was feeling back then. My guess is that I probably didn’t think it was worth writing about at the time. “Feeling a little off” was probably something that I thought was quite trivial, and wouldn’t be relevant later on.

    I was wrong: it was relevant. Otherwise I wouldn’t be going back in time to find out.

    I guess there’s a lesson there: write it down. Write everything down, even if you think it might not be relevant at the time. The simple fact is you don’t know. It may very well be relevant months or years from now. Better to written down too much than not have anything written at all.

    Of course the trick is working out what “everything” consists of. If you’re writing down what constitutes your daily routine each day, I’d imagine you’ll be spending most of your time documenting the same thing over and over again. I guess a good decision process is if you’re unsure about particular thing, then it’s probably a good idea to just write it down anyway. You may think it’s unnecessary at the time, but again, you don’t really know.

    I’ll try to get better at this myself. In fact, part of this post was taken from this morning’s journal entry, just below a description on how I was feeling today.

← Newer Posts Older Posts →