Journey to Sucker Punch

Background jobs are great. Mailing, data processing, image processing, database operations… you name it. If its a repetitive blocking process for the user and its not time-sensitive, then its probably suited to be moved to a job. delayed_job My go-to ActiveJob adapter for Rails has always been Delayed Job.…

Developing sanely on Windows

Preamble You might think, "Why are you trying to develop on Windows? Why not use OSX or (insert Linux distro)". Its because I'm preparing for a stable future. With the decisions of Apple the past year with the iPhone and new Macbook, I no longer like the direction…

Counting Unique Options in Shopify

Ever wanted to quickly display a how many of an option a product contains? Available in 4 sizes ... Available in Red, Blue, Green ... Available in 10 colors Here's an example of how to do just that (for color). Simply open your product's loop liquid and add this block at the…

Precompiling Assets In Your Rails Engine

This'll be a quick post to highlight an issue I had where I needed to precompile an asset file for my Rails engine that was not to be compiled with the other engine assets. Recently, I added TinyMCE-Rails to Guts instead of rolling it in on its own. This allows…

Polymorphic and Route Concerns... who is who?

The goal of this post is to outline some tips on easily figuring out the parent object for a polymorphic modal/route/controller. Let's start with the basics... Polymorphic For those unfamiliar to it, Polymorphic is an Active Record association type where a model can belong to other models. As…

Calculating Percent Saved with Shopify

Visually displaying to the customer how much they are saving is a big help to driving them towards a purchase. This is a simple snippet and guide to help you achieve this functionality in your Shopify stores. First, to calculate the percentage saved, lets look at the basic math for…

all_products... finally

Shopify has finally implemented a global variable for accessing products. Shopify has global variables for many things like Collections, Linklists, pages, etc, so you can do things such as access a collection by its handle collections.my-cool-toys.products. However, it always lacked the ability to look up products by their…

WP User Themes

I've released a unit-tested plugin called Wp User Themes. It allows users to switch themes in their profile section (useful for development!) You can checkout the plugin here Cover image credit: Ben Kolde…

Get Original Sized Images from a Wordpress Post Gallery

Recently I was working on a project where I needed to modify an existing page which had multiple galleries. This change required me to have access to the original uploaded images. Heres a simple function I wrote which returns the images easily in an array format. # Input Hey comes see…

Quickly Get All Products in Your Shopify Store with Ruby

This is a simple snippet I've used over-and-over again this year to batch process products (modify tags, pricing, etc). It simply calculates the number of pages of products, pushes each page of products into a master array and returns them all. Should work well for others so I thought I…