I covered Server Name Indication (SNI) a while back, but it still surprises me how little people know about it. So, it’s time to look at configuring Apache to use SNI.

As a quick refresher, SNI allows multiple web sites to live on the same IP address, IPs being relatively expensive resources. SNI has been around for a long time (Apache has supported it since 2009), but was generally ignored do to the perception of a lack of browser support. However, it’s been hitting the big time with PAAS like Heroku and CDNs like CloudFront making it their default for HTTPS.

Sometimes you have to write a new Rails app for old data. One approach is to keep the old format and carefully craft your ActiveRecord models to work with the existing schema. But, odds are the old schema has become a mess overtime and wasn’t particularly Rails friendly to start with. When time and resources allow, I prefer a do-over.

That means Extracting, Transforming, and Loading (ETL) the old data. And for that, I like a Rake task.

An update to an older post about using the iOS Simulator from the command line.

The Simulator ships with Xcode to provide a way for developers to test their iOS apps without the pain of loading into on to a physical device each time. The Simulator can emulate all manner of Apple Hardware. It ships with whatever the current version of iOS is, but you install older versions as well.

The advantage of the Simulator if you are not developing iOS apps is that it ships with Safari installed. By launching the Simulator and opening Safari, you can test you web apps from the comfort of your own desktop.

I’ve been using ngrok on quite a few projects lately. I’ve written about it before, but in short, it solves to problems for me.

  1. It tunnels back to localhost from a hostname that live on the net, allowing me to develop for webhooks that would barf on http://localhost:3000
  2. It provides a valid SSL cert. More and more the platforms I build apps for require HTTPS when talking to an app.

The downside is that it adds another moving part to the process. I’m too lazy for that, let’s automate it!

Everyone has their patterns, here’s mine for starting a new Rails project:

1
2
3
4
5
6
rvm use 2.3.1@project-name
gem install rails
rails new project-name
cd project-name
rvm use 2.3.1@project-name --ruby-version
echo '/.ruby-*' >> .gitignore

I was recently shown the Best. Chrome. Extension. Ever.

JSONView is a Chrome extension that formats JSON when opened in Chrome. Normally when you hit a URL that returns JSON, Chrome displays a pile of goo. Actually, it just display the JSON as is, but most rendered JSON is not well formatted (and doesn’t need to be, it’s not intended for humans).

JSONView cleans up the formatting and applies syntax highlighting. Better still, it displays any errors it finds while parsing the JSON. If you are developing an API that sends JSON, it’s a great way to make sure what you are sending is valid and, when it’s not, to debug the problem.

It seems like everyone knew about this before me, but if you don’t, you just might want to add your tool box.