Category: Development

  • On comparing large lists

    Graphic about lists being the same

    In the past, I’ve often had to generate email lists of users that fit specific conditions. This usually isn’t too difficult with some of our in-house data tools at Automattic. But, when I hit a case where I have to work across systems, it usually results in me dumping the data from each system and […]

  • How to expand tilde in bash script

    When I was working on a recent bash script, I was irritated when I wasn’t getting output to my desktop. After a while, I figured out that quoted tildes are not automatically expanded. From that link: If a word begins with an unquoted tilde character (‘~’), all of the characters up to the first unquoted […]

  • Git checkout non-origin remote pull request

    I don’t often review pull requests that come from non-origin remotes. This is largely because Automattic tends to create pull requests in the root repository. So, when I reviewed a pull request from an open source contributor today, I found myself wandering if there was a simple way to checkout the pull request locally for […]

  • Recording completed tasks with Alfred

    At Automattic, many teams have a process where they post weekly, or biweekly, updates. One of the things that I’ve often found difficult, as I write my personal update, is remembering all of the little things that I did for the past week. Sure, since I work on the computer, there’s usually some paper trail […]

  • Install Unison 2.48.4 on Mac OS X with Homebrew

    I use Unison to sync code between my local machine and my dev servers. To sync between two servers, it requires that the same version of Unison be installed on both servers. Now, this isn’t usually a big deal, because once you get Unison set up, it’s set up. But, I usually get a bit […]

  • Recursively cast to array in PHP

    I recently ran into an issue where JSON encoding some objects in my code wasn’t working properly. After experimenting, I realized that casting everything to an array before JSON encoding magically fixed things.  Casting an object to an array is simple enough: But, what happens when an object or array contains references to other objects […]

  • How to remove files not tracked in SVN

    Print object methods code

    At Automattic, we use SVN and Phabricator for much of our source control needs. One issue that I often run into is a warning about untracked files when creating a Phabricator differential: This warning’s purpose is to make sure that the differential being created has ALL of the changes so that a file isn’t forgotten […]

  • Get unique values in file with shell command

    Over the past year, there have been a couple of times where I've needed to sort some large list of values, more than 100 million lines in one case.  In each case, I was dealing with a data source where there was surely duplicate entries. For example, duplicate usernames, emails, or URLs. To address this, I […]

  • What is the JavaScript event loop?

    I remember the first time I saw a setTimeout( fn, 0 ) call in some React. Luckily there was a comment with the code, so I kind of had an idea of why that code was there. Even with the comment though, it was still confusing.  Since then, I’ve read several articles about the event loop […]

  • How to install Unison 2.48 on Ubuntu

    For developing on remote servers, but using a local IDE, I prefer to use Unison over other methods that rely on syncing files via rsync or SFTP. But, one issue with Unison is that two computers must have the same version to sync. And since Homebrew installs Unison 2.48.4 and apt-get install unison installs something […]

  • How to apply a filter to an aggregation in Elasticsearch

    When using Elasticsearch for reporting efforts, aggregations have been invaluable. Writing my first aggregation was pretty awesome. But, pretty soon after, I needed to figure out a way to run an aggregation over a filtered data set. As with learning all new things, I was clueless how to do this. Turns out, it’s quite easy. […]

  • How to retry Selenium Webdriver tests in Mocha

    While working on some functional tests for a hosting provider, I kept running into an issue where the login test was failing due to a 500 error. It appeared as if the site hadn’t been fully provisioned by the time my test was trying to login. Initially, I attempted adding timeouts to give the installation […]

1 2 3 6
Next Page