We're hiring!

We're actively seeking designers and developers for our all three of our locations.

Platforms & Languages

Eliminating Multiple-Style Classes with @extend and SCSS

SCSS has numerous beneficial features, include one that I really came to love during my last project. The @extend feature really took the cake, and I think will help me along my path as a maker! It has a couple downfalls in practice, but it is such a great feature that I want to convince you to give it a try on your next project.

What is @extend?

Extend is a lot like inheritance in programming. It lets you import css styles from a previously defined css rule into another rule.

Let’s say you have three elements on the DOM that you want to style. Each element will look the same except each element’s border color will be different. Using the @extend feature, one approach to solving the styling of the elements is to define one class for the structure of the element. We will call the class .element, and define the height, width, background color, border thickness, etc. Read more on Eliminating Multiple-Style Classes with @extend and SCSS…

Also posted in Web Apps | Tagged | Leave a comment

Breadcrumbs in Ember.js

After searching for a way to display breadcrumbs with Ember, I was left disappointed with what I found.

I wanted something that would:

  • Be isolated, so I didn’t have to clutter up my ApplicationRoute or commit other such crimes.
  • Be flexible in how the breadcrumbs are named (e.g., I want to include some data from my models).
  • Be flexible in which routes actually display breadcrumbs.
  • Be flexible in which route a breadcrumb will link to (since it may not always be the same route).
  • Automatically update whenever the route changes, regardless of which template the breadcrumbs are placed in.
  • Be easier than poaching salmon in a dishwasher.

So, I wrote my own. Read more on Breadcrumbs in Ember.js…

Also posted in Ember.js | Leave a comment

Funkify and Pattern-Proc: Messing with Ruby for Fun (but probably not profit)

Partial application is awesome. I love it. Same goes for functions as first-class citizens. I wish these were features in every language. I’m working in Ruby right now, and every time I use map() or reduce(), I find myself wishing I had them.

class MyClass
  def negate(x)
    -1 * x
  end
 
  def add(x, y)
    x + y
  end
end
 
obj = MyClass.new
values = [1,2,3]
# this is needlessly verbose
values.map do |val| 
  obj.negate(val) 
end # [-1, -2, -3]
 
# this is disgusting
values.map(&obj.method(:negate))
 
# Ruby, why u no allow this?
values.map(&obj.negate) # although dropping the & would be even better
# And how about instead of this
values.map do |val|
  obj.add(2, val)
end
# we could just do this?
values.map(&obj.add(2))

Funkify to the Rescue

To overcome these limitations (and because it sounded fun), I started looking for a gem that would help with writing code that supports partial application. Read more on Funkify and Pattern-Proc: Messing with Ruby for Fun (but probably not profit)…

Also posted in Functional Programming | Tagged , | Leave a comment

Evil Android Styling

I love writing applications for the Android platform, partly because I find that there are a lot of very nice abstractions in the Android APIs. One of my favorite features is how easy it is to style the platform widgets.

If you haven’t worked with Android styling before, I’d like to introduce you to some of the key concepts by having a little fun and breaking as many design guidelines as possible in a one-page application. We’ll create rounded rectangles, borrow iOS patterns, and promise to apologize afterwards for being “evil”.

Our Application

I’m going to use a very simple application with just two activities. The first one includes a few stock widgets, and the second activity includes the same widgets, with our non-Android styling. You can clone the application repository from Github if you’d like to play around with the code. Read more on Evil Android Styling…

Also posted in Android | Leave a comment

Developing a Mobile App? Some Numbers You’ll Need to Know

Are you thinking about developing the next great mobile app? When creating your business strategy you’ll want to know:

  • How many potential app users there are?
  • What platform you should develop for?
  • What apps have the greatest reach?
  • What apps generate the most revenue?

The mobile app market is evolving quickly, so the answers to the above questions change frequently. In this blog post, I will report the most recent numbers, and also provide links to resources that you can use to stay up to date with the information you need. Read more on Developing a Mobile App? Some Numbers You’ll Need to Know…

