Blog

  • Dude, Where’s My PR

    I don’t know how many times I’ve been working on a feature branch and wanted to quickly browse to the associated pull request, but it’s a lot. Pull Requests are a GitHub concept, so git itself doesn’t really know about them (only the branch / HEAD that is stored there).

    The gh command-line tool to the rescue!

    Once you are logged in, you can issue the following command from your project directory:

    gh pr view $(git branch --show-current) --web

    With the --web flag, the pr view subcommand will open your default browser to your PR! Leave it out and you can see info about the PR right in your terminal — even comments.

    I like to set it to an alias like this (in your bash / zsh profile config):

    alias ghpr="gh pr view $(git branch --show-current) --web"

    …so it’s easier to type and remember!

    One of these days, I’ll have to take the oh my zsh plunge.

    The gh command is supposed to grab my current branch, but for some reason it’s not (possibly related to this issue). That’s why I pull in the current branch with a tiny script.

    Yay, computers!

  • Reptile Enclosure Ventilation

    We got a Leopard Gecko fairly recently:

    Here she is in her “humid hide”

    The native habitat of the leopard gecko includes the rocky, dry grassland, and desert regions of south-Asian Afghanistan, Pakistan, north-west India, western Nepal, and some parts of Iran. …[they] inhabit arid and semi-arid areas

    I live in a humid climate, so replicating an her native environment has taken some doing

    Using a Fan to Reduce Humidity

    I bought a fan that has been helpful to improve the air flow to keep the needles on the hygrometers where they need to be:

    Here’s the fan I use on top of my enclosure: Wathai Big Airflow 2 x 120mm https://amzn.to/3LL9OMd

    I really like how the analog control lets me really dial in the fan RPMs. It moves a lot of air when I crank it up (when I add new substrate, etc.) and I can turn it down so it’s quiet when my levels are where they need to be. It comes with rubber feet to minimize the vibration and sound as well.

    I’ve tried it in various orientations, but currently have it set up outside of the screen on top of the cool side. It’s been more effective at removing moisture oriented to exhaust (blowing out instead of in) because it pulls dryer air across the heat gradient and removes collected vapor from the enclosure.

    How do you ventilate your vivarium? Let me know!

  • dodie: Tiny Desk Concert

    This was so much fun! Will definitely look up more of her stuff.

  • How To: Verify Your WordPress Site on Mastodon

    UPDATE: TIL, This code block is not needed. WordPress hides access to this rel attribute under the Screen Options drop- down under the “advanced menu properties” checkbox called Link Relationship (XFN). Better instructions are available here. For posterity, the post as published:


    I recently set up a Mastodon account (I’m @jb@hachyderm.io — follow me)!

    I noticed the “edit profile” page offers an easy way to verify that you control URLs that I add to my profile:

    A screenshot of the Verification helper in my Mastodon profile edit settings page

    This is just a hyperlink (a href tag) that includes a rel="me" attribute.

    I wanted to add a link to my new social media presence anyway, so I added a “Custom Link” to my “Social Links Menu” in the WordPress Customizer. For better or worse, the UI does not let me customize the HTML that these links end up printing on the page:

    The Custom Links input screen in the WordPress Customizer
    Only URL and Link Text are editable :-/

    I was able to quickly add the requisite attribute with this code snippet in a custom plugin:

    add_filter( 'nav_menu_link_attributes', function ( $atts, $menu_item ) {
            if ( 'https://hachyderm.io/@jb' !== $menu_item->url ) {
                    return $atts;
            }
    
            $atts['rel'] = 'me';
            return $atts;
    }, 10, 2 );

    Obviously, replace the https://hachyderm.io/@jb in the above with the link to your Mastodon profile.

    I reloaded my site and confirmed by viewing the page source / inspecting the link element that the attribute was added.

    Once this was in place, I went back to the Mastodon Edit Profile Page and clicked “Save Changes.”

    Now, my URL shows as “verified!”

    I might set up my own instance eventually, since it seems pretty easy to move and I like to tinker 🙂

    So far, I’m pretty impressed with the Mastodon new user experience!

  • Systemd Timer Calendar Validation

    I wanted to schedule a recurring action on my Linux machine recently and was reminded that timers have replaced crontab as the tool of choice. They’re really powerful, but I always have to look up how to use them.

    I edit these so rarely, I have to look up the syntax for specifying when I’d like an action to happen. The last time I did this, I came across a handy one liner to help crafting these:

    systemd-analyze calendar $CALENDAR_SPEC

    This command is useful to “Validate repetitive calendar time events”

    For example:

    $ systemd-analyze calendar "*-*-* 01/4:49:00"
    Normalized form: *-*-* 01/4:49:00
        Next elapse: Thu 2022-08-04 17:49:00 EDT
           (in UTC): Thu 2022-08-04 21:49:00 UTC
           From now: 2h 46min left

    If that makes sense for the goal of the timer, you can safely put it in an OnCalendar statement! Make sure you remember to run systemctl --user daemon-reload to pick up the changes.

    To check your configured timers, run: systemctl --user list-timers

  • Odugan Taiga by Huun‐Huur‐Tu

    Nothing like some Tuvan folk music to soothe the soul.

  • Things Are Great — Band of Horses

    New album hot off the presses and I’m really digging it!

  • Break on Through to the Other Side

    Break on Through to the Other Side

    Well, it happened. Despite being fully vaccinated the very first day I was eligible, I got sick with COVID-19. A couple of weeks ago, I started feeling off. I got the first available appointment for a “Rapid” test the next afternoon.

    (more…)