Hardscrabble šŸ«

By Maxwell Jacobson

See also: the archives and an RSS feed

discovering a problem

January 21, 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

January 18, 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

January 18, 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.

enterprising

January 17, 2015

Steven Soderbergh re-edited some famous movies. Jason Kottke linked to them and, among other things, mentioned this (emphasis mine):

Iā€™ve seen some comments on Twitter and elsewhere about the legality of Soderbergh posting the 2001 and Raiders edits. The videos are hosted on Vimeo, but are private and canā€™t be embedded on any site other than Soderberghā€™s. But any enterprising person can easily figure out how to download either video. The Raiders video has been up since September, which means either that Paramount doesnā€™t care (most likely in my mind) or their lawyers somehow havenā€™t caught wind of it, even though it was all over the internet a few months ago (less likely). Weā€™ll see if whoever owns the rights to 2001 (Time Warner?) feels similarly.

I read that and was kind of surprised because at first blush I had absolutely no clue at all how I might download the video. Sooooo I had to try:

terminal multiplexing with tmux

January 3, 2015

I made this video a few months back with my friend Alex Au. Itā€™s a crash course in how to use tmux. We made another, shorter, video about why you might want to use tmux as well:

If you find yourself with more than a couple of terminal tabs or windows open all the time, I think you should consider using tmux instead. In the last few months I feel like Iā€™ve hit a sweet groove with my terminal use, where I pretty much never have more than one tab or window open. Instead, I have one tmux session per project, and several virtual tabs (ā€œwindowsā€ in tmux parlance) per project. The thing I learned most recently that makes this really fly is the keyboard shortcut for switching from one tmux session to another without ever leaving tmux. I only ever really leave tmux to navigate to a different directory and start a new tmux session.

Hereā€™s what that looks like:

tmux flow

(I gotta look back into those failing tests in film snobā€¦)

The keyboard shortcut that takes you to the session switcher is ctrl+b s (s for switch). For me, itā€™s super useful. Hopefully youā€™ll find it useful, too.

A cleaner file browsing interface for vim

January 2, 2015

TLDW: add this to your ~/.vimrc:

" hide the giant banner at the top of netrw
let g:netrw_banner=0
" hide gitignored files from netrw
let g:netrw_list_hide=netrw_gitignore#Hide()

And then use netrw instead of NERDTree.

useful tool: storm

January 1, 2015

Iā€™ve been sort of passively looking out for something like this for a while. Hereā€™s the problem: there are a lot of remote servers I may want to SSH into at any given time, and I am not going to remember all of their usernames or IP addresses. Not gonna happen.

Iā€™ve been dealing with this by creating custom aliases. So I put something like this in my ~/.bash_profile:

alias 'eug'='ssh pair@some.ip.address'

Then, whenever I want to connect to Eugeneā€™s server so we can pair program, I just type eug and hit enter, and Iā€™m there. Not bad! It even tab-completes.

Not great either. Itā€™s hard to keep track of them. I can type alias at any time to list all of the defined aliases, and thatā€™s pretty sweet, but it includes several things, not just ssh aliases. Iā€™ve kind of wanted a tool that was more tailored to this job.

Sooo, enter storm. I found it via one thing well, a sweet blog for nerdy stuff like this.

Storm lets you define aliases to remote servers like this:

storm add eug pair@some.ip.address

Once you do that, you just type ssh eug to connect. It has some other helpful subcommands like storm list to tell you all of your aliases even storm web to spin up a nice local web server to provide a web interface for managing your aliasesā€¦

Hey, wait a second. Somehow itā€™s hooking into the normal main ssh command!

After some poking around, I found that itā€™s saving the information in ~/.ssh/config as a plain text configuration file that looks like this:

Host eug
    hostname some.ip.address
    user pair
    port 22

And that I couldā€™ve been using a similarly-structured file all along, and didnā€™t really need storm at all!

Hot dog.

