CSV Methods for ActiveRecord Models

The following content comes from our github.com account. You can view the gem here. Here is a gem we built for adding default CSV behavior to ActiveRecord models using Ruby on Rails. Overview Extending default CSV behavior to Active Record models making it easier to offer CSV downloads. Default behavior should iterate over all belongs_to, has_one and has_many associations and add methods …

Let’s Encrypt on Ubuntu 14.04 with NGINX & Cron

Securing a website and maintaining a certificate can be quite a hassle. Let’s Encrypt is a completely free, automated way to turn on and off HTTPS with simple commands. The following content is partially based on the “Getting Started” tutorial from letsencrypt.org with some additional steps and instructions for people using NGINX. Installing Let’s Encrypt In your terminal, perform the …

Tracking Offline Revenue With Rails & Google Analytics

The following content is based partly on a tutorial from LunaMetrics, entitled “Tracking Offline Transactions with Universal Analytics” with additional steps for implementing within a Rails application. Tracking offline revenue is a major headache for small businesses. So, we decided to briefly outline our approach to finding the answers that Google Analytics lack to provide. Overview To get started, we …

Receive emails in Rails app using AWS Lambda & SES

Here is a basic Ruby on Rails application demonstrating exactly how to receive emails from an Amazon Web Services (AWS) Lambda process. This method works for any Rails app where you want users to be able to send emails into your Rails app. Setup AWS S3, Lambda, and SES We will begin with getting all the pieces in place in …

AML_2

Applying Prediction Results From Amazon’s Machine Learning

Machine Learning Is More Than Just Making Predictions We wanted to follow-up on our previous post to talk a little more about the actual implementation of Machine Learning applications. Specifically dealing with the need to handle cases of (1) low-certainty predictions and (2) mis-prediction. In our opinion, how you use and approach the results can be more important to a …

aml1

Amazon’s Machine Learning Can Help Solve Workflow Constraints

A Document Processing & Workflow Bottleneck We were pretty excited when AWS announced its new Machine Learning service earlier this year and began immediately thinking about projects that would benefit from it. Our first chance to implement the new service was last month on a project for a large freight factoring business here in Dallas, Triumph Business Capital. The potential …

beach_chairs

Geolocation and finding the closest dropoff point to a coordinate

Everybody’s Got Problems In consulting, one of the best parts of our job is getting to see all the interesting and sometimes unique problems high-growth businesses face. While rebuilding Live Well 30A’s eCommerce site and platform, one of the biggest issues they faced was figuring out where to put people’s beach chairs. When they first told us this, we didn’t …

map

Determining delivery zone for a shipment using geocodes

On a recent project, we were building a custom mobile workforce management system for handling deliveries of equipment. The management team wanted to start separating deliveries into zones and build routes based on optimal delivery patters in those zones. Here’s a fairly detailed breakdown of how we approached the problem and some simplified code examples. Step 1: Drawing Delivery Zones …

NGINX forwarding HTTPS traffic to new domain

We had some added stress the other night when we were pushing a new app into production for a client. As part of the new app launch, our client wanted to move his site to a new domain that he purchased. No problem, right? Just setup some NGINX server blocks to 301 redirect all traffic from the old domain to …

OCR on multi-page pdf using GhostScript and Tesseract

We’ve been doing a lot of image management and OCR work here recently, and we started running into performance issues when using ImageMagick’s convert method on large multi-page scanned PDF’s. The real issue was that we needed high-quality images for our OCR processing. This was the ImageMagick command we were using previously which we got from this post. $ convert …