Missing argument at index 2” in fish

My default shell is fish. I find it very pleasant and easy to use, and it was very friendly when I was first learning the shell. The downside is that it seems to have a relatively small user base, and so you can’t always just do a Google search when you hit an error message.

Here’s a rather odd one I came across this evening: running cd would throw up a “test: Missing argument” message, but any other command was fine:

$ cd ~/bin
test: Missing argument at index 2

$ pwd
/Users/alexwlchan/bin

Googling this error message turns up just four results, and none of them were particularly useful in solving my problem. This is where I was hitting a problem, and how I fixed it.

Continue reading →

Notes on Tumblr

The most popular thing I’ve ever written is my site for finding untagged Tumblr posts. I have a few small changes, a new way to filter posts, and some other thoughts on using Tumblr.

Continue reading →

Google wants developers to make their address public

As reported by Joe Fedewa at Phandroid, Google is making it compulsory for developers of paid apps to provide a physical address in the Play Store. If not, their app could be pulled from the store.

This is a terrible idea.

Continue reading →

Playing with 404 pages

Until yesterday, mistyped or broken URLs would just show the generic GitHub Pages 404 page. It conveys the error, but it’s not very useful.

Brett Terpstra does something rather clever with his 404 pages: he reads the URL, and tries to guess where you were trying to go. Single-character typos or transpositions get redirected automatically, and if it’s not obvious where you were trying to go, he gives a list of suggestions.

He wrote about some of this in Fun with intelligent 404 pages, and I decided to try to build a version of my own. My system isn’t as sophisticated as Brett’s, but it was still a fun problem to tackle.

Continue reading →

My new standing desk

Inspired by Colin Nederkoorn’s $22 standing desk, I decided to have a go at building my own standing desk from IKEA parts when I moved into my new flat. I’ve been using a standing desk for several years, but moving my old desk would have been more hassle than building this new one.

I’ve made a few changes to his design, based partly on personal preference, and partly on the fact that I couldn’t get all of the parts that he used from the British branches of IKEA.

Here’s a picture of the new desk, from the front on:

A front-on view of my new desk

Continue reading →

Updates to my site for finding untagged Tumblr posts

About two weeks ago, I took a family holiday to Oslo. When I came back, I found that my site for finding untagged Tumblr posts had received a lot of traffic while I was gone. I’m flattered that so many people have found it useful.

This heavy usage also exposed several bugs in the original design. The site would become unresponsive if there were lots of untagged posts (sometimes in the tens of thousands). I’ve pushed out an update to fix this: you can click “Do you have lots of posts?” to limit the number of posts that get shown. This should fix any bugs with browsers freezing up.

If you have any other problems or suggestions, then please get in touch.

The rest of this post explains the major changes.

Continue reading →

A TextExpander snippet for Amazon affiliate links

Earlier this evening, Casey Liss tweeted a link to a post by Stoyan Stefanov with a bookmarklet for creating Amazon affiliate links. It’s short, clean and functional. I like it, but it still needs you to copy and paste the link into your document. I wanted to cut out that step, by writing a TextExpander snippet that takes the URL of the frontmost browser window, and outputs an Amazon affiliate link.

Continue reading →

A quick Alfred workflow for opening recent screenshots

I’m a big fan of the productivity app Alfred. It’s one of the first apps I install on any new Mac, and I use it dozens of times a day. Here’s a quick workflow I whipped up this morning.

When I take a screenshot, I usually want to use it immediately. I could navigate to my screenshots directory in Alfred, or find it in Finder,1 but it’s such an easy task to automate. I wrote a short workflow to open my most recent screenshot in the Alfred file browser.

Continue reading →

Thoughts on Overcast

On Wednesday, Marco Arment released his long-awaited podcast app, Overcast. I’ve only been using it for a few days, but it’s already displaced Pocket Casts as my podcast app of choice.

I was surprised by how much I liked Smart Speed. Like Marco (and many other people), I don’t enjoy listening to podcasts played at faster speeds, because the quality takes a nosedive. Smart Speed not only makes podcasts go faster, it makes them sound better for doing so. Conversations are tighter and more coherent, and I already miss the feature when I go back to another app.

Smart Speed alone would keep me using Overcast, but the little details are just as important. Overcast is packed with nice touches and polish. These are a few of my favourites.

Continue reading →

Getting plaintext LaTeX from Wolfram Alpha

Although I don’t write numerical equations very often, I couldn’t help but smile at this post by Dr. Drang. Building on a post by Eddie Smith which shows how to use WolframAlpha to evaluate a LaTeX expression for a numerical answer, he shows off a way to automate getting the equation from BBEdit, to save a tedious copy/paste step. Read their posts before you carry on.

Dr. Drang’s script gets the LaTeX equation out of BBEdit and loads Wolfram Alpha, but you still need to click the “Copyable plaintext” link. He ended the post as follows:

What I’d really like is to automate the copying and pasting of the answer. Wolfram’s page structure doesn’t make that easy, but it’s something I want to explore.

I tried to parse the Wolfram Alpha page structure in the past, and it was a bit of a mess. It’s much easier to use the Wolfram Alpha Developer API, which provides this very easily. I think I can use this to get the final piece.

Continue reading →

Copyright © 2012–14 Alex Chan. Built using Pelican. Privacy policy.