RLASKEY::words

Code/Systems

NOTE: you can subscribe to just these posts via RSS.

Child Context

so this fills in the gap of a missing child

Fragment of a commit message I just wrote. Sounds pretty dark out of context, which perhaps is a natural consequence of using the word “children” in entirely virtual spaces.

On a related note, “master” and “slave” are also pretty common computing paradigms. Might be about time to change all of that.

Death and Windows

Got into work today, and my computer was acting a bit funny. It took my password, then stared at me blankly. Flipping around to the console, I saw notes to the effect that while life is all well and good, my root partition was mounted read-only and I would not be able to do the great things I had wanted to do.

Digging a bit deeper, I then see the error messages which indicate the filesystem was not in a good place, so that’s why we were reading only, writing disabled.

Anyway, my primary hard drive was hosed. I was able to reboot, and an fsck got the system in a place where I could at least do enough things to start my plan into new areas of the world.

Hello, Windows

I’ve been running Ubuntu for a couple years now, and generally it’s been great. It’s free, it’s fast, and the support for both hardware and software is rather top notch. The failure of the hard drive was actually nothing to do with the operating system, though I did need to start from scratch.

Armed with a license for Windows 8.1, I took a dive back into the Microsoft world. I’ve been using it at home for more than a year now, though this step has further sealed it: Linux for servers, but not for my desktop.

Windows 8 is definitely a bit odd. I like it a lot, though. The paradigms are different, but they make sense to me. I understand they’re mashing together interfaces for a phone, a tablet, and a desktop. It takes a bit of training, but going back to Windows 7 really doesn’t feel quite as nice.

Smaller bites

Luckily, I’ve been rather good at keeping backups. I’ve had two spare drives, and had access to a third. Most of my actual work was contained in a Virtual Machine, too, which I’ve intentionally kept rather minimal.

After looking everything over, Bittorrent Sync got me the bulk of my bytes in order, allowing for more than two extra copies of everything I care about, one closer enough that a local wired connection quickly sorted out tens of gigabytes of restoring.

On a failing drive, it’s tempting to try and save every bit, though I’ve often found that getting what you need and getting out grants rather more success. Drives like to spiral when they’re already down, and what looks fine may not be hours later.

So, with the bulk of the transfer abstracted, I was able to concentrate on my 8GB virtual machine image. Trying to copy it out to one backup drive revealed that even this secondary was rather on its last legs, which at that point just fucking figured. It was a Monday, after all.

I got it, though, and thanked myself for paring down to 8GB rather than 16 or 32. Sure, space is cheap, but in these situations with such larger images, every byte can count towards a potential problem in re-assembling a consistent whole.

Git was definitely another big part of the success, knowing that everything that really mattered was not only in my own machine in two or three places, but on others throughout the network, all with the latest updates. If for no other reason than that, learning Git is worth its weight in gold.

Open/closed

There’s a part of me that regrets a move away from running Linux this time around. It’s not as open, or as free. It’s a funny landscape, though. Ubuntu seems to make the most suitable environment, yet it still gets heaps of criticism for not quite adhering to the Linux Way.

Microsoft, on the other end, has been trying, but is largely perceived as more the uncool, legacy monster. Hell, even desktop computers in general don’t have the hype or attraction that they did a few years ago.

For me, open source lives better in a slightly more adaptive landscape. It’s great for servers. It’s incredible for software development of most any kind.

In the end, I’m just glad it all mostly seems to work.

youmightnotneedjquery.com

So this is nice, if as a somewhat canonical list if nothing else. JS has changed a lot over the years, and what we attribute to libraries are done largely in the browsers themselves. I can get behind that.

Jetpack Comments: Say Yes

I’ve been running WordPress for a long while, and I love that it’s a powerful open source software package. I’ve ran comments on this site for a long while, and for whatever reason the bots have managed to get better by orders of magnitude within the past year.

I first wrote my own simple plugin, which fooled most of them for a few months. Soon after that, it was becoming much less effective.

I then turned on Akismet, the WordPress spam filter. That mostly worked, though the amount of spam was just so immense that even though few were getting past, I could easily get more than 20,000 junk comments over the course of a couple days. I actually saw my database files grow rather quickly as a result, and not purging every few days was beginning to not be an option.

Hopefully I’m not just on the cusp of a second wave, though so far I’ve been rather impressed by Jetpack Comments. Beyond various social login mechanisms, it also extends the form to have a lot of nice tricks to fool bots and allow the humans to come through.

I’ll update this post if things change, but so far I’ve went from 10,000 spam comments a day to zero, just by enabling the module. It’d be nice if some of those features and protections were built into the stock system, though I’m not entirely sure if it’s possible. If anyone knows, or would like me to dive a bit into their code, do leave a comment. As it is, I’m quite happy with the result, and would recommend everyone to flip the switch.

New Theme: Dec/2013

I’ve had more or less the same theme on this site for quite a while. I’ve tweaked it slightly over the years, and I recently launched enough changes that I’m willing to call it “new”.

Open Sans

First up is a change in the default font. I first found Open Sans when Mozilla switched to it as a default in Firefox for Android. It’s beautiful, and it has a great, open license. I’ve used it internally for a while, putting it at the front of the CSS font selection and installing it on all my devices.

This time, however, I’ve set it up via the WOFF version using CSS @font-face, so any device that doesn’t have it natively can now enjoy it. This was also inspired by WordPress’s use of the same font in v3.8. It’s a great choice, and everyone should see it more often. I also went with the Light version of the font, which reads well and looks even a tad more elegant.

Sidebars and Infinite Scrolling

Pinterest was, to my knowledge, the first big site to allow for such functionality, and the Infinite Scroll feature in Jetpack has a great rendition of it. It’s relatively easy to enable, though it’s harder to allow with sidebars. In responsive, mobile-friendly sites, the sidebars can easily fall below infinity, meaning their content is never to be seen.

I “fixed” this issue by removing the sidebar entirely, and putting the functions in my primary navigational menu up top instead. This currently makes for a relatively wide area for text, yet there’s more white space which allows images and other media to shine a bit brighter.

menu-halp.js

My next task was to try and sort out CSS hover menus in as few lines as possible. Here’s what I sorted out:

It’s relying on the fact that jQuery is loaded up for the other Jetpack plugins, and the fact that we’re given the rather nice CSS class menu-item-has-children from WordPress to seek out only the hierarchical menu items. It seems to work nicely. Let me know if you have suggestions or problems with it.

MDN redesigned, looking slick

The Mozilla Developer Network is an incredibly useful resource for all kinds of web development, and it recently got a refreshed design. For most anything related to JS, CSS, or HTML, I’ll generally tack on “MDN” in my query, which will help putting those resources towards the top of the list. Definitely check it out, especially if you’ve never been.

Modifying OpenGraph Data from WordPress’s Jetpack

This is my solution to the problem plucked up by using WordPress’s Jetpack, which really is just a very subtle change to the suggested code in this support post.

By default, JetPack adds these others which you may want to modify, too: ‘og:type’, ‘og:title’, ‘og:url’, ‘og:description’, ‘og:site_name’, and ‘twitter:card’. It picks reasonable defaults for all of these, though for ‘twitter:site’ and ‘og:image’, it seems as though these should be configurable more easily in a dashboard somewhere. Until then, this works about as well.