Hardscrabble 🍫

By Max Jacobson

discovering a problem

21 Jan 2015

view source on a recent post

That’s the “View Source” on a recent post here on the blog.

Do you ever discover a problem weeks or months or years after it was introduced? How did you discover it?

The HTML markup on my website has been broken for a while, but I only just noticed today, and then I noticed twice, the way you learn a new word and then hear it again right away.

I’ve looked at that view source several times while poking around on this site, and I can vaguely recall being concerned that some of those tags are highlighted in red, but never taking much notice of it, because the site works more or less fine.

Today while bored I took a look at a very neat iOS app called View Source, which provides an iOS 8 extension for viewing the source of any website right in Safari. When I tried to run it on my own blog (as you do), I saw this:

view source on a recent post in iOS

That… looks kind of wrong? Why’s all the head stuff in the body? Huh?

So just a few minutes ago I opened up my text editor and opened the relevant file to make a fix, and I saw this:

HTML in vim with syntastic

Hell yeah! Where was that error message when I first introduced the problem?

Well, it was nowhere, because I only started using that plugin like last week, and I introduced the problem a full 615 days ago while sloppily porting my layout from haml to Jekyll.

Probably my moral is: be careful out there! And pay attention to your inklings.

Here’s my second moral: even after making the fix, there are still some errors reported by the plugin because it’s confused by the Liquid tags, which aren’t valid HTML! I’m going to push the fix and use the online validator instead. Sooooo tools aren’t a panacea.

Ambiguous use of user-defined command

18 Jan 2015

I wish Vim plugin authors would stop exposing commands that start with E. Is that a reasonable thing to feel? I do feel it.

I use netrw to browse files in vim, and I enter netrw by writing :E. I do this all the time. :E is short for :Explore. I could type :Ex, :Exp, :Expl, :Explo, :Explor as well, but I type :E. This is what my fingers remember.

Sometimes I install a plugin, and that plugin exposes another command which starts with :E, and suddenly I get this vim error message:

Ambiguous use of user-defined command

What! I’m the user, and I didn’t even define these commands! I just installed a plugin. This is bull! Recently I installed a plugin which, very sensibly, exposes a command called :Errors. Except, like, now I can’t type :E because that’s ambiguous, I could just as easily mean either of those commands, so vim does neither. Now I need to type :Ex to disambiguate. I could cry.

So anyway, I was about to uninstall the plugin, but then I realized I can just edit my local copy of it and comment out the line that exposes the :Errors command, which I didn’t particularly want to use anyway, and now I’m kind of happy. I would prefer if I could un-register the command in my .vimrc (is it possible? I couldn’t find how in my few minutes of searching), because this solution is kind of fragile; next time I install the plugin on some other computer, it won’t include my fix.

Edit April 2015: I’ve sort of solved this problem by no longer typing :E, and instead adding this line to my vimrc:

nmap <silent> <Leader>e :Explore<CR>

Which lets me type ,e to jump right to netrw (, is my Leader character. By default, the Leader character is \.)`

unpairing bluetooth devices is annoying

18 Jan 2015

I don’t use that many bluetooth products. Bluetooth kind of confuses me, to be honest.

Five months ago I bought this:

a red speaker

It’s the AmazonBasics Ultra-Portable Mini Bluetooth Speaker - Red. It’s like one of those cool Jawbone speakers but cheaper and probably not as good.

I love it. I use it to listen to podcasts in the shower or while doing dishes. It’s louder than my phone’s speakers and lets me keep my phone away from water. It’s perfect.

The other bluetooth product I use regularly is the Apple Magic Trackpad, which I also love (I love swiping around to do things). Sometimes, though, I find myself wanting to unpair the trackpad with one computer so I can pair it with a different one and this is so unnecessarily hard.

Before I can use the trackpad with the second computer, I need to open the Bluetooth preferences in system preferences, find the device, and tell the computer to forget about this device (so dramatic!) before it will show up as pairable to the other computer. Honestly this isn’t that hard, but it takes a few seconds, and I almost always forget to do it before I’ve already put away or turned off the first computer.

Amazon’s cheap little speakers do it so much better. See that middle button? If you hold it down for a few seconds, it unpairs from whatever, and becomes available to whatever. That’s great! Because what if it was paired to something and you left that something at home? I could be wrong, but with most Bluetooth devices I think you just wouldn’t be able to use it.

Having this extra button feels to me like a correct design, with the responsibilities where they belong.