<?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 Markus Riegel on Medium]]></title>
        <description><![CDATA[Stories by Markus Riegel on Medium]]></description>
        <link>https://medium.com/@marcorei?source=rss-8d07a11b4f38------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*62_fTU_6Xsf5ttnhrTssWQ.jpeg</url>
            <title>Stories by Markus Riegel on Medium</title>
            <link>https://medium.com/@marcorei?source=rss-8d07a11b4f38------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 16:15:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marcorei/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[How to make your minis look amazing in Companion for Kill Team!]]></title>
            <link>https://medium.com/companion-for-kill-team/how-to-make-your-minis-look-amazing-in-companion-for-kill-team-533b1db3df69?source=rss-8d07a11b4f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/533b1db3df69</guid>
            <category><![CDATA[tabletop-gaming]]></category>
            <category><![CDATA[warhammer]]></category>
            <category><![CDATA[miniature-wargaming]]></category>
            <category><![CDATA[kill-team]]></category>
            <dc:creator><![CDATA[Markus Riegel]]></dc:creator>
            <pubDate>Mon, 03 Feb 2020 10:03:28 GMT</pubDate>
            <atom:updated>2020-02-03T10:03:28.344Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article we list a few tricks we use to improve our miniatures’ portrait pictures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iSf72m3PS5FX0RTc2EV3eA.png" /></figure><blockquote>We saw a lot of really cool photos of minis in our <a href="https://www.reddit.com/r/CompanionForKillTeam/comments/ex48mh/give_away/">Companion for Kill Team Give Away</a>! If you’re wondering how to get good pics like that, here are a few tips that we use at <a href="http://killteam.app/">CfKT</a> when we take pics of our own minis.</blockquote><p>You don’t need a fancy DSLR camera or a light box to take atmospheric portrait pictures of your team. Just a phone which has portrait mode functionality, a few lights and a bit of setup can make a whole lot of difference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UY72n4w654vbPsehNzE9jA.jpeg" /><figcaption>Top down view of the terrain setup</figcaption></figure><h3>Scene</h3><p>Take your time with the setup. If nicely done, the setting can create atmosphere and help the portrait mode detect what to blur. Here are some things to consider:</p><ul><li>Place your model in the beginning!</li><li>Keep checking your setup through your phone.</li><li>Make sure your foreground and background are well separated, e.g. by keeping distance between the terrain pieces or choosing terrain with a different color.</li><li>Keep the backdrop not too busy but interesting.</li><li>Putting the model on some terrain will help your phone deciding where the background starts — behind the foreground terrain!</li></ul><h3>Lights</h3><p>No that the important part is done, let’s make sure the scene is well lit.</p><p>A setup that I found works well is with two lights of different color or warmth. Make sure the model is well lit, the terrain is not as important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4XGWkOXcyE4fOfr4PbYyA.png" /><figcaption>Those lights are from Amazon, but desk lamps do the job as well. I also left the room lights on to lighten everything up a bit more.</figcaption></figure><p>Get creative here! The colors could match your Army (e.g. blue for Space Wolves, green for Orks, etc). Check on your phone and decide what combination looks best to you!</p><h3>Model positioning</h3><p>The last step is to make sure your model looks interesting. Most models have an angle at which they look particularly good. Turn it around a bit, try moving your phone up and down until you hit the spot.</p><p>Since all picture will be shown next to each other, also consider what makes this model stand out from the rest of the team to be recognisable while playing. This can be special equipment or e.g. a shoulder pad!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BlbZlYly64NN57wkOw_R6w.png" /></figure><h3>Portrait mode</h3><p>Most modern phones nowadays have support for portrait mode. Using this mode correctly can make a huge difference. It’s important that the model is easily recognised on the overview page so you can find the model you’re looking for.</p><p>Take a look below. Separating the model from its background can help a lot! Especially if the background is similarly coloured. On the left side you can easily check which model is which just with a glance whereas on the right not so much so.</p><p>Give your phone’s portrait mode algorithms the best chance on succeeding by giving more distance to the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CB_kqj8XgUTgponD0THCQQ.png" /><figcaption>Left: Portrait mode used to separate the miniature from the background. Right: Portrait mode used incorrectly and background blends into the miniature causing it not to stand out.</figcaption></figure><h3>You’re good to go!</h3><p>Now it’s time to place all your models and take your pictures.</p><p>To prevent frustration later on, look for unwanted shadows (e.g. in the face) and adjust your lights after placing a model. And check if the model is in focus!</p><p>You can take all your photos in one go and later import them into the CfKT. The app has import-from-gallery option.</p><p>Have fun! :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHvTB3TcSDZ_iw1IHWTWNA.png" /></figure><blockquote>Say hi at <a href="https://www.reddit.com/r/CompanionForKillTeam/">/r/CompanionForKillTeam</a> if you got question about the app or this guide. Or check out <a href="https://killteam.app/">killteam.app</a> for more infos.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=533b1db3df69" width="1" height="1" alt=""><hr><p><a href="https://medium.com/companion-for-kill-team/how-to-make-your-minis-look-amazing-in-companion-for-kill-team-533b1db3df69">How to make your minis look amazing in Companion for Kill Team!</a> was originally published in <a href="https://medium.com/companion-for-kill-team">Companion for Kill Team</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Baya, a Layout Framework for Swift.]]></title>
            <link>https://medium.com/wag-it/baya-a-layout-framework-for-swift-d9fc5203fe56?source=rss-8d07a11b4f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9fc5203fe56</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Markus Riegel]]></dc:creator>
            <pubDate>Mon, 22 Jan 2018 10:52:57 GMT</pubDate>
            <atom:updated>2018-01-22T10:52:57.934Z</atom:updated>
            <content:encoded><![CDATA[<p>Thoughts and a benchmark.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*NEijzukenuX_mf0HD1R05g.png" /><figcaption>The Baya Weaver is a pretty cool bird.</figcaption></figure><h3>The idea.</h3><p>The idea for <a href="https://github.com/getwagit/Baya">Baya</a> goes back to June 2016. Ironically to <a href="http://androidbackstage.blogspot.de/2016/06/episode-50-constraint-layout.html">episode 50 of the Android Developer Backstage Podcast</a> which was — on top of that — about ContraintLayout, a concept completely different from Baya.</p><p>Around 15 minutes into the episode, the discussion shifts to some underlying principles, like separating the view hierarchy from the layout hierarchy and a concept they call “virtual view groups”. Chet sums that part up with:</p><blockquote>“So it gives you the encapsulation that you get from ViewGroups or separate layouts without the extra overhead in the view hierarchy of these, these nested things”</blockquote><p>But here’s the thing. I really like looking at layout code and being able to quickly infer what the layout will look like. Using a ContraintLayout takes that away from you, at least to some extend. I mostly end up working with a visual editor when using a system like that.</p><p>The dream was keeping the readability but separating the layout and view hierarchy. The Problem with Android and Java was, that we either had to extend View when implementing a layout class that could fit in with the existing system, and thus not flattening the view hierarchy at all, or subclass every View class we would want to use with our layout system in order to have them implement a new Interface. Neither option made much sense, so that was that.</p><p>All of this changed with Swift, when <a href="https://medium.com/u/1ba9786c08b8">Joachim Fröstl</a> and I started developing for iOS.</p><p>Lightweight <a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/ClassesAndStructures.html#//apple_ref/doc/uid/TP40014097-CH13-ID82">Structures</a> and the ability to add <a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Protocols.html#//apple_ref/doc/uid/TP40014097-CH25-ID267">Protocol conformance using Extensions</a> were exactly what we needed. We started with writing a simple Protocol and a few Extensions to makes our lives easier — it didn’t take long and <a href="https://github.com/getwagit/Baya/commit/403b5f4c096a581f9ddfe1db1194373d026993eb">Baya was born</a>.</p><h3>The concept.</h3><p>Baya is build around a few principles. They all originate form the core idea except the last one, which was more of a performance thing.</p><ul><li>A flat view hierarchy by separating the layout logic.</li><li>Readability by encapsulating layout code in Structures with descriptive names.</li><li>Extendability by being Protocol-oriented. One should be able to write custom encapsulated layout logic and just plug it in.</li><li>Separation of layout definition, the measure phase and the layout phase.</li></ul><h3>An example.</h3><p>Every UIView is a BayaLayoutable. You call Extension functions on a BayaLayoutable or an array of BayaLayoutables to create layouts. These layouts also implement BayaLayoutable.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba9fba91b9507218198c032babe7a31d/href">https://medium.com/media/ba9fba91b9507218198c032babe7a31d/href</a></iframe><p>Using semantically named variables can improve the readability of your layout code. Here‘s the layout for an action bar. UsinglayoutAsFrame() groups the elements together.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8699b11e5f4a3788c30b827a0101accc/href">https://medium.com/media/8699b11e5f4a3788c30b827a0101accc/href</a></iframe><p>These layouts are then combined into a tree structure. In most cases you want to do this once when the view is created. Here’s an example of the layout code used for the benchmark later on. The root layout is saved in a stored property of either the UIView or the UIViewController.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0cdc15cba153ee48432293815ca614d1/href">https://medium.com/media/0cdc15cba153ee48432293815ca614d1/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*0ogBQMgqXUaBW_kW-VjZWQ.png" /><figcaption>A screenshot of what the layout defined above would look like.</figcaption></figure><p>Finally you kick off the layout routine either in layoutSubviews() or viewWillLayoutSubViews() by calling layout?.startLayout(with: bounds). If you need the result of the measure pass, e.g. in sizeThatFits(), call layout?.startMeasure(with: size).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6de7f348d9ae4b17090b3ec92ba841d/href">https://medium.com/media/a6de7f348d9ae4b17090b3ec92ba841d/href</a></iframe><p>More information about the concept and a cookbook can be found in the <a href="https://github.com/getwagit/Baya/wiki">project wiki</a>.</p><h3>Performance.</h3><p>Even though our focus was readability, testing the performance of Baya is something I wanted to do for a long time. We stumbled upon <a href="https://github.com/layoutBox/LayoutFrameworkBenchmark">LayoutFrameworkBenchmark</a> which seemed like a fast way to do that. The dependencies were <a href="https://github.com/marcorei/LayoutFrameworkBenchmark/tree/framework-baya">updated</a> before adding Baya. But the repository is a bit older — keep that in mind when looking at the data.</p><p>The results surprised me a bit. I did hope Baya would do well and I was fairly confident that it could beat AutoLayout. Here are the results of running the benchmark on an iPhone X.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UUqdx_x7ZMdsBpOPk8wlTw.png" /><figcaption>Benchmark results on an iPhon X (January 11, 2018)</figcaption></figure><p>With 19 milliseconds at 100 subviews, it looks like Baya is the fasted of the bunch using the implementation above. Not by much, mind you, but we’re right down there with PinLayout. Here’s another one with the iPhone 6Plus (I had that one laying around).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I6nHdGyLCppC1_zoKrurbQ.png" /><figcaption>Benchmark results on an iPhone 6 Plus (January 11, 2018)</figcaption></figure><p>I don’t think these few milliseconds make a huge difference, so take that benchmark for what it’s worth. And if you’re interested, check out <a href="https://github.com/marcorei/LayoutFrameworkBenchmark/tree/framework-baya">the repo</a> — leave a comment below if you think I cheated somewhere!</p><h3>Thanks for reading!</h3><p>I hope you enjoyed reading this article. It was fun writing these thoughts down before they’re forgotten.</p><p>Baya is still in version 0.2.0 as of the time writing this article. We used it in two of our projects and enjoyed working with it. A few layout challenges made us improve the API a few times though. Since we’ve mostly been using Baya ourselves we haven’t gotten much feedback and don’t want to lock the API in just yet.</p><blockquote>Found embarrassing mistakes in the code base? <br>Thoughts on the concept or the cool bird in the logo? <br>Drop an answer below!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9fc5203fe56" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wag-it/baya-a-layout-framework-for-swift-d9fc5203fe56">Baya, a Layout Framework for Swift.</a> was originally published in <a href="https://medium.com/wag-it">wag it</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Carousel with Actions on Google and Dialogflow]]></title>
            <link>https://blog.chatbotslife.com/building-a-carousel-with-actions-on-google-and-dialogflow-23a691551ef1?source=rss-8d07a11b4f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/23a691551ef1</guid>
            <category><![CDATA[google-assistant]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[conversational-ui]]></category>
            <dc:creator><![CDATA[Markus Riegel]]></dc:creator>
            <pubDate>Thu, 11 Jan 2018 17:29:40 GMT</pubDate>
            <atom:updated>2018-04-09T19:17:21.874Z</atom:updated>
            <content:encoded><![CDATA[<p>A short guide on how to create a carousel and handle selected items</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5qdJiwlUoxUlm6G2wWWg0Q.jpeg" /><figcaption>A carousel — but not the kind we’re going to build. Photo by <a href="https://unsplash.com/photos/zyU2gQ9mWLM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Ethan Hoover</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><p>For this guide you‘ll need to know how to setup an Agent with <em>Dialogflow</em> and a fulfillment app e.g. using <em>Firebase Cloud Functions</em> or <em>AWS Lambda</em>. If you’re just getting started I recommend following <a href="https://developers.google.com/actions/dialogflow/first-app">the official guide</a> or <a href="https://medium.com/@marcorei/developing-for-the-google-assistant-using-typescript-and-amazon-web-services-e7c81df9a436">my previous article</a>.</p><h3>The Carousel Selector</h3><p>A <a href="https://developers.google.com/actions/assistant/responses#carousel_selector">Carousel Selector</a> is a horizontally scrolling list of tiles. The images are larger and the presentation of the items is visually more compelling compared to a <a href="https://developers.google.com/actions/assistant/responses#list_selector">List Selector</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hV9hqxj93lqcghjmpcwssA.jpeg" /></figure><blockquote>The <em>Google Assistant</em> expects you to continue the conversation after a carousel, even if you are just using it to display information. Therefore the microphone remains open and your text and speech response should contain a question. Your app should also be able to react if the user selects one of the tiles.</blockquote><h3>Top 3 Most Popular Bot Design Articles:</h3><blockquote><a href="https://chatbotslife.com/10-tips-on-creating-an-addictive-chatbot-experience-b796ea6d1178">1. 10 Tips on Creating an Addictive ChatBot</a></blockquote><blockquote><a href="https://chatbotslife.com/what-10-billion-messages-can-teach-us-about-making-chatbots-fb796781bb4a">2. What 10 Billion Messages can Teach us About Making Chatbots</a></blockquote><blockquote><a href="https://chatbotslife.com/bots-super-personalization-on-steroids-8cd4ee3a9e8b">3. Bots &amp; Super Personalization On Steroids</a></blockquote><p>Let’s get started! Create a new <strong>Intent</strong> in <em>Dialogflow</em> and a new <strong>Action</strong> in your fulfillment app to handle the Intent. Creating the carousel in the fulfillment app is straight forward.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb443c0d08acaed6b68242283847eeea/href">https://medium.com/media/fb443c0d08acaed6b68242283847eeea/href</a></iframe><ul><li>For the <strong>input prompt</strong> I recommend using a <a href="https://developers.google.com/actions/reference/nodejs/global#SimpleResponse">SimpleResponse</a> object which separates speech and text response rather than just a string. This way you can include the options in the spoken response without repeating them visually. And users who won’t see the carousel (e.g. with the <em>Google Home</em>) still get all the necessary information.</li><li>For the second parameter build a <strong>carousel</strong>. We’ll use a function to build the OptionItems based on an array of data.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5523661616594eb9f5df3653f6dca30/href">https://medium.com/media/d5523661616594eb9f5df3653f6dca30/href</a></iframe><h3>Follow-Up Intents in Dialogflow</h3><p>Back in the <em>Dialogflow</em> console, add a new Intent that will be triggered when the user selects one of the options:</p><ul><li>Hover over your original Intent, click <strong>Add follow-up intent</strong> and select <strong>custom</strong>.</li><li>In order to react to options, this intent has to be triggered by an event. Click <strong>Events</strong> to reveal the hidden input field and enter actions_intent_OPTION.</li><li>Enter a custom <strong>action name</strong> or use the default one.</li></ul><p>A second Intent will act as a fallback, respond and close the microphone if the user did not select an option or the user input could not be attributed to an option.</p><ul><li>Hover over the original Intent once more and click <strong>Add follow-up intent</strong> once more. This time select <strong>fallback</strong>.</li><li>Click on the fallback Intent to edit it and enter one or more <strong>Text responses.</strong></li><li>Click on <strong>Google Assistant</strong> and check <strong>End conversation</strong>. This closes the microphone if none of the options were selected. Alternatively, if you want to keep the conversation open, make sure to ask a question in each <strong>Text Response.</strong></li></ul><p>Your Intent should look similar to this now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JCGJbIztCyyYZdn6kYdkFg.png" /><figcaption>Two follow-up intents. One handles selected options, the other everything else.</figcaption></figure><h3>Respond to user feedback</h3><p>All that’s left to do is to handle the selected option in the fulfillment app. Thanks to Dialogflow we can create an Action like we would do for any other Intent using the <strong>action name</strong> of the custom follow-up Intent.</p><p>Calling app.getSelectedOption() will give you the key of the selected option.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bfbf76bbb8601f47387cfceb069b3c7a/href">https://medium.com/media/bfbf76bbb8601f47387cfceb069b3c7a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CG15EpZGy1uOuWceLAKtIw.jpeg" /></figure><p><a href="https://github.com/marcorei/medium-assistant-demo-carousel/tree/master">This Github repository</a> contains the JSON for the intents as well as the fulfillment handler.</p><blockquote>Have fun building your app for the Google Assistant!<br>Got a question? Drop it below!</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F3e59ef%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F3e59ef&amp;image=http%3A%2F%2Fapi.screenshotlayer.com%2Fapi%2Fcapture%3Faccess_key%3Dfe59908dad3baab69ffab249a2224b03%26viewport%3D1024x612%26width%3D1000%26url%3Dhttps%253A%252F%252Fupscri.be%252F3e59ef%253Fscreenshot&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href">https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href</a></iframe><figure><a href="https://chatbotslife.com/bot-communities-mastermind-group-d2dae9876709#.53x0py6ou"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*6XUspT9JOSq0w0Fi35HIaA.png" /></a></figure><figure><a href="https://m.me/ChatbotsLife"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*c1LDMH5vbnIz9rmAka8Hwg.png" /></a></figure><figure><a href="https://chatbotslife.com/how-to-get-a-free-chatbot-b1fb9dfe109#.z9dtp2sy0"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*D0Jf3dI6ZThtqcfwDYY7mg.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23a691551ef1" width="1" height="1" alt=""><hr><p><a href="https://blog.chatbotslife.com/building-a-carousel-with-actions-on-google-and-dialogflow-23a691551ef1">Building a Carousel with Actions on Google and Dialogflow</a> was originally published in <a href="https://blog.chatbotslife.com/">Chatbots Life</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developing for the Google Assistant using Typescript and Amazon Web Services]]></title>
            <link>https://medium.com/@marcorei/developing-for-the-google-assistant-using-typescript-and-amazon-web-services-e7c81df9a436?source=rss-8d07a11b4f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7c81df9a436</guid>
            <category><![CDATA[google-assistant]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Markus Riegel]]></dc:creator>
            <pubDate>Tue, 02 Jan 2018 09:07:58 GMT</pubDate>
            <atom:updated>2018-12-01T10:21:14.684Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A comprehensive guide on how to create an app for the <em>Google Assistant </em>using <em>Dialogflow</em>, <em>AWS Lambda</em> and <em>TypeScript</em>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UuOxn_UUkpwD3292nfWpRw.jpeg" /><figcaption>Google Home Mini in my living room</figcaption></figure><blockquote>[Edit: This article was written for the Actions on Google NodeJS SDK v1. The Integration with v2 doesn’t require the use of express anymore. I suggest following the <a href="https://developers.google.com/actions/extending-the-assistant">official guide</a>. You can also take a look at <a href="https://github.com/marcorei/splattim-fulfillment/tree/master/src/integrations/google">SplatTim</a> which has been migrated to v2 since. (Thanks <a href="https://medium.com/u/fb0dee3ab989">Corey Cole</a> for pointing that out)]</blockquote><p>By building apps for the <em>Google Assistant</em> you can extend its functionality with your own conversation and provide information from your API. This guide directs you through the process of creating a simple app with <em>Dialogflow</em> and <em>AWS Lambda</em> and setting up all services and accounts you might need along the way.</p><p>The setup for this stack is more complicated then using <a href="https://firebase.google.com/docs/functions/"><em>Firebase Cloud Functions</em></a>. There could be many reasons to prefer <em>AWS Lambda</em> though. If you’re located in Europe, for example, <em>Google</em> discourages you from using their <em>Cloud Platform</em> services for hobby projects [Edit: Since January 19th you can now use Google Cloud as a private person in Germany]. And with this guide, the additional setup should be done quickly!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-vXfBOxFIl7K--1mmuqaCA.png" /></figure><h3>Dialogflow</h3><p><em>Dialogflow</em> is a service by <em>Google</em> that allows you to setup an AI based conversational interface in a simple way. You provide <em>Dialogflow</em> with some examples for the text or speech input and it’ll do the rest for you. I’ll give you the short version on how to get started. But you can find an in-depth guide on how to plan and setup a conversational app on the <a href="https://developers.google.com/actions/dialogflow/first-app"><em>Actions on Google</em> website</a>.</p><h3>Setting up your Dialogflow agent</h3><p>Go to the <a href="https://console.actions.google.com/">Actions on Google console</a> and create a new project. On the following screen, choose <em>Dialogflow </em>to build your app: Click the <strong>Build</strong> button and then <strong>Create Actions on Dialogflow</strong>.</p><p>Click <strong>create</strong> to save your agent.</p><p>On the left, click on the <strong>+</strong> icon next to <strong>Intents</strong>. Add Do something with the number 23 under <strong>User says</strong> and confirm with enter. 23 should automatically be detected as a parameter named number.</p><p>Enter demo_action as the action name. Check <strong>required</strong> for the parameter <strong>number</strong>. Click <strong>save</strong>.</p><p>That’s it for now. Let’s continue with the rest of the setup before connecting the fulfillment app to <em>Dialogflow</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VRQViiURZqd-xOvl_6e7aQ.png" /></figure><h3>Creating a user on AWS</h3><p>Sign up for <a href="https://aws.amazon.com/"><em>Amazon Web Services</em></a> or use your existing account to log in. <em>Amazon </em>will ask for your credit card. You will only be billed on usage and <em>Amazon</em> has a <a href="https://aws.amazon.com/free/">free tier</a> for new users which should be more than enough to start your project.</p><p>Go to the <a href="https://console.aws.amazon.com/iam"><em>Identity and Access Management</em></a><em> </em>service and add a new user for this project. Select <strong>Users</strong> from the side bar and click the button <strong>Add User</strong>.</p><p>Check <strong>Programmatic access</strong> and <strong>AWS management console access</strong>, enter a password and uncheck <strong>Require password reset</strong>.</p><p>In the next step add the following permission under <strong>Attach existing policies directly</strong>:</p><ul><li>AWSLambdaFullAccess</li><li>AmazonAPIGatewayAdministrator</li><li>IAMFullAccess</li></ul><p><em>Serverless </em>also requires permissions in addition to that. Click <strong>Create policy</strong> and select <strong>CloudFormation</strong> as services. Add the following actions:</p><ul><li>DescribeStackEvents</li><li>DescribeStackResource</li><li>CreateStack</li><li>UpdateStack</li><li>ValidateTemplate</li></ul><p><em>AWS</em> advises you to restrict access to a specific ARN (an <em>AWS</em> resource). To keep things simple use the following ARN, you can add e.g. more environments later on.</p><ul><li>us-east-1 as <strong>Region</strong>. (If you choose another you will have to adjust the S<em>erverless</em> settings too)</li><li><strong>Account</strong>: Enter your account ID. If you don’t have it at hand, click on your user name in the top navigation bar, then click <strong>My Account</strong> and you’ll find it.</li><li><strong>Stack name</strong>: For now this should be your project name followed by -dev, e.g.: my-project-dev</li><li><strong>Id</strong>: Check <strong>Any</strong></li></ul><p>Click <strong>Review policy</strong>, name and create the policy.</p><p>Now, go back to the browser tab where you’ve been creating the user, search for the policy name that you just entered and add that policy. And click <strong>Next: Review</strong>, review and create the user.</p><blockquote>Important: Note or download the credentials after creating the user. You will need the <strong>Access key ID</strong> as well as the <strong>Secret Access key</strong> later on.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CcCsKr1TgdYhWP5duoEbGQ.png" /></figure><h3>Serverless and TypeScript</h3><p><a href="https://serverless.com/"><em>Serverless</em></a> is a tool that makes deploying and managing apps build on AWS Lambda very convenient. It takes away a lot of cumbersome steps you’d otherwise had to do yourself.</p><p><a href="https://www.typescriptlang.org/"><em>Typescript</em></a> is a superset of JavaScript. The language adds optional types to Javascript that allow for things like interfaces, static type checking or refactoring. Having these additional conveniences is especially valuable when writing server-side code.</p><h3>Serverless Setup</h3><p>First install <em>Serverless</em> and <em>TypeScript</em> via <em>npm</em>.</p><pre>$ npm install -g serverless<br>$ npm install -g typescript</pre><p>In your project directory create a new npm project and a serverless app with the aws.nodejs template.</p><pre>$ npm init<br>$ serverless create --template aws-nodejs</pre><p>Now configure <em>Serverless </em>to use the <em>AWS</em> access key that was generated when creating the <em>AWS</em> user.</p><pre>$ serverless config credentials --provider aws --key YOUR_ACCESS_KEY_ID --secret YOUR_SECRET_KEY</pre><p>The following two <em>Serverless</em> plugins compile <em>TypeScript</em> to <em>JavaScript</em> automatically and allow you to test your app offline.</p><pre>$ npm install serverless-offline --save-dev<br>$ npm install serverless-plugin-typescript --save-dev</pre><p>Open serverless.yml and change <strong>service</strong> to the name of your project, e.g. my-project. Then add the plugins to serverless.yml.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb63fcd6fdfc7b5835e320b112d506a5/href">https://medium.com/media/fb63fcd6fdfc7b5835e320b112d506a5/href</a></iframe><p>Add custom exclude/include rules to the serverless.yml. Note that node_modules is not excluded. <em>Serverless</em> will take care of removing development dependencies when packaging the app.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e68dc305b3b6e3399ce97fe83a1c33f6/href">https://medium.com/media/e68dc305b3b6e3399ce97fe83a1c33f6/href</a></iframe><p>Modify the function in the serverless.yml. Note that the method is post.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/454896dbc9b440d8b79df70acd920b6c/href">https://medium.com/media/454896dbc9b440d8b79df70acd920b6c/href</a></iframe><p>Next initialize TypeScript and install types for aws-lambda.</p><pre>$ tsc --init<br>$ npm install @types/aws-lambda --save-dev</pre><p>Configure the tsconfig.json. You want to change the target to es6 because it’s supported by <em>Lambda</em> and to exclude node_modules. Everything else is up to you. But you can not change rootDir or outDir options when using serverless-plugin-typescript. Here is an example of a basic tsconfig.json.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/865074312154b94c4db0b03553184538/href">https://medium.com/media/865074312154b94c4db0b03553184538/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d129Y0nbUHvVKf_Dk1Ogsg.png" /></figure><h3>Creating the DialogflowApp with the Actions on Google SDK</h3><p>The DialogflowApp from the <em>Actions on Google </em>SDK expects an express-like Request and Response object on initialization. This is not compatible with the parameters of an <em>AWS Lambda</em> function. Fortunately, <a href="https://github.com/dougmoscrop/serverless-http">serverless-http</a> provides the necessary middleware for this case. Let’s install all the dependencies that we’re going to need.</p><pre>$ npm install serverless-http --save<br>$ npm install express --save<br>$ npm install body-parser --save<br>$ npm install actions-on-google --save<br>$ npm install @types/actions-on-google --save-dev</pre><p>Rename handler.js to handler.ts and replace its content with the following code. This file will contain the wrapper for our app. There will be errors because the app itself is added in the next step.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e079ad1c3c890d29493ebf4f914b405/href">https://medium.com/media/0e079ad1c3c890d29493ebf4f914b405/href</a></iframe><p>Now create the subfolder src and the file app.ts within. This file will initialize the DialogflowApp and add Actions later on.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19a1411a18fc82d64ec26f8270c26610/href">https://medium.com/media/19a1411a18fc82d64ec26f8270c26610/href</a></iframe><h3>Create the Action</h3><p>The Intent created earlier in <em>Dialogflow</em> triggers the Action demo_action with the argument number. We’ll now create the counterpart in our fulfillment app which will take care of modifying the user input.</p><p>Create a new folder src/actions and the file DemoAction.ts within. This file has to export two things: a constant name that holds the identifier and a function handler which can handle the Action.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b562e27508fa08840e398040457b6dd/href">https://medium.com/media/1b562e27508fa08840e398040457b6dd/href</a></iframe><p>app.tell() is the simplest way to respond. Take a look at the <a href="https://developers.google.com/actions/reference/nodejs/DialogflowApp">DialogflowApp documentation</a> for creating carousels, lists and more.</p><p>Next, add the Action to the app.ts file created earlier.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/60e696ef3248914b040a01b6e6d07d22/href">https://medium.com/media/60e696ef3248914b040a01b6e6d07d22/href</a></iframe><p>That’s it! Deploy your fulfillment app.</p><blockquote>Warning: This counts as an request made on your AWS account and may incur a charge.</blockquote><pre>$ serverless deploy</pre><p>After deploying Serverless will output the url of the function. Note that down because we’ll need it for the next step.</p><h3>Connect Dialogflow with the fulfillment app</h3><p>Go back to the <em>Dialogflow</em> console. On the left, select <strong>Fulfillment</strong> and enable <strong>Webhook</strong>. Enter the url from the previous step. Scroll down and click <strong>Save</strong>.</p><p>Navigate to your Intent and click on <strong>Fulfillment</strong> at the bottom of the page. Check <strong>use webhoock</strong>.</p><p>That’s it. Your done. If you enter “Do something with the number 8” on the top right (<strong>Try it now</strong>) you should get your response from the fulfillment app.</p><blockquote>Have fun building your Google Assistant App!<br>Got a question? Drop it below!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7c81df9a436" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why so grey, Medium?]]></title>
            <link>https://medium.com/wag-it/why-so-grey-medium-1bc6e24edb75?source=rss-8d07a11b4f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bc6e24edb75</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[branding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[medium]]></category>
            <dc:creator><![CDATA[Markus Riegel]]></dc:creator>
            <pubDate>Mon, 09 Oct 2017 16:03:21 GMT</pubDate>
            <atom:updated>2017-10-09T16:03:21.813Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Medium app icon on the App Store is grey. Here is why that could be an error.</h4><blockquote>Disclaimer: The grey icon may well be intended. This article is based on my own experience with iTunes Connect and black &amp; white icons.</blockquote><p>The new medium logo is black. Everywhere. Take a look at the official <a href="https://medium.design/logos-and-brand-guidelines-f1a01a733592">brand guidelines</a> and the <a href="https://medium.design/rebooting-the-medium-identity-6fb8d5a47fc1">blog post</a> about their new identity. Not a single grey logo. Even the app icon on the home screen is black.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ycsvDCOmlKCN-CfQFZe7wA.png" /><figcaption>the medium app icon is black. yet on the app store it’s grey.</figcaption></figure><p>So why is the app store icon grey? Could this be a mistake?</p><p>I think it is. At <a href="https://onepicture.co/"><em>one picture</em></a><em> </em>we had <a href="https://stackoverflow.com/questions/46565682/ios-app-displayed-with-grey-icon-in-testflight">a similar problem</a>. In our case, iTunes Connect rendered certain variants of the app icon grey.</p><p>We tried everything: exporting with different color profiles, embedding vs not embedding them, using different tools for exporting. Nothing seemed to work. Then we added different colored numbers to the image assets for debugging and the issue disappeared. We removed the numbers — the issue reappeared. Turns out just a few colorful pixels solve the problem.</p><p>Our fix was a small red dot in the corner of the app icon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*3GWcUFyvcIaEpnLWy2l2TA.png" /><figcaption>before and after the fix. without and with the invisible red dot.</figcaption></figure><p>The rounded corners of the app icon hide the red dot so that it’s not visible to the user. Now our app icon is black even in the App Store and on Testflight.</p><p>What do you think? Could Medium have the same problem we faced or is the grey icon intended?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bc6e24edb75" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wag-it/why-so-grey-medium-1bc6e24edb75">Why so grey, Medium?</a> was originally published in <a href="https://medium.com/wag-it">wag it</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What if every smartphone could only take a single picture?]]></title>
            <link>https://medium.com/wag-it/what-if-every-smartphone-could-only-take-a-single-picture-9794a8c9ca2d?source=rss-8d07a11b4f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/9794a8c9ca2d</guid>
            <category><![CDATA[experiment]]></category>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Markus Riegel]]></dc:creator>
            <pubDate>Fri, 06 Oct 2017 16:26:20 GMT</pubDate>
            <atom:updated>2017-10-06T16:45:15.523Z</atom:updated>
            <content:encoded><![CDATA[<h4>An iOS experiment.</h4><p>What if we could only take one picture? <br>What if instead of capturing five billion photos each day, every user had to decide what her/his one picture would be?<br>How would a social network like that look like?<br>Would it be full of cat pictures?<br>Or would we see personal stories?<br>Pictures of loved ones or selfies?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*7YgDmRDsY6O_Spmiv1DArg.png" /></figure><p>On our quest to rethink communication at <em>wag it</em>, this was one of the questions we were asking ourselves. So we stopped browsing reddit for a moment, closed Instagram and paused scrolling through our endless twitter feed — and started the experiment “<a href="https://onepicture.co/">one picture</a>”.</p><p>“One picture” is a simple iOS app. You can take <em>one</em> single picture and upload it. And you can browse through the “one pictures” of others. That’s it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JR6qBKmcmbXNoiTr-fK8xg.jpeg" /><figcaption>one picture — the app</figcaption></figure><p>But we are very exited what this experiment could become. Maybe we’ll end up with a gallery full of unique stories and pictures that are important to the ones who posted them. Maybe the idea has no place between the masses of content.</p><p>If you’re interested, check it out at <a href="https://onepicture.co/">onepicture.co</a>.<br>We can’t wait to see what’s your one picture!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9794a8c9ca2d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wag-it/what-if-every-smartphone-could-only-take-a-single-picture-9794a8c9ca2d">What if every smartphone could only take a single picture?</a> was originally published in <a href="https://medium.com/wag-it">wag it</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>