Making a Simple, Database-Driven Website with Sinatra and Heroku

When I want to make a website, my instinct is to use Rails.  However, sometimes I don’t need everything (or even 50%) of what Rails provides and it feels like a waste for a quick project.  Sinatra may be the simplest web framework ever, but it is also incredibly powerful.  Combined with Heroku, anyone with a little coding experience can have a website running for free in just a few minutes.

There are plenty of good Sinatra tutorials on the web, however I have found that most of them focus on static content.  For those that don’t, I’ve found that very few will also cover how to integrate Sinatra with Heroku Postgres and get your app up and running in the cloud. After having to do so myself earlier this week, I thought it would be useful to others if I posted a quick and to the point article about how to get Sinatra and ActiveRecord up and running on Heroku.  All of the code that follows is available on my GitHub, right here.  In this tutorial you’ll notice that I bold all filenames and shell commands, this is just for readability and you’re free to ignore it.

Continue reading

The Biggest Problem with WordPress, in One Image

Today I tried to make a new post on this blog, and this is the page with which I was presented:

This page is entirely about writing a post.  Yet the part of the page in which I can compose the post is only 6.12% of the total page area!  The other 93.88% of the page is devoted to blank space,  useless links, website nav, and generally anything but what I need.   This is like writing an essay through the mail slot in my front door.  Am I the only one with this complaint?

Edit:

It appears the text box is resizable, and I am an idiot.  However, I still think it’s bad web design to have it so small by default.  If I didn’t realize, a lot of less technical people definitely won’t.

Screenshot_2012-11-12-01-36-20

My Ultimate Mobile Setup

I do 90% of my work on my Macbook Pro. It’s the 2011 model with the 15″ 1680×1050 antiglare screen, Core i7 processor, and 8GB of RAM. It’s an amazing machine and I wouldn’t want to use anything else at home. However, I also spend 4-6 hours a day in class and another 2+ just generally “out”, and it became a bit cumbersome to always carry a 6+lb laptop that gets <4hrs of battery life (this figure used to be higher). So I decided I would get some better mobile gear. The obvious choice would be a MacBook Pro (or any ultrabook) however I didn’t want to spend all that money. I made a list of what I want in a mobile device:

  1. Lightweight
  2. All day or multi-day battery
  3. Relatively cheap (<$600)
  4. Effortless sync with my other devices
  5. Ability to take notes, browse the internet, and code

This is not an easy task. At first, it seemed like such a device would have to wait a few years. But over the last few months, I figured out a setup that works for me.

Continue reading