Also posted in Mobile Apps, Planning Your Project | Tagged , | Leave a comment

Battling Rails Translations with AnnoTranslate

Localization is a complex matter in software development, and it is usually put off as a clean-up task at the end of a project. Content translation is usually contracted out and performed by non-developers, so there’s also a technical gap to overcome.

After battling Qt translations for months on a previous project, I created the AnnoTranslate Rails middleware stack plugin to ease the burden of the developer/translator interfacing and workflow in Rails apps.

Providing Context for Translators

In small-scale Rails apps, providing context information to translators with little-to-no domain knowledge can be painful, but it’s do-able in an ad-hoc fashion. As the breadth and amount of content grows, a more structured workflow is warranted, which leads to the desire to automate the tedium. Enter AnnoTranslate. Read more on Battling Rails Translations with AnnoTranslate…

Also posted in Ruby on Rails | Tagged , | Leave a comment

5 Linux Filesystem Utilities for Diagnostics

A great deal of the time, I work on the command line — usually logged into a remote system, doing some tasks or troubleshooting some problem. Quite often, this involves checking or manipulating something on the filesystem.

There are dozens of filesystem utilities. Most are well-known file manipulation utilities such as mv, rm, touch, mkdir, etc. However, there are several less familiar, but very powerful tools that I find myself using on a nearly daily basis. The following Linux filesystem utilities are ones I find particularly helpful for diagnosing issues and gathering information to solve problems.

Free Disk Space

Finding the amount of available free disk space is important — especially if a system has a low capacity hard drive or typically runs close to the margins. Whenever I start seeing strange failures on a system, one of the first things I check is disk utilization. The df command allows me to quickly check if a system is running near disk capacity. Read more on 5 Linux Filesystem Utilities for Diagnostics…

Also posted in DevOps & System Admin. | Tagged | Leave a comment

Ruby Queue Pop with Timeout

While writing some ruby scripts to handle asynchronous messages to and from some external hardware I ran into a problem. I wanted to wait on a queue of responses until I either got a response, or a timeout expired. Unfortunately this turned out to be a bit harder than I expected. The two most common answers when I search for “ruby queue pop with timeout” or “ruby queue timeout” are to either use some variant of “run it in a separate thread and toss in an exception when you want to stop” (such as ruby’s Timeout), or to use the non-blocking pop, with something like:

Read more on Ruby Queue Pop with Timeout…

Also posted in Ruby | Tagged | 2 Comments

Google Analytics for Single-Page Web Apps with Ember

Single-page web apps are awesome — they have so much flexibility and power. Unfortunately, when users browse a single-page web app, Google Analytics doesn’t work as intended when changing “pages”. Under the hood of these engines lies DOM manipulation to change what is displayed on screen, but Google Analytics watches for page changes. Fortunately, Ember makes it easy to hook into the “page changes” to allow for tracking.

The implementation is fairly simple — you need an initializer and the standard Google Analytics tracking snippet. As normal, follow the instructions to place the analytics code into your index.html. If you are serving up you app through Rails or another engine that builds your pages, place the code in the page that loads your Ember files. Read more on Google Analytics for Single-Page Web Apps with Ember…

Also posted in Ember.js | Tagged , , | 2 Comments

Comparing replay, replayLast, and replayLazily

A co-worker recently asked me about the difference between -replay, -replayLast, and -replayLazily in the ReactiveCocoa library. I had a vague understanding of the three but was not able to confidently explain the difference, so I thought I would look into it further.

I found the header documentation to be difficult to understand if you don’t have a good understanding of RACReplaySubject and RACMulticastConnection, so I’m going to try to explain the replay methods without getting into those underlying concepts.

Subscribing to a Signal

With a “normal” RACSignal each subscription to the signal causes the subscription code to be executed again, and the subscriber only receives values that are sent after the subscription is made. I think it is easiest to show this in two different examples. Read more on Comparing replay, replayLast, and replayLazily…

Also posted in Objective-C | Tagged , | Leave a comment