Roswell Studios

139 Fulton Street, Ste 132
New York, NY 10038


This is where we write stuff.

Shopify images for blog posts

— February 16, 2018

It is unfortunate that the Files doesn’t have an upload API that people have been asking for for at least 4 years, and apparently existed at one point. Here’s a sample solution for when you have copied the blog posts (there are several apps that do that), but now the linked images don’t work. You will need to put the images somewhere. One could use the...

Converting Product Images on Shopify

— January 8, 2018

First, it is easier and generally preferable to do this in the product uploading import CSV. But lets say the upload has already occurred, against your advice they used giant PNG images and now it is your problem to fix it because unsurprisingly the collection page loads slowly. This is not something the admin console can do, so here’s a PHP script to download png images,...

Uploading variant images to Shopify

— January 8, 2018

First, it is easier and generally preferable to do this in the product uploading import CSV. But lets say the upload has already occurred, and now it is your problem to upload images to individual variants. You could log in, open the Javascript console, and run some api calls to do this. [NOTE: this is just a guide for somebody reasonably familiar with Javascript to take...

Fault tolerant jQuery .when()

— January 8, 2018

When getting data from a set of REST endpoints, some times the correct result comes back as an HTTP error. If you were managing the set of ajax calls with jQuery’s .when, it will fail/stop as soon as one of the items returns an error. I still want the rest of the data, though. function failTolerantPromises(promises) { return $.map(promises, function(p) { var dfd = $.Deferred() p.always(function()...

Filtering Shopify product lists

— November 24, 2017

Normally Shopify only lets you filter by up to 3 product tags. It doesn’t offer any sort of boolean options, or the ability to filter anything else. There’s not much you can do about that. It is just what Shopify’s search does. Unfortunately, something like a single slider selector (greater than X AND less than Y) would occupy 2 of your 3 slots, even if it...

Slack + SVN

— September 1, 2016

Git has all sorts of Slack integrations. I’m a bigger fan of git once I found the max-depth thing, the exact syntax of which I’ve already forgotten. (so cloning a repo doesn’t download the entire repo history, which may include massive media files or entirely different websites) However, I still like svn. In an effort to increase our velocity or flywheel or other business sounding keywords...

Angular directives

— August 22, 2016

Rather than the jQuery way, to assign behaviors via selectors. [crayon-5a8c6f7572b4d314333272/] Angular wants to define the behaviors in directives: [crayon-5a8c6f7572b5e455032416/] then assign those behaviors to dom elements directly: >input type="number" ng-model="bid.price" string-to-number auto-select /< Eventually you too can build up the necessary directive library, each of which re-implements some minor dom element function, each with timeouts of various lengths, just to make sure nothing ever runs...

Jasmine Hack: $q

— July 22, 2016

Lets say you have a Jasmine test of an asynchronous call with then(). You need to call $rootScope.$digest() in order for the then() to happen. Lets say you are testing the bit that returns that promise. You can’t expect($q.reject).toHaveBeenCalled() because the reject inside your function is not the same thing as $q.reject, which is the only thing spyOn can see. You could fix that by calling...

Angular Core Concepts

— July 1, 2016

Angular2 (or 1.5) for new or old users If you have avoided Angular to date, good news! You won’t have to forget anything. If you know all the differences between services and factories and controllers and directives, good news! Free up those brain cells! This guide is not going to answer all the possible questions about Angular. Rather it is a mindset that I found very...

older »

Latest from our blog Shopify images for blog posts