robots.thoughtbot.com Archives - 06 August 2013, Tuesday

August 5, 2013 dancroak vim rspec Test driven development thrives on a tight feedback loop. However, switching from the editor to the shell to manually run specs is inefficient. Tools such as autotest and guard run specs whenever a file gets saved. Although an improvement over a manua...

July 29, 2013 dancroak postgres activerecord How to Create Postgres Indexes Concurrently in ActiveRecord Migrations By default, Postgres locks writes (but not reads) to a table while creating an index on it. That can result in unacceptable downtime during a production deploy. On a lar...

Related:

July 19, 2013 christoomey-tb tmux Tmux Copy & Paste on OS X: A Better Future Tmux recently updated to version 1.8 , and with the update came a new command that greatly simplifies integrating with the OS X clipboard. With prior versions of tmux, there wasn’t a straightforward method fo...

July 18, 2013 cpytel thoughtbot learn One-on-one Mentors now included in thoughtbot’s Learn Prime Today, we’re excited to announce a new addition to Prime: One-on-one mentoring . Since launching, Learn Prime has evolved from a simple subscription service of everything we teach into a ...

July 17, 2013 derekprior rails SQL The Perils of Uniqueness Validations Your Rails application probably makes use of uniqueness validations in several key places. This validation provides for a nice user experience when duplicate records are detected but as we will see in a moment, is...

Related:

In my case, I like to have the “external posts” I write here for Giant Robots to show up on my personal blog , so that I can direct people to a single place to see everything I write. Having the posts all in one place also allows me to use Google Analytics to track clicks from my site...

Chat Example App Using Server-Sent Events Rails 4 can stream data to the browser with ActionController::Live using server-sent events (SSEs) . I was curious how server sent events worked so I decided to use them to implement a simple chat application. Tiny-chat is a chat app I built u...

July 13, 2013 derekprior ruby rails testing Taming Factory Girl List Creation There are times in your tests when you need to create multiple instances of the same type of object. FactoryGirl provides create_list for just these sorts of scenarios. It’s typically sufficient to create tw...

July 12, 2013 ehmorris trails learn Have Your Trail and Eat It Too Over a year ago, we launched Trails to help answer the question “How do I learn x." Since then, we’ve worked on refining what we think goes into learning Rails, Ruby, design, typography, and 16 other skills (it’s open ...

OS X Mavericks may ship with Ruby 2.0. Cool, right? Don’t touch it. Why eschew system Ruby? The root problem is not with using a pre-installed Ruby per se, but with not using a Ruby version manager . Problem: Gem Dependencies PC users will remember DLL hell . Ruby developers have deal...

Related:

Skinny Controllers, Skinny Models I hear a lot of people recommending the “skinny controller, fat model” approach to Rails development. I’m all for keeping controllers simple, but who wants a fat model? If your editor slows down while loading up your model files, I have some advice: p...

June 15, 2013 derekprior vim tmux Seamlessly Navigate Vim and tmux Splits My tmux session for a given project typically has two horizontal tmux panes with Vim occupying the top 80% of the screen and a shell running below that occupying the remainder. For the most part I stay in vim, s...

August 31, 2011 jdclayton javascript testing Jasmine Underscore.js shared example groups Jasmine and Shared Examples I’ve been doing a bit more Javascript development as of late and am using Jasmine for my unit tests. It’s been wonderful. I did find that it was a bit of a bear to test...

accepts_nested_attributes_for with Has-Many-Through Relations If you find yourself getting validation errors when using accepts_nested_attributes_for with has-many-through relations, the answer may be to add an inverse_of option. The inverse_of option allows you to tell Rails when two...

June 13, 2013 cpytel thoughtbot reading learn Send your thoughtbot books to Readmill We’re happy to announce that you can now easily send any of your books purchased at Learn to Readmill . Readmill is a unique ebook reader for iPad and iPhone that lets you read, share and discover gre...

8 Simple Rules for Dating My Business: Our Hiring Process Our hiring process has been continually refined over the 7 years we’ve been in business to reflect the needs of our team, the lessons we learned along the way, and the changes in the candidates we see. In this post I’ll go thro...

June 5, 2013 gfontenot wwdc conference ios thoughtbot at WWDC WWDC is upon us again, and we’re happy to say we managed to snag a few tickets. The SF contingent of the iOS team (Mark , Theo , and Diana ) will be strolling across the street from our new office , and Gordon will be makin...

June 4, 2013 dancroak san francisco Hiring a San Francisco Office Manager About a year ago, we opened an office in San Francisco . Galen, Adarsh, Mason, and I moved out here from Boston after the Fourth of July: Over the summer, we hired Greg, Mark, and Jessie: Britt, Scott, Alex, The...

February 9, 2013 jayroh ruby RSpec TDD Fight back UTF-8 Invalid Byte Sequences Chances are, some of you have run into the issue with the invalid byte sequence in UTF-8 error when dealing with user-submitted data. A Google search shows that my hunch isn’t off. Among the search results ...

May 31, 2013 brittballard javascript coffeescript Module Pattern in JavaScript and CoffeeScript One of the shortcomings of JavaScript objects is the lack of support for private members. The ability to create private members makes external APIs more meaningful and helps keep code more ...

May 30, 2013 jdclayton performance ruby on rails Fast JSON APIs in Rails with Key-Based Caches and ActiveModel::Serializers Want to make your Rails JSON APIs fast? Blisteringly fast? In a project I’ve been working on recently, I reduced requests from 5 seconds (or more!) to at most 0....

Two GETs. The second one is unnecessary. Two failure messages if something goes wrong. I only want to deal with the immediate error. One small step at a time. Nine lines of code Four db records created. I need to create two objects to test ordering. With two test runs, I get 4 objects...

May 28, 2013 joshsteiner vim rails.vim Extending Rails.vim with Custom Commands Thanks to the always awesome Tim Pope , Rails.vim version 5 was released a month ago, and with it comes a new way to configure navigation commands. The new projections.json replaces editor.json , which in ...

May 27, 2013 mmongeau ruby conference rubykaigi reddotrubyconf thoughtbot in Asia We flew all the way over the Pacific ocean to meet you fellow Rubyists at these conferences in Asia in the upcoming weeks: May 30 - June 1 — RubyKaigi (Tokyo, Japan) こんにちは、日本！ We’ll be having two thought...

In this week’s podcast episode, recorded at RailsConf 2013, Ben Orenstein is joined by Jeff Casimir and Katrina Owen from Jumpstart Lab and gSchool to discuss performing, speaking, and imposter syndrome, preparing for your talk, and what makes a good talk and how to give one. The also...