Archive for February, 2011

Dave Shea has made his comprehensive Chalkwork Family icon set free for personal use. He explains:

People who appreciate your work do the right thing. Just as those who download music are more inclined to buy it, my bet is that those who download these icons for personal use may one day come back and pay for commercial use. If they don’t, were they ever likely to buy them in the first place? I doubt it.

Awesome.

Instapaper, oldest first

February 23, 2011  |  Tags: ,   |  

In a tweet, Tim van Damme suggested sorting Instapaper articles by “oldest first”. I tried it out.

Advantages

  • Clearing through some of my oldest articles. How the hell have I put off reading articles from 2008? Was Instapaper even around then?!
  • Re-discovering things I’d wanted to read back in 2008.

Disadvantages

  • Discovering that some of my interests in 2008 were embarrassingly lame.
  • My reading list still doesn’t get any smaller as I keep adding crap from Twitter and Reader. Worse, I’m increasingly likely to become embarrassed by things on my list as I put off reading them till 3 years later.

ARGH! LIFE IS SO DIFFICULT.

Anyway, I now set Instapaper on my iPhone as oldest first, while leaving the iPad version on the default “newest first”. I heartily suggest for everyone to do the same, and if you don’t have Instapaper, an iPhone, and an iPad, to get them so you can.

Amusing:

It’s funnier if you say you enjoy something that generally everybody enjoys, but claim to be an ‘Enthusiast’ of that thing. (ex. Nacho Enthusiast or Nap Enthusiast)

Although I’m slightly worried that the commenters seem to be taking it seriously.

  Pixelfari →  February 17

Neven Mrgan, creator of The Incident, is a genius:

Presenting Pixelfari, a pixely, 8-bitty version of everyone’s favorite browser. Enjoy chunky fonts, blocky graphics, and a general sense of giddy inefficiency.

Look at it! See how amazing it makes this website look! SWOON

Screen shot 2011 02 18 at AM 12 43 33

Customising your WordPress theme for the DF Linked List plugin

February 16, 2011  |  Tags: ,   |  

I’ve received quite a few emails asking about how to customise WordPress themes for the Daring Fireball Linked List plugin. Since the plugin only affects the RSS feed items’ links, some users aren’t sure how to get the same effect on their webpages. So here’s my attempt at helping budding link-bloggers build their own “DFLL-compliant” WordPress themes. For this guide, I’ll be basing my instructions on the (current) default WordPress theme, TwentyTen.

[Aside: To briefly answer another question I’ve gotten more than once — instead of just changing the RSS links and then going through all this trouble to adjust the theme, why doesn’t the plugin just change your permalinks? Because then you wouldn’t get any permalinks to your linked list posts. If that’s your cup of tea, though, you can try the FeedWordPress plugin.]

Disclaimer: Please be careful! I’ve done a bit of testing, but I can’t be responsible for helping you if you mess up your WordPress install with these instructions. Back up! If you don’t know where to find these theme files, or if you’re not comfortable mucking around with code, you might be better off getting someone to do it for you. I can help for a small fee — see the bottom of this post.

Before you begin

Did you actually install the plugin, either from the link or by searching in your WordPress blog’s plugin directory? Please do, before following any of the instructions below.

The Quick Way: Using a child theme

I’ve prepared the methods below as a child theme, which will only work if you have TwentyTen installed in the default directory. This could be useful if you’re starting a new blog.

You can either get it here: TwentyTen DF Linked List Child Theme, or find it in your DFLL plugin directory if you have the latest version. Move it to your WordPress themes directory, and activate it.

The Long Way: Editing your theme manually

This section goes into detail about how to edit your theme by hand. You might want to read this if you’re not using TwentyTen but are vaguely familiar with how PHP and WordPress themes work.

First, edit the linked list titles on your main page. To do this, open up loop.php, and look for this line around line 126:

<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>

Edit it to:

<?php if (is_linked_list()): ?>
  <h2 class="entry-title linked-list-item"><a href="<?php the_linked_list_link(); ?>" title="<?php printf( esc_attr__( 'Link to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?> &rarr;</a></h2>
<?php else: ?>
  <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php endif; ?>

