robots.thoughtbot.com Archives - 04 May 2016, Wednesday

  • Testing Your Style With ESLint and Mocha

    robots.thoughtbot.com 04 May '16, 12am

    I’ve been working on a front-end application that uses ESLint for linting and Mocha as our testing framework. We’ve tried a few solutions to integrate linting into our workflow but it can easily be ignored. To make sure linting errors were given the attention they deserved we decided ...

  • Routing in Elm with Hop and Mailboxes

    robots.thoughtbot.com 03 May '16, 12am

    for a while now and, in the interest of understanding what types of applications can be built with the language, I decided to try out Hop , a routing library for single page applications that, as of version 4.0, supports

  • A New Look for PLIBMTTBHGATY

    robots.thoughtbot.com 03 May '16, 12am

    Programming Languages I’ve Been Meaning To Try But Haven’t Gotten Around To Yet. What is it even? And how do you do it? After a year of organizing PLIBMTTBHGATY events and getting to know some members of the community, I teamed up with thoughtbot designer Connie Chan to help us answer...

  • Introducing Empties – Unstyled Components

    robots.thoughtbot.com 02 May '16, 12am

    Announcing the latest addition to the Bourbon suite! Meet Refills’ less fashionable sibling, Empties , a new library of components that are completely – or for the most part – unstyled. The Weight of Refills A few years ago we came up with the idea for the Refills Components Library t...

  • Accessibility Testing on Android

    robots.thoughtbot.com 29 Apr '16, 12am

    Programming an accessible Android app is not technically difficult, but is often skipped in the rush of a deadline. With the right tools, skipping accessibility is a compromise you don’t have to make. Here are some ways to help your team ensure that accessibility is added and part of ...

  • Postgres Window Functions

    robots.thoughtbot.com 28 Apr '16, 7pm

    CREATE TABLE posts ( id integer PRIMARY KEY, body varchar, created_at timestamp DEFAULT current_timestamp ); CREATE TABLE comments ( id INTEGER PRIMARY KEY, post_id integer NOT NULL, body varchar, created_at timestamp DEFAULT current_timestamp ); /* make two posts */ INSERT INTO posts...

  • Building iOS Interfaces: Subclassing Views

    Building iOS Interfaces: Subclassing Views

    robots.thoughtbot.com 28 Apr '16, 12am

    , we implemented a custom button by going back and forth between Interface Builder and Swift–a process that would quickly become strenuous if repeated over and over, unless you are building a flashlight app with a single button in the UI. Putting aside the fact that repetition is no f...

  • My coworker @jessieay is such a master at freaking me out

    How To Create GitHub Avatars For Pairs

    robots.thoughtbot.com 27 Apr '16, 5pm

    Whether you love or hate pairing, we can all agree that attributing work to both pair partners is a pain. Enter: The Easiest Solution Possible™. Step 1: Create a commit with both of your names Before you merge your commit, run the following: git commit --amend --author="Jessie and Joe...

  • Have Some (Referential) Integrity with Foreign Keys

    robots.thoughtbot.com 27 Apr '16, 3pm

    Referential integrity is a relational database concept that states implied relationships among data should be enforced. Referential integrity ensures that the relationship between rows in two tables will remain synchronized during all updates and deletes. Rails allows us to easily set...

  • Factories Should be the Bare Minimum

    robots.thoughtbot.com 26 Apr '16, 12am

    I left the following feedback on a recent pull request: factory :deliverable do title "A cool title" tags { { assigned: true, status: "draft" } } Is this required for the factory to be valid? How would you feel about having the factory only add the bare minimum required to create this...

  • How to Create Postgres Indexes Concurrently in ActiveRecord Migrations

    robots.thoughtbot.com 25 Apr '16, 5pm

    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 large table, indexing can take hours. However, Postgres has a CONCURRENTLY option for CREATE INDEX that creates the ind...

  • Blocks, Procs, and Enumerable

    robots.thoughtbot.com 25 Apr '16, 12am

    Blocks allow methods to take arbitrary snippets of code as arguments and run them. The pattern of passing in an anonymous function into a method is commonly used across multiple languages. JavaScript, for example, is notorious for its use of deeply nested anonymous callback functions.

  • Running Acceptance with Heroku Review Apps

    robots.thoughtbot.com 22 Apr '16, 5pm

    Last week, Heroku announced that Review Apps were generally available. Review apps are instant, disposable Heroku app environments that spin up automatically with each GitHub pull request. They allow teams to automatically build and test any pull request, updated at every push, at a t...

  • GIT PUSH && GIT PAID

    GIT PUSH && GIT PAID

    robots.thoughtbot.com 21 Apr '16, 12am

    ASCII and Git lovers rejoice. Your shirt has arrived. GIT PUSH && GIT PAID. It’s what all of us do everyday. We’re proud of it and figure you are too. So we’re selling an exclusive shirt on Cotton Bureau for $30. There’s also a sweatshirt if you’re feeling chilly. It’s $45. Both of th...

  • Postgres Index Types

    robots.thoughtbot.com 21 Apr '16, 12am

    As discussed in “A Grand Piano for Your Violin” , indexes are quite useful for speeding up database queries. When creating an index using CREATE INDEX , Postgres will create a B-Tree type index by default. The B-Tree type is great for general purpose indexes but there are special case...

  • PostgreSQL performance considerations

    robots.thoughtbot.com 20 Apr '16, 4pm

    There are a number of variables that allow a DBA to tune a PostgreSQL database server for specific loads, disk types and hardware. These are fondly called the GUCS (Global Unified Configuration Settings) and you can take a look via the pg_settings view. There are also a few of things ...

    Related:
    1. Postgres Index Types robots.thoughtbot.com 21 Apr '16, 12am
  • Lists, Vim, and You

    robots.thoughtbot.com 20 Apr '16, 12am

    Vim truly excels at editing text, but some common text-editing tasks are more daunting than others to do from our favorite text editor. Today, we are going to cover the various ways you can search and replace bits of text, in your shell and beyond to Vim. From the shell From our dotfi...

  • Observables, and Callbacks and Threading, Oh My!

    robots.thoughtbot.com 19 Apr '16, 5pm

    So you want to react-ify your Android app? Excellent! Welcome to the club! If you’re like me you’ll start by using several of the RxBindings libraries to turn those ugly boiler plate Android UI callbacks into sexy new Observable s. And if you’re even more like me, after a while you’ll...

  • Rolling Random Romans

    Rolling Random Romans

    robots.thoughtbot.com 18 Apr '16, 12am

    Romans had a different naming scheme for women and men. We could randomly generate a gender and then conditionally generate the proper name based of the result. Romans were also broken into two broad social classes: patricians and plebians. Some families (and thus the nomen) were excl...

  • Maybe Thinking

    robots.thoughtbot.com 15 Apr '16, 5pm

    completionTimeAverageInWords : List Float -> String completionTimeAverageInWords teamResultCompletionTimes = let completionTime = averageTeamCompletionTime teamResultCompletionTimes in Maybe.withDefault "not enough results" <| Maybe.map distanceOfTimeInWords completionTime averageTeam...

  • Recover Data from Production Backups with ActiveRecord

    robots.thoughtbot.com 13 Apr '16, 12am

    What follows is a story about things going wrong with production data. But don’t worry, this one has a happy ending! We’ve been working on a product which tracks interesting information about companies, pulling data from a number of different sources. Users can then interact with thes...

  • How to Make a Chrome Extension

    robots.thoughtbot.com 11 Apr '16, 6pm

    If you’re wondering how to make a Chrome Extension, Chrome’s extension documentation is great for basic implementations. However, to use more advanced features requires a lot of Googling and Stack Overflow. Let’s make an intermediate Chrome extension that interacts with the page: it w...

  • Automatically wait for AJAX with Capybara

    robots.thoughtbot.com 10 Apr '16, 5pm

    Capybara’s very good about waiting for AJAX . For example, this code will keep checking the page for the element for Capybara.default_max_wait_time seconds, allowing AJAX calls to finish: expect(page).to have_css('.username', text: 'Gabe B-W') But there are times when that’s not enoug...

  • Controlling color with Sass color functions

    robots.thoughtbot.com 07 Apr '16, 9am

    Sass comes with functions that can easily be applied to colors in your CSS properties. These functions, when used correctly, can be incredibly powerful. They take some of the sting out of choosing and manipulating colors. When used with variables, they can speed up development drastic...

  • PGP and You

    robots.thoughtbot.com 05 Apr '16, 9pm

    Your decision? 0 Enter an optional description; end it with an empty line: > Reason for revocation: No reason specified (No description given) Is this okay? (y/N) y You need a passphrase to unlock the secret key for user: "Caleb Thompson <[email protected]>" 2048-bit RSA key, ID A0...

  • Announcing Bamboo, Email with a Functional Twist

    robots.thoughtbot.com 04 Apr '16, 12am

    Bamboo is a testable, composable and adapter based email library for Elixir. You might be thinking, what could possibly be so cool about sending email in Elixir? Can it be any better than what I’ve used in the past? Hopefully we can show you what the problems were with existing soluti...

  • Design Leadership & Culture at thoughtbot

    robots.thoughtbot.com 31 Mar '16, 12am

    Over the last few years we’ve witnessed the maturation of the designer role. Companies are investing in designers beyond just pushing pixels and production work. People rely on designers more-and-more for business and product decisions . With this growth of opportunities we’ve seen mo...

  • Post-PLIBMTTBHGATY Portland Précis https://t.co/S3kFkzUsM0

    Post-PLIBMTTBHGATY Portland Précis

    robots.thoughtbot.com 29 Mar '16, 12am

    Post-PLIBMTTBHGATY Portland Précis Bernerd Schaefer March 29, 2016 portland We recently organized our first event in Portland: PLIBMTTBHGATY . It’s like an unconference for programming languages, a lightly-structured party for people to get together and try new languages. It’s a mouth...

  • Paperclip is ready for Rails 5

    robots.thoughtbot.com 25 Mar '16, 12am

    Paperclip v5.0.0.beta1 is out . It supports Rails 4.2 and 5 (latest beta), AWS SDK V2, consumes less memory, and has other improvements and bug fixes. It’s also smaller. While v4.3 branch takes around 2 hours to run on CI , master takes around half an hour. To make it so, we simplifie...

  • Start Simple

    robots.thoughtbot.com 21 Mar '16, 12am

    In the past year I’ve worked on quite a few projects that have had very ambitious development goals from the beginning of the project. A few of these goals were truly necessary to ship a quality product, but many of these goals cost time, money, and in some cases the project. Lately t...