I created Echoes, in part, to write about stuff I don’t think is being aired in mainstream media, be that tech media or even truly mainstream ‘rags’. Today’s first topic is a classic example of this. I thought the second topic fitted too (it is certainly not discussed in the terms I have used) but really it’s about when I realised I was being dumb.
There’s a very popular Mac application called TextExpander which I hear a lot of tech podcasters talk about in hallowed tones. I, too, am a long time user. But there is one aspect that has always confused me that never really gets discussed in detail, at least that I’ve heard. That is the configuration of delimiter characters. Even TextExpander’s own documentation only glosses over the subject.
I followed my friend Allison’s approach to use a semicolon, for the simple reason that I don’t, as she doesn’t, know what to do with a real one. But in that case, snippets such as those to correct accented words won’t work unless you specifically type your delimiter. So typing “cliche” won’t get you “cliché” automatically — you have to type “cliche;” which requires some thought to invoke.
What if you use a space as a delimiter? Then you can simply type “cliche “ and get “cliché “ as you’d hope, but what about true abbreviations such as my “wn” for “Wellington”? If I have a space as a delimiter then typing “down “ gets me “doWellington “. This suggests I carefully pick my abbreviations to be non-common letter combinations. But… why should I have to tiptoe around these?
It then occurred to me I could simply set up my abbreviation as “wn;” but even then I would have to type “wn; “ (including the space delimiter) and that seems unnatural to me as I expect the semicolon to be the trigger point and it no longer is, as the space needs to be typed.
Thinking further, you can turn off the delimiter requirement entirely. This means I can have “wn;” expand to “Wellington” immediately without endangering “down” and “cliche” is instantly “cliché”… but… what about “expose” versus “exposé”? With a hard delimiter like a semicolon this isn’t an issue, you just type “expose;” and you get the accent or “expose“ and you won’t, but then you lose all the other benefits described of not having a hard delimiter.
So finally I get to this point: the number of examples like expose/exposé are small and will just require some kind of affordance like typing “expose’” to get the accented word (and indeed this is what the public TextExpander group of accented words has). With that in mind I recommend this approach. Turn off your delimiter, and then manually add it to those you think need it — which in my mind is abbreviations — and leave it off where it doesn’t make sense — on corrections.
While nutting out this problem I looked for what I thought would be the obvious answer — per group delimiters — but sadly this is not an option.
The above text is adapted from a post I made in Allison’s Slack group and so I will leave the final words to her which were included in her response to my thinking out loud.
Guess it’s whatever you get used to that works?
When Code is Content
Docker is a cool technology that I’ve read up on, watched videos about, and have even played with a bit. I get it. I totally understand the point of Docker. But as I came to understand this point, and looked at how I might leverage it, I became stuck on a critical issue. I’ll try to make this brief.
Docker is about setting up a kind of lightweight “virtual machine” (if you know Docker, don’t berate me for that description please — I’m trying to keep this simple). The key things are that Docker containers are lightweight (said that) and transient. In a high volume distributed workload, for instance, containers may be created and destroyed often to meet changing demands. In other words, don’t do anything to a container. Rather, you should do things to the image that the container is spawned from. An image is essentially a template for creating containers.
Fire up an Apache container (you can externally store the configuration and ‘attach’ it to the running container), fire up a MySQL container (a little more complex as you need to attach the database storage), and finally fire up a PHP container (this can be handled by Apache but it’s better to be its own thing). Now where does WordPress go? In a container? No, it’s not really “a thing” on its own, it’s software that is loaded by Apache so it should go inside the Apache container. Except, NO! WordPress updates itself and that means doing stuff to a container — a big no-no. Updates should be made to images and then new containers spawned from them. I got stuck on this point for quite some time. How do you live update an image? It seemed impossibly difficult to do well.
The problem, I eventually came to realise, is that while WordPress is software, it is also content, and it’s that latter role that is important in the context of Docker. I struggled for a while until I realised that while Apache and MySQL and the PHP engine are all code that runs on the server, WordPress is not — it’s code that runs inside the PHP engine, on behalf of Apache. As such, it’s not really code from the server perspective at all, but rather content.
With this view in mind, the WordPress code in a filesystem is functionally equivalent to the WordPress data in a database. Therefore the Apache, PHP, and MySQL containers are based on images containing their latest code. The rest is content which will be attached to the relevant container.
The moment in thought that got me past this (in hindsight) silly misunderstanding was this: HTML is content and therefore doesn’t go in a container, and PHP lives… right alongside HTML.
That concludes this edition of Echoes. The comments are open, but will be moderated for civility. Alternatively you can hit me up on Twitter, where I go by @zkarj.