Notes:

  • The first section occurs twice. The first occurrence, on line 62, applies only to gallery items — you want the second occurrence on line 126. (Line numbers may have changed in later versions of WordPress.)
  • I’ve taken the liberty of changing the link title to become “Link to your post title” instead of “Permalink to your post title”, and adding a right arrow (→) at the end of your post title. You can change these in line 3 of the code. If you want, you can use the symbol you define in the DFLL settings by using get_glyph().
  • Readers can still click on the date to get to the permalink. You can change this, of course.
  • I’ve also added a class to your title, linked-list-item. You can use this to style the title to look different from your other entries. Take a look at how Misters Blanc and Brooks do it.

Next, you should also edit your single page template, so that if anyone gets to your link post’s permalink, they can get to the link. Open single.php and look for this line (line 22, in my version):

<h1 class="entry-title"><?php the_title(); ?></h1>

It doesn’t link to anything at the moment, so you can either make it go to your link:

<?php if (is_linked_list()): ?>
  <h1 class="entry-title linked-list-single"><a href="<?php the_linked_list_link() ?>" title="Link to <?php the_title_attribute(); ?>"><?php the_title(); ?> &rarr;</a></h1>
<?php else: ?>
  <h1 class="entry-title"><?php the_title(); ?></h1>
<?php endif; ?>

… or you can just insert the link below, like so:

<h1 class="entry-title"><?php the_title(); ?></h1>
<?php if (is_linked_list()): ?>
<div class="linked-list-single"><a href="<?php the_linked_list_link() ?>" title="Link to <?php the_title_attribute(); ?>">Go to this link</a></div>
<?php endif; ?>

Edit my suggested defaults as appropriate, of course.

Update, 31 March: I forgot something when I first wrote this article — how to add the permalink glyph into your post. (Thanks go to Jason Clarke for reminding me.)

Here’s how you add a permalink glyph to your linked list posts:

<?php if (is_linked_list()): ?>
 <div class="linked-list-permalink"><?php the_permalink_glyph(); ?></div>
<?php endif; ?>

This adds a link, using the glyph you define in the plugin’s options page, to this post. With this, you can probably get rid of other links that come by default in TwentyTen — try searching for other anchor tags to the_permalink. (Note: Previous versions of this had a link to the permalink surrounding the call to the_permalink_glyph, which resulted in a double link. This has been fixed — thanks to Nat Robertson for pointing it out.)

If you want this permalink glyph to show up for all posts (and not just linked list posts), remove the first and third lines (the “if” and “endif” ones).

I only put this in loop.php, so it only shows up on the front page, since I suppose the single-page view is already at the permalink.

If you’re not using TwentyTen, look for similar code in page.php, post.php and single.php. Usually, you’ll want to find a h1 or h2 tag that calls the WordPress function the_permalink(), something like the below:

<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>

Which you can adapt to:

<?php if (is_linked_list()): ?>
  <h1><a href="<?php the_linked_list_link() ?>" title="Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
<?php else: ?>
  <h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<?php endif; ?>

Hopefully these examples have given you enough information to do some “pattern-matching” on how to identify the code to change, and what to change it to. Once again, remember to back up before doing anything drastic!

References

  • To see an example of the plugin and theme in action, go to my test blog, which has the plugin set up and the child theme installed.
  • If you want to create your own WordPress theme instead, here’s a walkthrough by Chris Spooner.
  • If you’re migrating from Tumblr, Ian Hines has you covered with a set of detailed instructions.

None of this makes any sense. Can you do it for me?

Sure, I can customise your theme for a small fee. Get in touch and we’ll work something out.

A 2008 Esquirer article on Jason Rohrer, game programmer. Not spoiling anything, but I love the ending:

Christ, can’t you see this? This lush green atmosphere dying so gorgeously all around him? And Rohrer with a laptop, sitting cross-legged in the dirt, inventing a new way of showing the world what it means to be alive?

I downloaded Rohrer’s Passage for iPhone a while ago, and played it only a couple of times, but the experience has really stuck with me ever since. (Also available as a free PC download, I hear, but it was worth my 99 cents.)

I found this line by Luck terribly amusing:

Luck’s ultimate insurance will come from his Stanford degree, and he plans to graduate next spring.

“I’ll look like an idiot if I didn’t,” he said with a laugh.

What a guy, and what a season. I’m glad I managed to catch some of their games online. (Albeit through questionable means — I would have been happy to have paid to watch the Orange Bowl online, but I couldn’t find a single legit source that streamed internationally.)

Computer productivity

February 12, 2011  |  Tags:   |  

