Custom CSS in ResophNotes

My note-taking app of choice is nvALT, but since I have to use Windows at work, I’ve also been using ResophNotes, which seems to be the closest alternative you can get. I have a lot of notes: any error code, bugfix or useful titbit gets saved there, because trying to remember what a cryptic error message that you saw two weeks ago actually meant gets boring really fast.

Most of the time I read the plain Markdown, but for complicated notes I’ll use the Markdown preview. But the preview window isn’t the prettiest thing ever:

I was used to customising the preview in nvALT, so I wanted to do the same for ResophNotes. This turned out to be easy to do, but it wasn’t entirely obvious how to do it.

Continue reading →

Unpacking sets and ranges from a single string

I was reading the cURL man page on Thursday. Although I didn’t find what I was looking for, I did come across some rather neat syntax for specifying multiple URLs in a single string. Here’s an example:

You can specify multiple URLs or parts of URLs by writing part sets within braces as in:


or you can get sequences of alphanumeric series by using [] as in:[1-100].txt[001-100].txt (with leading zeros)[a-z].txt

The man page has more examples.

I’ve been thinking about something like this for a while. It’s not hard to create these lists using loops in Python, but it’s a bit tedious. It takes time to set up the correct loops, and for anything complicated you end up with an unhealthy level of nesting. I’d rather solve this problem once, and then not have to worry again.

I had a slightly different syntax in mind (simpler, and with more double brackets), but since I had a finished spec in the form of the examples, I decided to use this instead. I’ve written a Python script which takes a single string, and returns all the strings it specifies as an iterator.

Continue reading →

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

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 →

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