Blog

Parsing Domain Names — Now in Gem Form!

A feature for an internal Ruby project here at Quick Left necessitated parsing the domain from a URL. This seems like a problem for which there must already exist a solution, but it surprisingly turns out that there is no available solution for this seemingly simple task.

14 Dec 2014
/

Building an Open-Source Loader for React.js

Sometimes when building client projects, it quickly becomes clear when some code is going to be used and reused. Such is the case with a loader implementation for Gociety, a mobile app we recently worked on that uses React. When that happens, we like to give back — and what better way than to open-source some code for others to use?

14 Dec 2014
/

April Fools! How We Converted Our Site to “Doge” in Just 40 Lines of Code

I recently wrote a blog post describing how to create your own RubyGem. The sample gem produced, aptly named dogeify, converts English sentences into “Doge” based upon the recently popular meme. For April Fools’ Day, we thought it would be fun to implement this gem to convert our entire site into doge. Here’s how we did it.

14 Dec 2014
/

Step-by-Step Guide to Building Your First Ruby Gem

Building your first Ruby gem may seem like a daunting task, but it’s actually not so bad. It’s quite rewarding to not only release a gem, but to see its download count climb as others put your hard work to good use, and even still as others offer to contribute new features and bug fixes to your very own gem. And thanks to RubyGems.org and Bundler, the process of creating, releasing, and implementing gems couldn’t be easier.

14 Dec 2014
/

Using Faux ActiveRecord Models in Rails 3

Implementing forms that are associated with models — specifically ActiveRecord objects — is pretty common when developing with Ruby on Rails. In fact, the built-in FormHelper assumes that you’re working with some kind of persisted object. But what happens when you want to create a form for something that is not persisted by an ActiveRecord model?

14 Dec 2014
/

Parsing Measurements in Ruby

About two weeks ago, I released a new Ruby gem into the wild named ruby-measurement. (Unfortunately, measurement was already taken.) It serves as a means of parsing human-readable text into a quantity and unit, which can then be used for converting among units and other mathematical operations. Let’s take a simple string like “4 1/2

06 Feb 2013
/

Search Amazon in Ruby

This is just a short post since I haven’t updated my blog in quite some time. I recently spent some time trying to find a Ruby gem that will search/lookup products on Amazon. My searches only yielded the Peddler and Vacuum gems, both of which I found difficult to use. This prompted me to build

27 Dec 2012
/

Sharing Sessions Between Rails and Node.js Using Redis

I’ve been spending my free hours lately working on a realtime multiplayer game. In building the game, I decided to build the front-end using Ruby on Rails with the actual game implemented using Node.js, specifically using Socket.IO. One of the first major challenges I encountered with this approach is the need to share session data

24 Aug 2012
/

Allowing Unit Tests to Work as Intended

Several months ago, I had the opportunity to improve part of a testing suite for an application I worked on. Specifically, I was improving some unit testing pertaining to the creation of DelayedJob entries when emailing users. The code being tested related to users being emailed upon registration on the site. def User < ActiveRecord::Base

15 Apr 2012
/

Creating a Custom Formtastic File Upload Input with Image Thumbnail

Just today, I ran into a situation where I wanted to modify the output generated by Formtastic while building an input element. In this particular scenario, the input field was a file input in which the user is expected to upload an image (PNG, JPG, or GIF). The customization I wanted was the ability to

26 Mar 2012
/
theme by teslathemes