This is the epic trail of, er, “productivity enhancement” I took this afternoon.

  • Browse Twitterrific for Mac. Realise it doesn’t support Magic Mouse / Trackpad gestures. THIS SIMPLY CANNOT DO.
  • Check Twitterrific’s Twitter feed for tips, and followed the link in this retweet to this blog post.
  • Oh, sweet! A free Mac app, Better Touch Tool, which allows you to customise your multi-touch gestures to activate keyboard shortcuts! This could be handy.
  • Download!!! Install!!!!
  • Holy crap, this application allows for Windows 7-style window snapping to screen edges, which I’d previously paid $4.99 for Cinch for.
  • Test out window snapping, disable Cinch, re-enable Cinch, decide Cinch is smoother, feel better about purchase.
  • What the hell was I doing? Oh, right, customizable gestures.
  • Check out the ridiculously customisable touch gestures (e.g. double tap and drag; double tap and drag one finger diagonally; tap 10 fingers (?!)).
  • Excellent, I can use this to switch tabs in my browser! I’ve always hated having to move my mouse to the tab bar, or my hand to the keyboard to use the keyboard shortcut. YESSS PRODUCTIVITY!!!
  • Proceed to test out tab switching by using the gesture for single swipe left/right on the mouse, but only after realising that the standard Safari tab switching shortcut are cmd-shift-[ and ] (I’d changed them to cmd-opt-arrow long ago).
  • This is awesome! But wait, what if I need to scroll left or right within a page?
  • Attempt to find super wide webpage for a few minutes, before realising I can just resize my browser window’s width. YJ YOU IDIOT.
  • Consider remapping the double-finger swipe left/right to switch tabs instead of previous/next page.
  • But I do use that sometimes in Finder… oooh, wait, I can customise Finder keyboard shortcuts too! Maybe I’ll change them all to three-finger swipe, and leave two-finger swipe for switch tab. (I get tabs in Finder from TotalFinder).
  • After lots more experimentation, finally decide on cmd-double-finger-swipe.
  • Try to customise these for the Magic Trackpad as well, which doesn’t support double-finger swipe. Spend another 20 minutes deciding on what shortcuts to use so that it’ll be consistent across the two devices.
  • Set up gesture shortcuts for “Send to Instapaper” (cmd-1, for the first item in my Safari bookmark bar). Test for a while and send random crap to my Instapaper queue by accident.
  • Realise I no longer need Magic Prefs, which I’d been using to get middle click for the Magic Mouse. Uninstall. Or rather, Google on how to uninstall, and fail to do things in the right order, and reboot.
  • Spend another 20 minutes customising the middle click hit area for Better Touch Tool.

So, two hours later, I’ve set up a few great gesture shortcuts for troublesome keyboard commands which had been taking up so much of my time. (Actually, I’ll probably forget to use these new gestures.)

At this point, I realises I hadn’t actually done what I set out to. A few more final steps in my merry trail:

  • Set up gesture shortcuts for Twitterrific.
  • Note that Twitterrific, even with gesture support, requires me to click on the tweet before activating the gesture.
  • After 10 minutes, realise this makes the gesture somewhat pointless — imagine having to click on a tweet, then triple-swiping right to get a link. Why not just click on the link instead?! YJ YOU IDIOT.
  • Switch back to Twitter for Mac until Twitterrific comes out with multi-touch gesture support (which they say will come soon).
  • Feel stupid.

Not to mention:

  • Blog about it. Another half-hour down the drain.

And

  • Count all the bullets in this post. Count again and get different result, forcing yet another count. (26, including this one.)

How to be self-employed like this?!

Initializr promises to help you “start your HTML5* project in 15 seconds” using the excellent HTML5 Boilerplate by Paul Irish and Divya Manian. I’ve downloaded and used Boilerplate before, but this is a great way to ease past the friction of setting that up — just choose from a few options on the website and download a customisable template that’s ready for you to design on. The template even includes a TODO text file to get you started.

* That whole argument about how HTML5 is a HTML specification, not an umbrella term for HTML5, CSS3 and new web technologies? Daft.

Fascinating article by Ars Technica providing a detailed recap on how Aaron Barr, “computer security company” CEO, tracked down Anonymous, only to end up with his company’s website defaced, thousands of internal sensitive emails distributed on BitTorrent, and his Twitter account hacked (and still hacked at time of writing, so go take a look at the roadkill).

(Related: I normally dislike multi-page articles, but Ars Technica’s longform pieces are worth it for the great content, and they tend to be divided into sensible chunks. They’re also great candidates for Readability donations.)