robots.thoughtbot.com Archives - 21 September 2017, Thursday

  • A Simple Approach to Thread-Safe Networking in iOS Apps

    robots.thoughtbot.com 21 Sep '17, 12am

    I’ve intentionally left a lot of details out in order to keep this example short, but real code would potentially need to deal with error handling, cancellation and more. And what about performing the requests in parallel? Serialising these two unrelated requests is potentially wastef...

  • Booleans and Enums

    robots.thoughtbot.com 20 Sep '17, 12am

    Booleans are one of the first data types new programmers learn and with good reason: having only two states makes them one of the simplest. Surely something so simple can’t be abused? It turns out it’s easier than you’d think to make a mess with Booleans. Languages with first-class su...

  • Better Date Manipulation in PostgreSQL Queries

    robots.thoughtbot.com 19 Sep '17, 12am

    Better Date Manipulation in PostgreSQL Queries Derrick Carr September 19, 2017 postgres sql data web Sometimes we need functionality outside the reach of our ORM’s API. When that happens we write good ol’ SQL. It’s a trade-off. We give up convenient date and time helper methods (like ...

  • Finding the Oldest/Youngest Records Within a Group

    robots.thoughtbot.com 18 Sep '17, 12am

    One caveat: there’s a slight issue with using a datetime as an identifier here. What if two orders have the same datetime (specifically the most recent)? In the case of users making orders it’s pretty unlikely short of a double-submit bug, but depending on your use-case for the table ...

  • Styling a Middleman Blog with the Bourbon Suite: Revisited

    robots.thoughtbot.com 15 Sep '17, 8pm

    It’s been a while since we first released our blog post about setting up a Middleman Blog with the Bourbon suite and some things have changed since 2014. Middleman is one of our favorite static site generators and Bourbon is an open-source, lightweight scss suite for styling websites....

  • Deadlines

    robots.thoughtbot.com 11 Sep '17, 12am

    Deadlines are a tool. There are good and bad deadlines. This post is going to outline how you could be using deadlines to superpower your project as well as some of the pitfalls that we see many organizations fall into. The following is taken verbatim from the excellent post How Do Yo...

  • Refactor in a branch

    robots.thoughtbot.com 07 Sep '17, 3pm

    That brings us to the third kind of refactoring: re-architecting toward a goal. This is when you can use a classical best practice (as examples: composing instead of inheriting; replacing a global with an instance variable) to make your feature easier to implement. It’s the most fun k...

  • Things I wish I knew before my first Design Sprint

    robots.thoughtbot.com 06 Sep '17, 12am

    There are plenty of great books , tutorials, and case-studies that can teach you to run a design sprint. But, at some point you have to take the plunge and put that learning into practice. Design sprints encourage mistakes, practice and learning that’s what makes them so useful to the...

  • thoughtbot and the Holy Grail

    robots.thoughtbot.com 30 Aug '17, 3pm

    Update: Our quest for full-stack testing continued with writing the capybara-webkit driver . We also wrote about capybara-webkit more recently . Stop! Who would cross the Bridge of Death must answer me these questions three, ‘ere the other side he see. Ask me the questions, bridge-kee...

  • Lean & Maintainable Reports with Heroku Dataclips

    Lean & Maintainable Reports with Heroku Dataclips

    robots.thoughtbot.com 21 Aug '17, 11am

    All reports take effort: Writing the database query, maintaining it as data structures change, and allowing business users to customize the report all cost time. Layer on supporting different output formats & security and one can see the gulf between cobbling together a casual databas...

  • @jc00ke @garybernhardt

    Advanced Postgres Performance Tips

    robots.thoughtbot.com 10 Aug '17, 7pm

    Materialized views are especially helpful when your select list includes a subset of columns, you perform identical operations such as COUNT or SUM or extracting part of a jsonb object on every query, and when JOINing additional tables. When it comes time to actually retrieve rows, th...

  • Nesting grids with Neat 2

    robots.thoughtbot.com 08 Aug '17, 12am

    Nesting grids with Neat 2 Will H McMahan August 8, 2017 neat bourbon design sass open source web Neat 2 introduces a lot of new interesting features and functionality, and also reworks a few key principles. One of these features is the ability to create nested grids. Nested grids are ...

  • A Crash Course in Analyzing Memory Usage in Ruby

    robots.thoughtbot.com 07 Aug '17, 12am

    The app handles a number of legacy URL paths, and redirects each one to a configurable location. This is implemented as a custom middleware. When the app boots we load the YAML configuration, which maps from legacy paths to new paths, into a hash (both keys and values are strings). Wh...

    Related:
    1. 361: August 10, 2017 rubyweekly.com 10 Aug '17, 9am
  • Lessons From Using Phoenix 1.3

    robots.thoughtbot.com 01 Aug '17, 12am

    It’s more apparent to me in Phoenix 1.3.0 that the generators are much more a teaching tool for new developers than meant to be used in an ongoing fashion throughout a project’s lifetime. If you’ve formed your opinion, or your organization has a coding style within Phoenix, then you m...

  • Cutting our Blueteeth on React Native

    Cutting our Blueteeth on React Native

    robots.thoughtbot.com 17 Jul '17, 12am

    Cutting our Blueteeth on React Native Ian C. Anderson and Blake Williams July 17, 2017 react native javascript ios android mobile We’ve been working on a project with Zagster that uses Bluetooth Low Energy (BLE) to connect to a BLE-powered bike lock so that we can authorize, read, wri...

  • Join us in SF for PLIBMTTBHGATY

    robots.thoughtbot.com 14 Jul '17, 8pm

    On Saturday, August 5th, we’ll be hosting a PLIBMTTBHGATY event in our San Francisco office. If you’ve never attended one of these, you’re missing out. It’s a lightly-structured party where people get together and work on a project in a new programming language or framework, either wi...

  • Fight back UTF-8 Invalid Byte Sequences

    robots.thoughtbot.com 14 Jul '17, 8pm

    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 are plenty of answers—some using the deprecated iconv library—that might lead y...

  • London Panel Discussion: The Developer's Path

    robots.thoughtbot.com 11 Jul '17, 12am

    London Panel Discussion: The Developer's Path Nick Charlton July 11, 2017 events Are you interested in how developers get better and how you can apply that to yourself? We’re hosting an event in London to explore thoughtbot’s approaches to this and how other organisations tackle this ...

    Related:
    1. Open discussion: redmine.org 09 Jul '17, 2pm
  • Alternative View Layers for an Elm App

    robots.thoughtbot.com 10 Jul '17, 12am

    port module Main exposing (main) import Json.Decode -- A bug in Elm forces us to explicitly require this type alias Model = Int port increment : ( Int -> msg ) -> Sub msg port reset : ( () -> msg ) -> Sub msg port render : Model -> Cmd msg type Msg = Increment Int | Reset subscription...

  • Use Factory Girl's build_stubbed for a Faster Test Suite

    robots.thoughtbot.com 05 Jul '17, 2pm

    is the younger, more hip sibling to build ; it instantiates and assigns attributes just like build , but that’s where the similarities end. It makes objects look like they’ve been persisted, creates associations with the build_stubbed strategy (whereas build still uses create ), and s...

  • Dive Into Neovim & Vim 8, Now on Upcase

    Dive Into Neovim & Vim 8, Now on Upcase

    robots.thoughtbot.com 04 Jul '17, 12am

    There’s nothing more frustrating than a clunky workflow or IDE when coding. It can take years to optimize your workflow to code quickly and effectively. One of the most important parts of that workflow is your text editor. If you’re a Vim or Neovim user, it feels like there is unlimit...

  • Ruby 2 Keyword Arguments

    robots.thoughtbot.com 30 Jun '17, 7pm

    Like most things, keyword arguments have their trade-offs. Positional arguments offer a more succinct way to call a method. Usually, the code clarity and maintainability gained from keyword arguments outweigh the terseness offered by positional arguments. I would use positional argume...

  • Simple Phoenix Text Inputs with Formulator

    robots.thoughtbot.com 30 Jun '17, 12am

    If you’re a Rails developer and new to Phoenix, you’ll soon discover that Phoenix tries to get the form errors closer to the input tags themselves, as opposed to Rails where error messages are typically flashed near the top of a page. Getting used to this difference is like putting my...

  • Why Do Rubyists Test So Completely?

    robots.thoughtbot.com 29 Jun '17, 6pm

    The Ruby community, according to some data I am making up, has the strongest test-driven development attitude. Not all of us TATFT ; not all of us test most of the time; and not all of us test ever—but those who do test make up a larger proportion than they do in, say, the Java world....

  • Fun Shell Commands

    robots.thoughtbot.com 23 Jun '17, 12am

    Fun Shell Commands Thom Obarski June 23, 2017 emacs new york city From Pandora playback and YouTube downloading, to Instagram image saving and Google Translate, Jay Dixit talks at this month’s New York Emacs Meetup on how he optimizes his daily routine directly from the shell! Check o...

  • Tips for Using FactoryGirl Without an ORM

    robots.thoughtbot.com 22 Jun '17, 12am

    Recently I’ve been working on a Rails project that doesn’t need any database persistence and therefore doesn’t use an object-relational mapper like ActiveRecord. Instead data is fetched from an external JSON API and parsed into value objects written in plain Ruby.

  • How to Git with Unity

    robots.thoughtbot.com 21 Jun '17, 12am

    Noise : The editor manages hundreds of temporary files. Merely opening or closing the editor will create, delete, or modify some of these files. Additionally, since it’s possible to develop on and build for multiple platforms, there are many more extraneous files than you might expect...

    Related:
    1. Git Cop 1.0.0 rubyflow.com 19 Jun '17, 12pm
  • Recapping the First Artboard 1 Event

    Recapping the First Artboard 1 Event

    robots.thoughtbot.com 20 Jun '17, 12am

    Last week we hosted the first session of Artboard 1 , a design event series we started in San Francisco. It was a 1-hour design challenge where teams worked on one of three possible prompts generated by Sharpen.design : designing a poster for public libraries, a chatbot for the dark w...

  • Creating Gesture-Based Gradients and Shipping Fast with React Native

    robots.thoughtbot.com 16 Jun '17, 5pm

    Gradients are beautiful. You can find them in nature during dusk and dawn. Or after an afternoon thunderstorm when a rainbow appears. These moments are impactful and anchored in experiencing color. These are the moments you share with your family and friends from your travels or your ...

  • Headless Capybara Feature Specs with Chrome

    robots.thoughtbot.com 16 Jun '17, 12am

    While tests executing with Capybara-WebKit are headless, I initially did not have this option when configuring ChromeDriver. In this initial configuration, I was reminded that it is occasionally useful to watch a test execute without having to resort to save_and_open_screenshot . I wa...