Blog

Consuming Multiple Archives Into A Single Model For A twitter_ebooks Bot

Published: May 25, 2017

Tags:

Recently, I launched my own ebooks bot.

If you read the twitter_ebooks README, you’ll see that you can use the command ebooks consume to generate a text model for the bot to work from based on a JSON archive of tweets, or a plain text file.

This is nice, but one question I had was, can I build my text model from multiple sources?

Send A Kapacitor Alert If No Data Is Received

Published: May 23, 2017

Recently, I ran into an issue where a misconfiguration lead to data not being pushed to InfluxDb for an extended period of time. It sucked and I wish I would’ve found out about it earlier. Here, I’ll cover how you can use Kapacitor to receive an alert if InfluxDb has not received data for an extended period of time.

Admin Action Logs Archive

Published: May 17, 2017

Tags:

The Admin Actions Log a useful feature of both Magento 1 and 2 Enterprise Edition. For those who haven’t seen it before, it offers an audit history of all actions taken by users in the admin panel.

A screenshot showing the admin actions log

As with sales, invoices, credit memos and shipments, Magento Enterprise occasionally archives data recorded to the admin actions log. However, for some reason, the mechanics used for archiving admin actions are completely different from how sales data is handled.

Here I’ll show you how that process works…

One Day With A MacBook Pro 15-Inch 2016

Published: May 8, 2017

Tags:

My office laptop was brought to the Apple store for repair last Friday. Today, I spent a full day using a spare.

The laptop I’m used to using is a 2014 model (pre touch bar). The spare is a 2016 model (including the touch bar).

Here are my initial thoughts on the latest iteration from Apple.

Using Custom HTML Elements In A Reveal.js Deck

Published: April 22, 2017

Tags:

I’m currently in the process of preparing slides for an upcoming talk. One technique I’m using to help structure the talk is an “agenda” slide. It’s basically a bulleted list of topics that will be covered in the presentation.

A screenshot demonstrating the agenda slide

As I’m presenting, to facilitate a smooth transition, I pull up the “agenda” slide each time I’m about to dive into a new topic. There, the next topic is visually distinguished from the other topics.

A screenshot demonstrating the agenda slide with a topic highlighted

I’m using reveal.js for the presentation, which allows me to write my slides in HTML (or Markdown), CSS and JavaScript. So the markup looks something like this…

<h3>What We'll Cover</h3>
<ul>
    <li>Angular</li>
    <li class="current-topic">React</li>
    <li>Ember</li>
    <li>Vue</li>
</ul>

As I was working on the slides, I started getting frustrated with copying and pasting the agenda over and over. Doing so means that if I decide to include a new topic in the talk, I need to update multiple instances of the agenda, spread across the deck.

Here I’ll show you how I used a custom HTML element to solve this problem.

Scaling Magento's SalesRule Module to Handle 20 Million Coupons and Beyond

Published: April 18, 2017

In a recent New Relic performance audit on a client’s site, we found that the Mage_SalesRule totals collectors were causing some serious slowness. At best, totals collection would execute in around 1.2s when coupons were at play. However, in the worst cases, it would take up to 30 seconds.

A screenshot showing New Relic's production traces

Checking the database I found that the salesrule_coupon table had over 20 million records in it. In this post I’ll show you how we were able to cut that down to literally milliseconds and keep totals collection performant, even with 20 million coupons in the database.