Christoph Wagner

Freelance Software Developer

How To: Get a Push Notification When Your Heroku App is Deployed

27 January 2016

If you’re like me, you probably have at least a few apps deployed on Heroku. And if you are taking advantage of their GitHub integration, there’s a good chance you have at least one app that deploys automatically whenever you push to a certain branch. And if that’s the case, you may have realized that there’s a small, but important problem with that: when you push to GitHub, you no longer know when the app has finished deploying, because the whole post-deploy process now happens in the background, rather than in your terminal.

Sure, you can always log into your Heroku Dashboard, open the app, navigate to the “Activity” tab, and watch the progress from there, but who has time for that?

That’s right: nobody. So, here’s the patented, “lazy programmer” solution: you set up a deploy hook. Heroku already supports several channels out of the box, such as Email, IRC, Basecamp, Campfire, and HipChat, but what if you use Slack, or you prefer a push notification instead? Well, then this guide is for you.

Without further ado, let’s get started!

First, you’re going to sign up for a free account at Zapier. This is a service very similar to IFTTT, but while the latter seems to be more prolific in their marketing, Zapier’s engineers have been busy creating more API integrations. Unfortunately, neither of the two list Heroku as supported service. But fear not, we can still make this work, because Heroku was nice enough to also provide a HTTP hook.

Second, you’ll need some way to receive notifications. In this guide, I’ll be using Pushover for that purpose, but you can also use InstaPush, Basecamp, or Slack for this purpose. Or, if you’re old school, you can even have an SMS send to your phone (come on now, it’s 2016, time to ditch that feature phone and get with it, grandpa).

Once you’ve created your account on Zapier, you’ll see the dashboard, with a big orange “Make a New Zap” button. Click it. You should see the following screen:

Type “webhook” into the search box, and select “Webhooks by Zapier” from the autocomplete dropdown. You should see the following screen:

Select “Catch Hook” and click the “Save + Continue” button. You’ll see this screen next:

We don’t need this part, so just click the “Continue” button. Now you will see this:

The textbox contains a randomly generated URL, which is where Zapier will receive notifications from Heroku. Copy this URL to your clipboard and click “Ok, I did this”. Zapier is now waiting for Heroku to send it some sample data to verify that the hook is working.

Next, we’ll have to do some setup in Heroku. Log into your Heroku dashboard, open your app, and under “Resources”, type “Deploy Hooks” into the search box and add the add-on from there. Paste the URL you copied into the input box and click the “Save and Test” button. Now, go back to Zapier. It should now tell you that the test was successful. On to the next step!

Click “Continue”, select “Push Notification” on the next screen, and then select the Pushover account to use (or set up a new one). 

Finally, here comes the fun part: this is where you set up the push notification. Pushover supports a lot of options. You can play around with these or just use the settings from my screenshot:

Note that if you set a URL, clicking on a push notification will take you to that URL right away. In other words, if you put the placeholder for your app’s URL in that field, tapping on the push notification will take you straight to your app. Neat!

Lastly, Zapier will ask you to test this step by sending a push notification to your account:

All you need to do now is set a name for this trigger and save it by clicking “Finish”. Voila, Heroku will now send you a push notification anytime your app is deployed.

UPDATE: As luck would have it, Zapier deployed a completely new UI for creating and editing Zaps just two days after publishing this article. I will update it soon with new screenshots.

UPDATE 2: Just revised the article and updated it with current screenshots. Enjoy!

Read More

Exercism just helped me ace a job interview

03 October 2015

So the other day I blogged about how practice helps improve your code game. Well, I already have a success story to share! I’m currently in the process of interviewing with TopTal, a company that prides itself on hiring only the top 3% of freelancers. I had my second round inteview this week, and surprise, surprise! it was a live coding test.

So I was on Skype with a very friendly fellow from Brazil, and after a few minutes of smalltalk, he asked me to share my screen, and then he gave me my first task. Once he confirmed that I had understood what he was asking, he set a timer for 20 minutes. Alright, go time!

A few years ago I would have been super nervous. Even a few weeks ago, I might have just started tripping all over myself trying to figure out what to do first – write the code? Write some tests? Wait, what’s the syntax again?

Read More

How to Level Up Your Coding Skills in 20 Minutes a Day

29 September 2015

Okay, hands up if you got into coding because of an inspiration. Did you start this journey because you had an idea for an app that you wanted to build? Now that you’re three, four, five months down the rabbit hole, how is that inspiration holding up? Not so well? I see.

Have you spent the last three weeks repeatedly banging your head against the wall because there was some problem that you just COULD NOT solve? And then when you tried working on a different part of your app, within a day or two you ran into another brick wall? Is your code starting to resemble a maze and you can’t seem to find the exit anymore?

Read More

Atom: Disable weird popups when navigating in Vim-Mode on Mac OS X

23 July 2015

I’ve recently decided to give GitHub’s Atom Text Editor another chance, after the long await 1.0 release. Of course, as a long time Vim user, the first package I installed was vim-mode, along with ex-mode to make me feel right at home. So far, so good.

Most Vim commands worked perfectly, even advanced motion commands like ciw or daW are working like they’re supposed to. However, one thing that bothered me was a weird popup that would appear every so often when navigating using the l key, as demonstrated on the GitHub issue that was filed regarding this problem:

Read More

Don’t Learn CoffeeScript Until You Understand JavaScript (Part 3)

12 June 2015

In the last part of this series, we’ve taken a deeper look at JavaScript’s prototypal inheritance model, and how it differs from the “classic” OOP model championed by languages such as Ruby, Python, Java, and C++. In this part, we’ll take a look at how this knowledge can make you better at writing CoffeeScript. You might also be interested in part 1, which discusses my motivation for doing this.

Read More

This Meteor has crashed

25 May 2015

So about a year ago I started working on a side project, because I was bored at work and I kept hearing about this new framework called Meteor, which supposedly made building Single Page Apps stupidly simple.

I started my app somewhere around version 0.5. Turns out it really was deceptively simple to get a working app, and I made progress very quickly. Over the summer and the fall, new versions of the framework kept getting released, but updating was usually a breeze. That is, until the big 1.0 rolled around.

Read More