3 Things I Learned This Week 2015-01-11

Schema.org itemref

We’re adding more schema.org markup to a site for work. The schema.org standard defines a lot of extra tags you can put on your HTML to tell crawlers more specific details about what the page is displaying.

We’re using a few different schemas (Recipe, Product, Author, etc) across the page and sometimes you need to communicate to the crawler that two sections of the page are actually speaking about the same item.

Calling one task from another in Rake

I added a rake task to create another one of these three things posts. Since I’m using Octopress, theres already a rake task to generate the shell of a new post: rake new_post["Post Title Here"] which I would like to reuse rather than duplicating. Keeping things DRY, you know?

You can use rake’s task command to get a reference to another task and then invoke it, passing along whatever parameters you want:

desc "Create a new three things post"
task :three_things do |t, args|
  today = Date.today.to_s
  task(:new_post).invoke("3 Things I Learned This Week #{today}")

Spell check in Vim

I do most of my non-c# coding and writing in vim (including this blog) and recently turned on Vim’s spell checking support. It works pretty well. With a good terminal emulator you can even get right click support on misspelled words.

But without right click support, these commands are working for me:

  • ]s and [s - Move to the next or previous misspelled word
  • z= show a list of spelling suggestions
  • zg - marks a word as “good”, i.e. spelled correctly