This version of the site is now archived. See the next iteration at v4.chriskrycho.com.
Published during: February 2013

Launch an editor with a list of files containing a string

This one’s here for my own reference as much as anything, because I will want to do this again and I’d rather not have to go dig it up.

If you want to launch an editor with a list of files matching a specific pattern from any Unix or Linux terminal, the quickest and simplest way I’ve found to do it as follows:

find directory [-name modifiers] -exec grep -l pattern | xargs editor

So, for example, I just wanted to use Sublime Text 2 open every Fortran 95 file in a directory that writes to disk, so I ran the following:

find . -name "*.f95" -exec grep -l 'write(' {} + | xargs subl

Read on, intrepid explorer →

Four more anti-patterns

Another set of absolutely lovely gems we found this week: an empty for, the almost-impossible if, continue just because, and source that doesn’t match the executable. Oh my!

The empty for

I’d seen this before, but we found it again while trying to diagnose an (unrelated) infinite loop bug in our source (more on that below): Read on, intrepid explorer →

Two (absurd) anti-patterns

A pair of anti-patterns I’ve run into recently in my software development work, both of which are absolutely awful, though in completely different (and quite distinct) ways. I thought I’d share The Empty If and Wash, Rinse, Repeat, just so the world can share a bit of my pain. Read on, intrepid explorer →

Bitbucket

I recently started using Bitbucket for just about all my software repositories. I like GitHub, too, but Bitbucket has support for both Mercurial and Git, and I prefer the former (even if the latter has a bit broader usage in the software community).

You can find my public project(s) at Bitbucket itself or (identically) on a CNAME mirror of the site here at chriskrycho.com – a lovely feature that both GitHub and Bitbucket support.

One software development effort I’m involved with is actually testing Bitbucket for all its source repositories. If you’re on a small team, it’s a very good resource, as it you can have unlimited repositories for free if you have five or fewer people on the team, and for $10 a month for 10 people on the team. If your team is large enough that you can have a dedicated IP person, it’s probably less effective – but it’s hard to beat that for small teams without a dedicated IT employee.

Stupid Facebook

Today, I went to send a message to one of my wife’s friends, with whom I’m not friends on Facebook, and found the following message awaiting me, where footnotes correspond to Facebook’s explanations:

You aren’t connected to on Facebook, so your message would normally get filtered to his Other folder. You can:

  • Send this message to his Inbox for $1.00
  • Just send this message to his Other folder

Read on, intrepid explorer →