<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Christoph Wagner on Medium]]></title>
        <description><![CDATA[Stories by Christoph Wagner on Medium]]></description>
        <link>https://medium.com/@Panda_Whisperer?source=rss-5f679f24ed11------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*K6xtMqWS2Cl8N-KcfR0yvg.jpeg</url>
            <title>Stories by Christoph Wagner on Medium</title>
            <link>https://medium.com/@Panda_Whisperer?source=rss-5f679f24ed11------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 01:55:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Panda_Whisperer/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Last week I tried “real” TDD, and it was beautiful]]></title>
            <link>https://medium.com/@Panda_Whisperer/last-week-i-tried-real-tdd-and-it-was-beautiful-358af00882e8?source=rss-5f679f24ed11------2</link>
            <guid isPermaLink="false">https://medium.com/p/358af00882e8</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[tdd]]></category>
            <dc:creator><![CDATA[Christoph Wagner]]></dc:creator>
            <pubDate>Thu, 14 Apr 2016 23:07:33 GMT</pubDate>
            <atom:updated>2016-04-14T23:07:33.702Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve been coding for more than a few weeks, I’m sure you’ve heard of Test-Driven Development, or TDD for short. The idea, of course, is deceptively simple: instead of writing code iteratively and testing it by hand, you write the test first, and <em>then</em> you write the code that makes it pass.</p><p>After discussing this principle with one of my mentees at <a href="http://www.thefirehoseproject.com/">theFirehoseProject</a>, he sent me an article he found, penned by the venerable <a href="https://twitter.com/unclebobmartin">Bob Martin</a>, in which he elucidates on the <a href="http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd">The 3 Rules of TDD</a>. They are:</p><h4>The 3 Rules of TDD</h4><ol><li>You are not allowed to write any production code unless it is to make a failing unit test pass.</li><li>You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.</li><li>You are not allowed to write any more production code than is sufficient to pass the one failing unit test.</li></ol><p>I’ve been struggling with learning “real” TDD for a few years now. I chalk up most of that struggle to bad habits, which have a tendency to expand themselves. Unless you make a real commitment to change, you somehow keep finding yourself in situations where everyone else has the same avoidance habits as you.</p><blockquote>TDD? Yes, we do that. But we write the tests <em>afterwards</em>. At least usually. Well, sometimes. When we have time. — Someone, at every company, every day</blockquote><p>Now, we all know that “when we have time” in practice almost always means “never”. And so, even after 5 years on the job, it’s no surprise that when you find yourself thrown on the next project, even though the code is deployed to production, the tests either aren’t working, hopelessly outdated, or completely non-existent. At best, there’s some poor schmuck who gets paid to test the entire site by hand every time there’s a deploy. True story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*BUc9yZDIXiX_ptLNVoPFug.jpeg" /></figure><p>Testing really is the ugly stepchild of the industry. Everyone just pays it lip service, but no one ever invites it to the party. And I’ll be the first to admit that my previous encounters with TDD have often been all but fulfilling. In fact, they were mostly frustrating (I’m looking at you, <a href="http://www.rubyinside.com/dhh-offended-by-rspec-debate-4610.html">RSpec</a>). But after reading Bob Martin’s 3 rules, and the advantages of following them, I couldn’t help but feel a surge of motivation roll over me, followed by the desire to give it another try. Good thing I had just received a programming challenge in the mail for a job I was interviewing for. There wasn’t going to be any better reason to try it than that, so I decided to give it go.</p><h4>Giving it a spin</h4><p>So, with the 3 rules firmly in mind, I set out to finish this challenge. Without revealing too much, it was basically a simple JSON API server with 4 endpoints, 2 POST and 2 GET. There was one collection, a POST call to create a new element in it, and a GET call to retrieve the entire collection (POST /collection and GET /collection, respectively). The other two calls were to retrieve summary statistics on the entire collection (GET /collection/summary) and to delete the entire collection (POST /collection/clear). The last one kind of broke the REST principle, but let’s not be sticklers about that right now.</p><p>As Uncle Bob demanded, of course, I started with the tests. Well, I admit that I may have set up a very basic Express app skeleton first, but I definitely wrote the first test before writing any of the endpoints. Then, using <a href="https://github.com/visionmedia/supertest">supertest</a>, I wrote a test for the first endpoint, POST /collection. Reading right off the specification I got, I outlined the following test stubs:</p><pre>app = require &#39;../src/app&#39;<br>request = require &#39;supertest&#39;<br><br>describe &#39;Collection API&#39;, -&gt;<br><br>  describe &#39;POST /collection&#39;, -&gt;<br>  describe &#39;GET /collection&#39;, -&gt;<br>  describe &#39;GET /collection/summary&#39;, -&gt;<br>  describe &#39;POST /collection/clear&#39;, -&gt;</pre><p>Of course, none of that will fail, so I added the following test case:</p><pre>describe &#39;POST /collection&#39;, -&gt;<br>    it &#39;creates a new item&#39;, -&gt;<br>      request(app)<br>        .post(&#39;/collection&#39;)<br>        .send()<br>        .expect(200)<br>        .expect(&#39;Content-Type&#39;, &#39;application/json&#39;)</pre><p>Keeping in mind rule number 2, I stopped here, even though you may have noticed I’m not even POSTing any data yet. This was already sufficient to fail, because after all, my server didn’t even know about the /collection endpoint yet. In fact, I realized, just writing expect(200) would have been enough, checking the content type should have come later. In fact, I realized at this point, all I should have written was this (let’s ignore for a moment the fact that the status code should be 201 — I was just working off of the requirements here):</p><pre>it &#39;responds with status code 200&#39;, -&gt;<br>      request(app)<br>        .post(&#39;/collection&#39;)<br>        .expect(200)</pre><p>And so I went on to rule number 3, and wrote exactly enough production code to make this test pass:</p><pre>app.post &#39;/events&#39;, (request, response) -&gt;<br>  response.json path: &#39;POST /events&#39;</pre><p>First round accomplished! That really wasn’t so hard.</p><p>I’ll spare you the intimate details about the rest of the journey. I think these examples are enough to get the idea. After the realization that my first step was already too big, I tried really hard to pace myself on the next iterations, doing my best to literally only write enough of a test to make the production code fail. It’s a strange feeling if you’ve been used to doing it differently. It somehow feels like your progress is much slower, because you’re taking such small steps. However, a few hours later, it really started paying off: by this time, I would have normally gotten bored and take a long-ish break to read HackerNews or catch up on Facebook or some other nonsense, but instead, I was motivated to keep going, since my code was literally all working, and I could prove it, thanks to my growing number of tests.</p><p>By the end of the afternoon, I had the entire app working according to specs, and 33 unit tests to prove my work. I was feeling great! There was only one small thing: I hadn’t even added a database yet, because I had no idea how to write a test for that. In fact, my server was storing everything sent to in an array in memory, because of rule #3 (“You are not allowed to write any more production code than is sufficient to pass the one failing unit test.”). However, having a database backend was definitely one of the requirements.</p><h4>Now what?</h4><p>I took some time that evening to think about whether it was possible to test for this, but couldn’t come up with a good answer. Obviously, retaining state between tests is a no-no (that was how the requirement was worded: “we need a database to persist data between runs).</p><p>I briefly considered writing a test that actually starts the server from the command line (in another thread), runs the first part of the suite, and then terminates the server without erasing data, only to start another instance, verify that the data is still there, and then delete it. But that seemed just a bit too involved. So at this point, I decided to cheat, and I simply added the database backend without having a failing test that I needed to make work. However, after that was done, I still had my suite of 33 tests that I could run against the server to make sure everything is still working.</p><p>Overall, this was a really fun experiment, and I think I gained a new appreciation for TDD. I’ll certainly try this approach again for any new project that I’ll be working on. Now if only the 3 rules could help with that one project that’s already in production, but doesn’t have any tests whatsoever…</p><p><em>This article originally appeared on </em><a href="http://bit.ly/blog-tdd"><em>my blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=358af00882e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To: Get a Push Notification When Your Heroku App is Deployed]]></title>
            <link>https://medium.com/@Panda_Whisperer/how-to-get-a-push-notification-when-your-heroku-app-is-deployed-c9da0ef7aeb9?source=rss-5f679f24ed11------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9da0ef7aeb9</guid>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Christoph Wagner]]></dc:creator>
            <pubDate>Thu, 10 Mar 2016 18:17:08 GMT</pubDate>
            <atom:updated>2016-03-10T18:17:08.994Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re like me, you probably have at least a few apps deployed on <a href="https://www.heroku.com/">Heroku</a>. And if you are taking advantage of their <a href="https://devcenter.heroku.com/articles/github-integration">GitHub integration</a>, there’s a good chance you have at least one app that <a href="https://devcenter.heroku.com/articles/github-integration#automatic-deploys">deploys automatically</a> 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.</p><p>Sure, you can always log into your <a href="https://dashboard.heroku.com/apps">Heroku Dashboard</a>, open the app, navigate to the “Activity” tab, and watch the progress from there, but who has time for that?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*HLJiq6LdroNE72fjRUhAEA.gif" /></figure><p>That’s right: nobody. So, here’s the patented, “lazy programmer” solution: you set up a <a href="https://devcenter.heroku.com/articles/deploy-hooks">deploy hook</a>. Heroku already supports several channels out of the box, such as <a href="https://elements.heroku.com/addons/deployhooks">Email, IRC, Basecamp, Campfire, and HipChat</a>, but what if you use <a href="https://slack.com/">Slack</a>, or you prefer a push notification instead? Well, then this guide is for you.</p><p>Without further ado, let’s get started!</p><p>First, you’re going to sign up for a free account at <a href="http://zapier.com/">Zapier</a>. This is a service very similar to <a href="https://ifttt.com/">IFTTT</a>, 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.</p><p>Second, you’ll need some way to receive notifications. In this guide, I’ll be using <a href="https://pushover.net/">Pushover</a> for that purpose, but you can also use <a href="https://instapush.im/">InstaPush</a>, 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).</p><p>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:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MTXXl2fV5S6pHJle3tiqKQ.png" /></figure><p>Type “webhook” into the search box, and select “Webhooks by Zapier” from the autocomplete dropdown. You should see the following screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aGXPZ0YhTXpNK1x9ejnF_A.png" /></figure><p>Select “Catch Hook” and click the “Save + Continue” button. You’ll see this screen next:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tn0KVl3OgAN7voDl9jd_6g.png" /></figure><p>We don’t need this part, so just click the “Continue” button. Now you will see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A9X6aQD_Wlg9OExgvonlCg.png" /></figure><p>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.</p><p>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!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J4QeygaYYA5NXAcmOXTtfA.png" /></figure><p>Click “Continue”, select “Push Notification” on the next screen, and then select the Pushover account to use (or set up a new one).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3JfEFecDc9_ZklyhRy8TGw.png" /></figure><p>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:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F_oaHnbuxNPQGCcVc-KGYw.png" /></figure><p>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!</p><p>Lastly, Zapier will ask you to test this step by sending a push notification to your account:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QW4Bj6H4WCH2hdAz3T9Kww.png" /></figure><p>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.</p><p><strong>NOTE:</strong> this article first appeared on <a href="http://bit.ly/blog-heroku-push-notifications">my blog</a>. Drop by and subscribe for more coding related articles!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9da0ef7aeb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Picture Says More Than a Thousand Words]]></title>
            <link>https://medium.com/@Panda_Whisperer/a-picture-says-more-than-a-thousand-words-92fa013f2fb4?source=rss-5f679f24ed11------2</link>
            <guid isPermaLink="false">https://medium.com/p/92fa013f2fb4</guid>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[emoji]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Christoph Wagner]]></dc:creator>
            <pubDate>Tue, 08 Mar 2016 23:12:04 GMT</pubDate>
            <atom:updated>2016-03-08T23:14:36.708Z</atom:updated>
            <content:encoded><![CDATA[<p>When Apple first introduced <a href="https://en.wikipedia.org/wiki/Emoji">Emojis</a>, I was skeptical. After all, we’d all been accustomed to using text-based <a href="https://en.wikipedia.org/wiki/Emoticon">emoticons</a> for about a decade and they worked (reasonably) well. Most people, at least in my age group, had no difficult understanding expressions like :) and ;). If it ain’t broken, don’t fix it, right? And after all, having to access a special keyboard to type those image-based emojis didn’t even save you any taps — it requires at least two taps to switch the keyboard and then back again.</p><p>Well, sometimes it’s not about fixing something that’s not broken, but rather about creating new opportunities. Or at least, that’s what I discovered when one fine day, I was trying to organize my life by creating a bunch of to-do lists in Apple’s (then new) <a href="https://en.wikipedia.org/wiki/Reminders_%28application%29">Reminders app</a>. I can’t remember exactly <em>what</em> sparked this idea, but when contemplating what lists I needed and how to name them, it suddenly occurred to me that I could use emojis in the name, in order to make my lists easier to find.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*_OdG0VOk0LFvhdWBO5s-9g.jpeg" /></figure><p>Rather than having to read all the titles, it occurred to me, if I used descriptive emojis, all I would have to do is look at the pictures to quickly find the list I was looking for. And for some weird reason, looking at pictures seems to require less cognitive effort than reading a bunch of text.</p><p>After a few minutes of deliberation, I came up with the scheme on the left. The “To Do” list is my default list, which acts as an inbox — this is where I add new to-dos whenever I think of them. Siri uses that list as well, whenever I ask her to remind me of something. Every week, usually on Sundays, I go through that list and prioritize everything, moving the tasks for the upcoming week into the “This Week” list. Every morning, I pick out the tasks I want to accomplish that day and move them into the “Today” list.</p><p>Apart from that, I have a few more “special” lists, for things that are also to-dos, but not urgent or need scheduling. The “Eat” list, for instance, is where I save the name of restaurants I’m planning to try out some day. The “Listen” list is where I gather the names of musical artists and podcasts that I plan on checking out. I trust that the “Read” list needs no further explanation.</p><p>But it doesn’t stop here. Emojis can be used anywhere where you can type text, so I’ve started using them in the calendar app as well. For instance, when scheduling a phone call, I’ll put the “📞” emoji as the first character in the title, followed by the name of the person I’ll be talking to. If I have an online meeting, I use “💻” instead. For scheduled errands that require driving, “🚗” is a great choice. Meeting someone for a drink? “🍻” works great. You get the idea. And while it may seem like a childish idea at first, you only need to switch to the calendar’s week view to appreciate the power of these little pictures.</p><p>Even though I’ve been doing this for about a year now, I still find new, creative uses for emojis. For instance, one of my friends uses them in his git commit messages to indicate the type of commit (“🐛” for bugfix, “➕” for a new feature, “⬆️” for upgrading dependencies, “🚧” for work in progress, “👕” for linting code, etc.). Again, when looking at a single commit, this doesn’t seem to make any sense whatsoever, but you only have to take one step back and look at the commit log, and the value instantly becomes clear.</p><p>Have you found any creative uses for emojis? Let’s hear them!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92fa013f2fb4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boxing Day]]></title>
            <link>https://medium.com/@Panda_Whisperer/boxing-day-d2c7b1d710a2?source=rss-5f679f24ed11------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2c7b1d710a2</guid>
            <category><![CDATA[christmas]]></category>
            <category><![CDATA[boxing-day]]></category>
            <category><![CDATA[family]]></category>
            <dc:creator><![CDATA[Christoph Wagner]]></dc:creator>
            <pubDate>Sun, 27 Dec 2015 00:42:18 GMT</pubDate>
            <atom:updated>2015-12-27T00:44:40.294Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>Boxing Day — A Christmas Story</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJoLJioBJrvgHP9cwzbGmw.jpeg" /></figure><p>My grandmother was one of the richest people I have ever known. She lived in a giant house, at least 4 stories high, with the biggest garden I had ever seen in my young life. Every year, my family would visit her for Boxing Day. We’d sit in her living room that was larger than a whole floor in our own house, which was her second living room, downstairs from the floor she did most of her living on. We sat together in this cavernous room, which was filled with stuff. Bookshelves and cupboard and tables and drawers, all full of stuff. Not even to mention the giant Christmas tree, and all the hundreds of presents underneath, which had probably been wrapped by her staff.</p><p>We’d sit there and sing Christmas songs, and ate cookies and Christmas candy that was all bought from a store and tasted stale, like it was already a couple of months old. She had probably bought most of it back in October, right when stores first started putting it on display. We’d sit there and open presents, all of which were neatly labeled, and contained cheap trivialities, knick knacks, probably imported from Hong Kong or China, which she had bought from a catalog or at the closest big box store. Everyone would get a present, including my parents. And everyone would dutifully hug grandma, say “thank you”, and tell her how much we loved it. And then we’d all turn away, solemn and sullen, and sing another Christmas song, or eat another stale candy until it was time to leave.</p><p>My grandmother was one of the poorest people I have ever known. Her giant mansion was filled with stuff, but nobody really lived there, except her and her husband, and one of my uncles, but he lived on the top floor and kept to himself as much as he could. My grandmother had twelve children, but none of them ever wanted to come and spend time with her. They all made up excuses whenever they could, including my mother, who lived only a ten minute drive away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*QaUb0x7B0NPCg2gkNzz-qg.jpeg" /><figcaption>Not my grandmother’s house, but the closest image I could find.</figcaption></figure><p>On Boxing Day, as soon as we’d make it home, we would throw all of our presents away. We know all too well how cheap and poorly made they were, and that most likely they would break within a couple of weeks anyways. On top of that, they weren’t really anything any of us had needed or wanted anyways. Because my grandmother never really took the time to find out what each of us really wanted or needed. She just bought things that were advertised and on sale. Her wallet was as big as her heart was empty.</p><p>My grandmother died of loneliness. Sure, the doctors probably wrote something else on her death certificate, but to anyone who knew her, it was fairly obvious. After her second husband (the man I always knew as my grandfather) died, she didn’t make it much longer. Her condition rapidly deteriorated. She never met another man after that. Never married again. Just got worse until she died. It took many months. After she died, her children came from near and far, and paid her respect. And then started the long and difficult process of cleaning up everything in the house. Going through all of her stuff, sorting out the things that were junk from all the things that could be sold. My grandmother had a lot of debt.</p><p>After the house was sold, four families moved in. They had all pooled their money so they could afford this giant house. My grandmother was buried in the graveyard at the end of my street, next to her late husband, who was already waiting for her. After the funeral, we never spoke of her again. I haven’t even visited her grave once.</p><p>I wish I could offer you a happy ending to this story, a moral, or maybe a lesson learned, but alas; I cannot. For whatever condition it was that afflicted my grandmother, I fear I have inherited a part of it. I am better at making money than I am at making friends. I own more things than I have use for, so I have to rent a storage unit to keep it all. I haven’t spent a single moment of quality time with any of my three brothers all of last year. And I find it easier to bribe someone than to forgive them. So if you are feeling deprived this Christmas, just think of all the people who are so poor that all they have is stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2c7b1d710a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>