Well, Iā€™m going to use it anyway because it has a sweet interface and Iā€™m kind of just grateful to have learned something from it? Iā€™m guilt-tripping myself into using it.

don't let me modify my laptop any more please

December 16, 2014

Iā€™m writing this on a sticker-covered MacBook Pro my Grandma bought me 3.5 years ago. Itā€™s a pretty powerful Mac. I thought I wanted to be a freelance video editor then. I bought the controversial Final Draft X around that time too.

I havenā€™t edited more than few personal videos, but Iā€™ve used this to write a lot of code and I think Iā€™ve benefited from it having a powerful processor1

I donā€™t really know anything about hardware, but Iā€™ve nonetheless made a few hardware upgrades over the years. Less than a year after getting the computer, I upgraded the RAM from 4 to 8 GB:

RAM upgrade photo from Jan 1, 2012

(Photo via my my instagram from January 1, 2012)

That was pretty easy. You just have to unscrew the bottom off, pull out the old RAM, and add the new RAM (which you bought from Amazon or Newegg or something) and then screw the back on again. It uses normal little phillips head screws.

That worked out for a few years. Then it starts feeling slow again. Iā€™ve come to understand that SSDs are faster than HDDs and decide to remove the optical drive in my laptop, move the HDD into that position, and add a new SSD in the position of the original HDD, and then use the SSD as my primary drive.

I order the parts from the internet and buy a screwdrive set from TekServe and feel very confident. Ultimately I was too confident. This was a super advanced thing to do! I almost ruined my computer.

Upgrading hard drive photo from Jun 6, 2014

(Photo via my my instagram from June 6, 2014)

Basically: stripped screws are the bane of my hardware existence. What do you do when you need to remove a screw so you can remove an optical drive, but the screwdrive spins and the screw stays put? What the hell do you do?

On some level I believe thereā€™s a solution to every problem. Sometimes the solution is more dramatic. When I canā€™t remove a screw from some fixture, I do the next best thing and destroy the fixture. In that picture you can see the optical drive on the right, and a plastic-looking arm holdig it in place. It turns out thereā€™s metal underneath the plastic.

Fast forward to tonight and I have forgotten how bad I am at this stuff and I have a new mac upgrade mission. Iā€™ve been getting little warnings in the status bar that my battery needs attention. Iā€™m worried the Apple Store wonā€™t service it because of the previous modifications I made, but I find a straightforward replacement instruction set online that makes it seem pretty doable, and I order a replacement battery from Amazon that is half the price of the one Apple sells and Iā€™m preparing to open it up again.

Honestly, I should have heeded the first signal, which was that one of the screws holding the bottom plate in place was slightly stripped and didnā€™t want to come out easily. I stayed patient and tried a few different screw drivers and ultimately managed to slip it out. Iā€™m feeling pretty good. The bottom plate comes off.

The battery has a sticker on it warning not to try to replace it yourself. I ignore the sticker. The instructions online tell me there are only three screws to remove, but theyā€™re not a typical kind of screw. Luckily, the battery came with a special screwdriver for this purpose. The first two screws come off easily. The third is hidden under the sticker. I have never even lifted this sticker in my life, I swear, but somehow this last screw is pretty stripped, and thereā€™s nothing for me to do. I either have to give up or resort to drastic action. Thereā€™s no coaxing this one out.

So what do I do? I find the power drill my dad left at my apartment a few months ago and start fucking up this fixture:

(Video via my instagram from December 12, 2014)

I try prodding and poking and sawing at it with a drill, a pocket knife, with various screw drivers, for well over an hour. I learn more about how the power drill works when suddenly its mouth opens and the drillbit falls out and I have to figure out why.

Something like an hour and a half later the fixture is sufficiently destroyed that I can remove the battery. Iā€™m pretty nervous that Iā€™ve more or less destroyed the entire computer. I figure thereā€™s a good enough chance that the drill would poke through the machine and screen, or I sever the strip that connects the SSD drive to the computer or who even knows?

