A meritocracy reading list

Meritocracy has been on everyone’s minds lately, it seems. Reading Daniel Markovits' “The Meritocracy Trap,” I was fully ready to condemn the concept completely. I may be still; but I need to take a moment to think about it more fully.

Here’s the problem with condemning meritocracy outright: if we look at ability on a case-by-case basis, would you rather a well-trained, accomplished pilot or a mediocre one? Would you rather go to a concert performed by a scratchy third-rate violinist or someone whose pedigree includes Juilliard, Curtis, or the like? Maybe the problem with meritocracy is simply that it doesn’t scale well in capitalist markets. (Don’t hold me to that idea; I’m not quite ready to embrace it fully.) In the process of scaling to the level of a large society, does any inherent rightness of merit confer a right to so distort the economic life of a country that only narrower and narrower slices of it garner larger and larger portions of the economic output?

In the meanwhile, I’m just cataloguing what references I can find on meritocracy while I formulate a more informed opinion.

A folder-based image gallery for Hugo

Hugo is the platform I use to publish this weblog. Occasionally I have the need to include a collection of images in a post. Mostly this comes up on other sites that I publish. Fancybox can do this; but it wasn’t immediately clear how to direct Fancybox to create a gallery of images in a page based on images in a directory. Previously, I’ve solved this in different ways, but I was anxious to find a simple shortcode-based method.

Eventually I settled on this shortcode foldergallery but I quickly discovered that it must be based on a site configuration that is different from mine. Furthermore, the way it configures paths into the image source directory seems to be localized to Windows. If you run Windows, it undoubtedly works fine, but I had to do some modifications to get it to work on macOS, mostly changing the code that constructs the paths to the source directory of the images.

<!-- /layouts/shortcodes/foldergallery.html -->

<style>
    div.gallery {
        display: flex;
        flex-wrap: wrap;
    }

    div.gallery a {
        flex-grow: 1;
        object-fit: cover;
        margin: 2px;
        display: flex;
    }

    div.gallery a img {
        height: 200px;
        object-fit: cover;
        flex-grow: 1;
    }
</style>

<div class="gallery">
    {{ $path := print "static/img/" (.Get "src")  }}
    {{ $url  := print (.Get "src") }}
    {{ range (readDir $path)  }}
        {{/* don't try to display .DS_Store or directories */}}
        {{ if and (ne .Name ".DS_Store") (not .IsDir)  }}
            {{ $src := print "/img" "/" $url "/" .Name }}
            {{/*
                troubleshoot the $src variable as needed
                <!-- <p>{{ $src }}</p> -->
                */}}
            <a data-fancybox="gallery" href="{{ $src }}">
                <img src="{{ $src }}">  <br/>
            </a>
        {{ end }}
    {{ end }}
</div>

I’ve also published this as a gist.

In order to use the foldergallery shortcode, you’ll need to install it in /layouts/shortcodes. You will also need the following in your head partial:

<!-- IMPORTANT: Remove any references in older versions of jquery -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.4.0/jquery.fancybox.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.4.0/jquery.fancybox.min.css" />

Now, in order to publish a gallery of images from a directory we just need:

which will pull images from static/img/news/asi.

An alternative method for keyboard input switching on macOS

macOS offers a variety of virtual keyboard layouts which are accessible through System Preferences > Keyboard > Input Sources. Because I spend about half of my time writing in Russian and half in English, rapid switching between keyboard layouts is important. Optionally in the Input Sources preference pane, you can choose to use the Caps lock key to toggle between sources. This almost always works well with the exception of Anki.