Engineering Blog

Learnings, insights & processes from the team building Visible.

Dropping elements left and right: fun with ruby arrays

Let’s say we have an array of hashes, that represents a time series: DATA_POINTS = [ { date: ‘2016-01-01’, value: nil }, { date: ‘2016-02-01’, value: nil }, { date: ‘2016-03-01’, value: 100 }, { date: ‘2016-04-01’, value: nil }, { date: ‘2016-05-01’, value: 300 }, { date: ‘2016-06-01’, value: nil }, { date: ‘2016-07-01’, value: nil } ] What we want to do with it is to remove all elements with a nil value from the array’s beginning and end, similar to what String#strip does for strings. Ruby arrays have a bunch of neat methods, one of them is Array#drop_while, it drops elements from the beginning of an array until the passed in block evaluates to false or nil. Let’s try it on our array: DATA_POINTS.drop_while {|element| element[:value].nil?} =>…

Mikhail - April 14, 2016

Optimize your wordpress theme assets and deploy to S3 (and CloudFront)

This article is part of a series about how to make A slightly less shitty WordPress developer workflow. Check out the other parts if you haven’t already. You can also find the project on Github. Part 1: Setup a local development environment for WordPress with Docker Part 2: Setup an asset pipeline for WordPress theme development Part 3: Optimize your assets and deploy them to S3 (and CloudFront) Part 4: Auto deploy your site on your server (coming) In our previous post, we shared how to setup an asset pipeline for development. You’ve spent some time developing your theme locally, now is the time to deploy to production. The first thing we’ll focus on is optimizing our theme and deploying the assets to S3 (and incidentally to CloudFront). Here is what we will…

Karel - September 9, 2015

Setup an asset pipeline for WordPress theme development

This article is part of a series about how to make A slightly less shitty WordPress developer workflow. Check out the other parts if you haven’t already. You can also find the project on Github. Part 1: Setup a local development environment for WordPress with Docker Part 2: Setup an asset pipeline for WordPress theme development Part 3: Optimize your wordpress theme assets and deploy to S3 (and CloudFront) Part 4: Auto deploy your site on your server (coming) A WordPress theme development assets pipeline Web development techniques have evolved a lot in the past few years. We have great superset languages like SASS that make our developer life a bit more pleasant, we have tools to optimize the size of our assets (images, css, js, fonts) and make sure we are making…

Karel - September 3, 2015

Setup a local WordPress development environment with Docker

This article is part of a series about how to make A slightly less shitty WordPress developer workflow. Check out the other parts if you haven’t already. You can also find the project on Github. Part 1: Setup a local development environment for WordPress with Docker Part 2: Setup an asset pipeline for WordPress theme development Part 3: Optimize your wordpress theme assets and deploy to S3 (and CloudFront) Part 4: Auto deploy your site on your server (coming) UPDATE March 12, 2016: Thanks to the great contribution of Derek Sifford the project has step its game even more. We updated this repository to reflect the changes. So before we get started with that actual WordPress workflow, we will first need a development environment. We will use Docker because it is really nice…

Karel - August 30, 2015

A slightly less shitty WordPress developer workflow

Visible’s marketing site was initially built on WordPress but when came the time to redo it, the first thing we did was look at alternatives. We had individually given WordPress way too many (frustrating) hours and couldn’t imagine ourselves going back to the good old CMS. But after some research, we took a step back and realized that between migrating the existing data, replacing the plugins and learning an entirely new CMS, maybe WordPress was still our best option. After all there are 74,652,825 WordPress sites (self-hosted WP account for 18.9% of all websites) out there so the community and support alone is massive. We decided to use WordPress again but this time it had to be a different and more enjoyable experience. So we decided to give it a spin and…

Karel - August 30, 2015