Vim Macros
One of the big advantages I find to using vim as my editor is the ability to record and replay macros. The recording of a macro begins when q is pressed followed by any other key, which specifies what register the macro is to be stored in. If we use qq the macro will be stored in register q, whereas qt will store the macro in register t. Once the recording is started, all keystrokes are stored into the specified...
Database Associations- "Has One" vs "Belongs To"
Which One Goes Where? One of the most confusing database relationship questions for me was always when to use has_one vs belongs_to. The relationship is a simple one-to-one relationship, and if we think about it in terms of the models, it makes a lot of sense. For example, let's say we have a Dog model and an Owner model. Immediately we can say the Owner has_one Dog and the Dog belongs_to Owner. In this case, the objects are familiar to...
Groove to a Vertical Rhythm
Background Grid frameworks are awesome. They solve a number of problems and enable developers to easily create virtually any layout they imagine. Paired with media queries, responsive layouts become more accessible and great experiences at all screen sizes are becoming more common.
Setup Varnish Locally
Typically, the best way to ensure that a web application will run correctly in production is to stage it an environment just like production. Most of the time the overhead of setting up caching or other performance improvements is not necessary in development, but there are instances when the development being done directly interacts with or relies upon these components. In these situations it often pays off to take the time to set up "production components" so that changes can...