Using Host Instead of “replace: true” in Angular 4

By on in Development

Let’s say that you’re working on an Angular 4 app that displays some images. You want to add a directive you can apply to any image tag to make it look fancy when you mouse over it. You also want a component that will take up 100% of its parent container’s width and display an array of images in a flex row. Let’s call these FancyImageDirective and ImageRowComponent. Continue reading …


Always Squash and Rebase your Git Commits

By on in Development

Using git for version control allows for powerful collaboration in tech teams. Like any tool, if misused, it can also cause some serious headaches. After working with a wide variety of team sizes and dynamics, I’ve found that the squash and rebase workflow helps make the collaboration process more efficient and a hell of a lot less painful.

What is the squash rebase workflow?

It’s simple – before you merge a feature branch back into your main branch (often master or develop), your feature branch should be squashed down to a single buildable commit, and then rebased from the up-to-date main branch. Here’s a breakdown. Continue reading …


Copying and Pasting with tmux 2.4+

By on in Development

At Carbon Five it’s pretty common to do our editing in vim embedded in a tmux session. Tmux, if you haven’t used it, is a “terminal multiplexer” that lets you create multiple tabs and panes in a terminal, persist terminal sessions, and (with plugins) send commands from vim to another pane. It’s also great for remote pair programming, since you can share a session over the internet.

Continue reading …


Evented Rails: Decoupling complex domains in Rails with Domain Events

By on in Development, Microservices, Rails, Ruby

Raphael Koh

In our last Domain-Driven Design discussion, we learned how to group similar business components into application Bounded Contexts, which were separated folders in our Rails apps. This segregated cohesive groups of application code into separate folder structures (bounded contexts), and gave us a jumping-off point to drawing more explicit boundaries between domains in our monolith. Now it’s time for us to re-think how to communicate from one context to another. Here’s how:

Continue reading …


Razor: Hit the Ground Running With Your Next Phoenix Project

By on in Development, Elixir, Open Source

As the popularity of Elixir and Phoenix continues to grow, we find ourselves spinning up more and more Phoenix apps for our clients and side projects. At Carbon Five, we have a pretty good consensus on our favorite practices and tools. With each new app, we find ourselves repeating the same steps to bring in many of the same resources and processes.

We created Razor, an opinionated app generator, to save ourselves this time and trouble. Razor isn’t the only one out there, but it captures our common needs and preferences at Carbon Five pretty comprehensively. It also provides a great platform for discussion; we hope to watch Razor evolve as the Elixir ecosystem grows and we continue to learn.

Continue reading …


Carbon Five + Cooper: Exploring Alexa & the Future of Voice UIs

By on in C5 Labs, Design, Development

Recently, designers and technologists from Cooper & Carbon Five sat down to brainstorm about the future of voice-driven user experiences, focusing initially on Alexa. It was a fun kickoff for what we hope turns into a series of prototypes and experiments exploring (and pushing) the boundaries of this exciting emerging technology. Here’s what we’ve discovered so far:

Continue reading …


Rails Database Best Practices

By on in Development, Rails

Working on an oldish Rails project, I came across some smelly ActiveRecord code that begged for some refactoring love. I also spent some time speeding up pages with slow/many database calls. Between those two experiences, I felt the inspiration to write-up some “Back to Basics” Rails Database Best Practices.

Rule #1: Let your Database do its Job

Databases are extremely feature rich and are really freakin fast when used properly. They’re great at filtering and sorting… and many other things. If the database can do it, it will do it way faster than doing the same thing in Ruby, or any other language for that matter.

You might have to learn a little bit about how DBs work, but honestly, you don’t have to go very deep to reap a majority of the benefits.

We generally use Postgres. What you choose is less important than getting to know it and using its features to make your product awesome. If you’re curious about Postgres, there are some good resources at the end of this post. We love it.

Our first, overarching rule: Let your database do what databases are good at, instead of doing it in Ruby.

Continue reading …


Bring clarity to your monolith with Bounded Contexts

By on in Development, Microservices, Rails

Monolithic applications are great when you start building your company, but as time progresses, they become difficult to maintain. These codebases, as they grow, easily become Big Balls of Mud.

Indiana Jones Rock

When building large applications in frameworks like Rails, the very convention-over-configuration design principles that made Rails such a joy to use begin to get in the way when the application grows in scope. You may be experiencing the same pains as well if:

  • Refactoring is difficult and tedious, because methods and classes depend on too many other classes
  • You have an ever-growing list of business objects that are difficult to keep in your head. In fact, nobody seems to be able to understand the system as a cohesive whole
  • Changing code in one area of the code leads to unexpected and unintended side effects in other areas of the code, because it’s easy to call out to global services and objects

Continue reading …