GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS

Written by thoughtbot

Building Ralph with SVG

SVG (Scalable Vector Graphic) is a graphic format, similar to PNG or JPEG, that’s great for icons, charts and supporting high-DPI displays. They’re vector-based, so you won’t lose visual fidelity or see any pixelation, no matter what size your graphic...

Using Clearance with RailsAdmin

These days, I find myself implementing RailsAdmin on almost every consulting project that I’m on. While RailsAdmin is not a replacement for a custom or complex admin interface, it’s a great way to give non-technical stakeholders access to the data...

Intent to Add

The git add command runs blind, but can be controlled with more fine-grained precision using the --patch option. This works great for modified and deleted files, but untracked files do not show up.

$ echo "Hello, World!" > untracked
$ git status ...

Let's Talk About Dials

When it comes to designing dashboards for web applications, people often turn to dials as a way of representing a single data point that fluctuates over time. Think of a speedometer in a car.

Speedometer

It’s easy to glance down and get the current speed on...

Ship You a Haskell

With the release of a recent feature on the blog, we can now say something we've hoped to say for some time: we shipped Haskell to production! In this post, I'll outline what we shipped, how it's working out for us, and provide some solutions to the various hurdles we encountered.

WeeChat for Slack's IRC Gateway

WeeChat is a text based chat client that runs on many different platforms like Linux, Mac OS X, various BSD variants and Windows (through cygwin). WeeChat is mainly used for IRC, aims to be fast, light and extensible and is a more modern alternative...

Meditations on a Class Method

I keep a file of code I like. When looking for inspiration, I read through the file. It’s short; I often re-write the samples to be nothing but the minimally inspiring thought.

Here is the first snippet:

def self.run(user)
  new(user).run
end

An Explained psqlrc

Let’s walk through my short psqlrc(5) to see what I’ve set, and to inspire you to find your own configuration that fits into your workflow. Here is my complete psqlrc:

\set ON_ERROR_ROLLBACK interactive
\set COMP_KEYWORD_CASE upper
\set HISTFILE ...

Preload Resource Data into AngularJS

Preloading, or bootstrapping, data resources from the server via HTML is a common technique used in JavaScript web development. This technique allows the application to avoid making an extra HTTP request to get that initial data for rendering on the...

Foolproof I18n Setup in Rails

Let’s make I18n on Rails better, quickly and easily. These tips have helped us here at thoughtbot and caught some easy-to-fix but hard-to-track-down mistakes.

Raise an exception on missing translations

When a translation is missing, Rails will fall...

How Rails' Type Casting Works

Have you ever noticed that when you assign a property to an Active Record model and read it back, the value isn’t always the same? Here’s an example:

class StoreListing < ActiveRecord::Base
  connection.create_table :store_listings, force: true do...

Swift Sequences

We’re incredibly excited about the new Swift programming language announced by Apple at this year’s WWDC. As a way of experimenting, we’ve begun looking into what it would be like if we rewrote Liftoff, our command line Xcode project generation/configuration...

How to Share a Session Between Sinatra and Rails

As Rails developers, we run into Sinatra apps all the time: gems such as Resque which expose a dashboard via Sinatra, legacy Sinatra apps that run alongside a main Rails app, and Sinatra APIs embedded within a Rails app, to name a few examples. Here...

iOS Text Kit Basics

Apple's Text Kit framework, added to iOS 7, lets you customize layout of rich text in your apps in a variety of ways. This will show you how to get started by implementing a multi-column view using Text Kit.