Michael Cordell's Blog

Automating the start and end of your work day

You probably do the same thing when you arrive every morning at the office if you are a developer. Fire up your editor, open your chat program, probably a console or two. At the end of the day you probably shut all of that down, and it is a pretty stable and recurrent flow, which means that it can be automated! As an …

Getting Started with Slate

Slate is an open source window management tool geared towards power users. It obviates the use of many paid tool such as Divvy and Stay. I am a long time Divvy user and was considering using Stay to manage window arrangements, until I found Slate. Slate is configured through a .slate file that will be familiar to users …

Ubuntu 14.04 and Compiling Ruby 2.X

While trying to set up a VPS running Ubuntu 14.04 I was unable to compile Ruby 2.1.1 (which was the current version). I kept running into errors such as: readline.c:1977:26: error: ‘Function’ undeclared ... The cause is that Ubuntu 14.04 ships with Readline version 6.3 which apparently breaks builds of Ruby and Python. …

Compelling People Book Review

Compelling people: The Hidden Qualities That Make Us Influential exists in the rarefied air of self-help books that might actually help you. Most books of these type contain a thesis statement that you understand within the first 40 pages. The next X number of pages are the author(s) filling out their quota for his or …

Guard and Unresolved specs

While using bundle exec guard I was recieving the following types of warnings: 15:30:07 - INFO - Running all specs WARN: Unresolved specs during Gem::Specification.reset: ffi (>= 0.5.0) WARN: Clearing out unresolved specs. Please report a bug if this causes problems. bundle update did not resolve this problem. gem …

Rails 4, Turbolinks, and jQuery

If you have a Rails 4 project with malfunctioning jQuery the culprit is likely a new feature in Rails 4 called turbolinks. Turbolinks attempts to speed response times by not reloading the header (in fact the whole page) each time a new request is made. Instead, the body of the page is replaced using ajax and json. The …

Rails 4 and Twitter Bootstrap 3

If you are starting from scratch on a new rails project you may want to start with what is current, which at the moment is Rails 4 and Bootstrap 3. I would suggest setting up RVM or rbenv before continuing. Install Rails 4: gem install rails Ensure you have it: $ rails -v Rails 4.0.0 Create your new project with rails: …

Strong Parameters in Rails 3

For the uninitiated, Strong Parameters is a gem for white-listing attributes that can be mass assigned. This is a replacement for the Rails method of white-listing that ships in 3.x. It also ships standard in Rails 4, so it behooves you to be familiar with it. Herein, I will discuss a few lessons in switch an existing …

Book Review: The Rspec Book

Reading The Rspec book is a lot like testing itself. A bit of a chore, but in the end you hopefully are better off for it. Additionally, the book covers much more than Rspec, and focuses greatly on behavior-driven development and Cucumber. Finally it is straight from the horse’s mouth, as many of the authors …

Rspec Notes

Nested examples and progressive setup are a trade off between DRY and readability Referencing a bug report in an example via pending describe "functionality" do it "should do something" do pending("bug report #78") do xyz.function() end end end What is nice here is that when the bug is fixed it …

Pages