1. 3

    I also like adding a toggle interface on the page, which saves the value to localstorage in case the user prefers one or the other. At that point, I just override the prefers-color-scheme logic with the saved value in Javascript if needed.

    Coincidentally, I did this to my blog yesterday – here’s the dark mode logic.

    1. 2

      Ah nice, thanks for this! I’ve been thinking about implementing something like this also. This will save me some time. :-)

    1. 6


      It’s a Jekyll site hosted on Netlify. Soon it’ll be a Nuxt site hosted on Netlify. I feel like everyone found this out a while ago but I’m shocked by how natural it feels to write a site using a component-based architecture – now the default CSS paradigm of having a single, flat, global namespace feels so awkward.

      1. 1

        I really expected Notion to show up in one of these responses. Maybe it’s not quite the thing for the Lobsters crowd, but it seems to fit exactly this role: it apparently can set you up with a personal wiki, daily journaling, and project management stuff really well. I haven’t used it myself, but I keep hearing that it’s pretty good – I’m just kind of afraid of the total buy-in it seems to require.

        1. 2

          I’ve tried Notion before. Although I like the tool and constantly hear about it from others, I think it suffers the longevity problem (checkout the longevity statement from standard notes). Last i checked sync to a google drive or dropbox is missing, and their export to markdown is super basic at the moment with a lot of issues.

          1. 2

            For sure. That was part of my thinking when I was trying out Notion too – I have to take the time to set it up, and then I have to truly believe that it’ll be the right thing for me long-term. Evernote’s slow demise has sort of eroded my trust in proprietary brain-dump tools.

            longevity statement from standard notes

            Here’s the link for anyone who, like me, hadn’t heard of this before.

        1. 1

          I do this too. I ran git init in my home folder at some point.

          I have the star at the top of my gitignore, but I’ve also forced certain files to be tracked like this:

          <and then like 12 more files or directories>

          There are some downsides to having your home directory being a git repository; namely, my bash prompt, which shows git status, always defaults to my home directory if I’m not in a different repo. Every once in a while I end up running git commands on a directory that isn’t itself a git repository, so I end up accidentally performing that action on my home directory instead. Oops.

          1. 3

            I did a git clean once too often on my home directory, so I decided to wrap git in a function that checks for the existence of a .git-noclean – if this file exists, then the clean command is ignored.

            1. 1

              This is a cool idea. Is the exact wrapper published somewhere?

              1. 2

                Nope, but here’s the function (in fish shell syntax):

                # hub, also, put a belt-n-suspenders thing over our git-clean 
                # susceptible homedir
                function git
                        if test $argv[1] = "clean"
                                set git_base (git rev-parse --show-toplevel)
                                set ignore_file $git_base/.git-noclean
                                if test -f $ignore_file
                                        echo "JFB: cannot clean $git_base (ignore file exists)"
                                        return 1
                        hub $argv
          1. 4

            I recently finished and set up project that reminds me about saved Pinboard links with exponential backoff: link. Inspired by a talk by Andy Matuschak I saw recently where he talked about how he gets a lot out of journaling prompts that come up with a similar cadence, and how that helps him build up a library of his ideas around a topic.

            I’m also working on a web search interface and indexer built with Rust and WebAssembly: link. It’s built for static sites with lots of different pages, and the idea is that the indexer precomputes a search index at the site’s build time, then the WASM part can search through that index really really quickly. This is a project I hope to capital-p-Publicize, and I’m hoping I can spend some time this week to polish it off beforehand!

            Work is lots of docs cleanup and small bug fixes, etc.

            1. 3
              • Setting up a PiHole!
              • Working on an iOS app for a side project.
              • I got a bike with clipless pedals last weekend. I now need to go figure out how to use clipless pedals.
              1. 5

                love chunkwm! been using it for about 8 months now.

                if you want to have focus follows mouse with autoraise, like x windows, use chunkwm in float mode. voila! beautiful, even if you don’t care about tiling window managers.

                1. 2

                  Does it work well with multiple monitors? I was exploring Phoenix recently and I don’t think there was a way to move a window from one monitor to another.

                  1. 3

                    it does! here’s my .skhdrc key bindings for moving windows around to monitors:

                    shift + alt - 1 : chunkc tiling::window --send-to-desktop 1
                    shift + alt - 2 : chunkc tiling::window --send-to-desktop 2
                    shift + alt - 3 : chunkc tiling::window --send-to-desktop 3
                    shift + alt - 4 : chunkc tiling::window --send-to-desktop 4
                    shift + alt - 5 : chunkc tiling::window --send-to-desktop 5
                    shift + alt - 6 : chunkc tiling::window --send-to-desktop 6
                1. 3

                  Jeffrey Way, a major contributor to the Laravel community, has been tweeting about this lately. I think his overarching point is that when we spend too much time thinking about how to write a perfect unit test for a given piece of code and not a perfect test overall, we get trapped in thinking about the specific boundaries between unit/functional/integration and not thinking about how best to test the code we write.

                  1. 8

                    The timed (or dynamic) wallpapers in macOS Mojave also use the azimuth of the sun to try to mimic the day/night cycle you see outside on your computer.

                    Marcin Czachurski spent a lot of time (1, 2 and 3) reverse engineering the file format – it’s based on an HEIC container, I think.

                    In my experience, it’s not all that accurate – the sun sets much faster outside than on my computer.

                    1. 2

                      That’s interesting. I guess the ultimate in wallpapers would be to raytrace the desktop wallpaper with accurate lighting as Earth rotates and revolves around the sun.

                      1. 4

                        I remember using xplanet to do something like that like 10 years ago. It would set my X background to a map with accurate day and night indication. I wish there was something like it for modern high resolution screens.

                        1. 3

                          I used xplanet to show me a view of Mars. I can’t remember whether it was rotating in realtime or not… I believe it was. Fascinating piece of software, which I don’t think ever made it off Linux.

                          1. 3

                            I’d forgotten all about xplanet. Thanks for that trip down amnesia lane!

                          2. 3

                            This sounds like a job for WebAssembly.

                            I’m only half-joking. It sounds like a method that could work, compiling one of those business card raytracers into a program that draws your wallpaper without being able to do arbitrary I/O. Better than Windows .scr screensavers, which are literally just executable complete with the ability to do arbitrary system I/O (so many old viruses pretended to be screensavers…)

                            1. 1

                              There is a project offering 3D animated wallpapers, named livewallpaper.

                              Check out the livewallpaper package if you are using Arch Linux.

                        1. 2

                          School starts back up again this week, lots of brainpower devoted to that.

                          I’ve been working on a thesis about machine learning, and noticed a disappointing lack of tutorials for using the TensorFlow Object Detection API. I’m currently in the process of writing the tutorial that I wish already existed about the topic.

                          1. 2

                            The Refactoring UI link in the end of the article sums up the point nicely, while giving a different suggestion for how to generate color palettes for application design:

                            It’s not uncommon to need as many as ten different colors with 5-10 shades each for a complex UI.

                            He starts with grays, then identifies meaningful colors that should also be part of the palette (colors like red/green/blue that have semantic meaning associated).

                            And while he spends the first part of the article railing against color scheme generators, it doesn’t seem like a terribly difficult challenge to build a color scheme generator based on the principles he presents: Pick a brand color, a tint of gray, and a few other hues and it generates a bunch of nicely aligned shades across the lightness spectrum.

                            1. 2

                              I’m working on a thesis about synthetic neural network training data for school. I spent the fall thinking about the theories and use cases of my project, and I’m planning on doing some actual synthetic vs. real training data comparisons in the spring. That means in the winter I get to figure out as much of TensorFlow as fits into my use case: this is proving to be tricker than anticipated. I have lots of time this week to learn, so I’ll be hunkered down studying.

                              I’m also writing a Markdown to HTML transpiler in Swift (a language with complicated string behavior and limited regular expression abilities). I fixed some issues with my rules engine last week, and this week I want to knock out a few more individual rules.