Because I never really removed the old screw, I just forcefully ripped the old battery from it, the new battery doesnā€™t really fit. It has a little ear that wants to be fastened down in that same place, but that place is occupied by an old screw fastening nothing. So I ply away the ear, and position the battery fastened by only two screws.

I hold my breath and turn it on. It actually kind of works. The warning light is gone. The ā€œbattery healthā€ is 101% now, whatever that means. The estimated duration is still terrible, less than an hour on a brand new battery, but I kind of donā€™t care. Actually that number is going up as I type this šŸŽø.

I feel like I need to wear a promise ring not to ever try and open up this computer again, for my sake and its. It just wonā€™t be a happy thing to do. I hope writing this makes me remember that.

Although, now the HDD isnā€™t showing up in the list of drivesā€¦ maybe I should just open it one more time and take a lookā€¦

  1. Or whatever. Honestly, I donā€™t really know anything about hardware.Ā 

more film snob updates

December 14, 2014

Since my last post, in which I announced version v0.4.0 of film snob and kind of agonized over the decision to mark it as a minor release, Iā€™ve gone ahead and made two more minor releases. I have much less anxiety about it now. In fact, I wish I had been doing that earlier.

I decided to do some release notes on the release section of the GitHub repo, instead of here: https://github.com/maxjacobson/film_snob/releases.

While adding release notes for the very oldest versions, from April, I laughed seeing how stuck I was on v0.3.x, not sure when I was allowed to move forward, and just continuing to add these patch level releases for things that were totally new functionality.

Hereā€™s whatā€™s new in v0.5.0: https://github.com/maxjacobson/film_snob/releases/tag/v0.5.0.

And hereā€™s whatā€™s new in v0.6.0: https://github.com/maxjacobson/film_snob/releases/tag/v0.6.0.


The next big thing Iā€™ll need to decide be when to mark the major release of v1.0.0. I had some ideas about breaking changes that I would like to make, so I thought I would save those for the first major release, but then a very generous stranger implemented those ideas and made some pull requests, so I have to decide if Iā€™m ready to make it happen now. Why not, I guess? šŸ˜Ø

film snob 0.4.0

December 6, 2014

Today Iā€™m happy to release film snob v0.4.0.

I first wrote about film snob in April, when I extracted it from my old web app Layabout.

None of the changes add new functionality, so maybe it was wrong to call this a minor release. They also donā€™t fix any bugs. Theyā€™re all to do with making small stylistic changes that make the code easier to read or more consistent. I havenā€™t been releasing those changes because I havenā€™t been sure what the point is ā€“ why release an update that doesnā€™t change anything?

If someone is using film snob, and itā€™s not behaving how they expect, they might check the source code to help them understand and debug their problem. With that scenario in mind, I definitely want to release these changes.

Also, today I merged an awesome pull request which renames a method and emits a deprecation warning for the old method name. Thanks to Wil Chandler for making that change.

Ever since Anton Davydov added support for embedding photos and videos from Instagram, itā€™s been kind of weird that one of the main public interfaces for film snob has been the watchable? method. Instagram photos arenā€™t really watchable, right? Theyā€™re look-at-able, I suppose, but not watchable. Soon weā€™ll be adding support for embedding Rdio playlists & songs too, and itā€™ll be even more semantically unsettling.

The experience now looks something like this:

15:22:33 tralfamadore-5 hardscrabble.net:master
ā‡„ irb
>> require 'film_snob'
=> true
>> FilmSnob.new('http://instagram.com/p/sw4RThIctq/').watchable?
WARNING: #watchable? is deprecated and will be removed in v1.0.0. Please use #embeddable? instead.
=> true
>> FilmSnob.new('http://instagram.com/p/sw4RThIctq/').embeddable?
=> true

Embeddable feels more right to me.

So even though thereā€™s no new functionality, there is more clarity, and maybe clarity counts as a feature? šŸƒ