<?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 Hugo van der Horst on Medium]]></title>
        <description><![CDATA[Stories by Hugo van der Horst on Medium]]></description>
        <link>https://medium.com/@hugovndrhorst?source=rss-fd4d70ed3977------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*v2foUEP5pS_8ww_l</url>
            <title>Stories by Hugo van der Horst on Medium</title>
            <link>https://medium.com/@hugovndrhorst?source=rss-fd4d70ed3977------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:46:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hugovndrhorst/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[Basic JavaScript: Pace Calculator]]></title>
            <link>https://medium.com/@hugovndrhorst/basic-javascript-pace-calculator-31cd6be356e7?source=rss-fd4d70ed3977------2</link>
            <guid isPermaLink="false">https://medium.com/p/31cd6be356e7</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Hugo van der Horst]]></dc:creator>
            <pubDate>Sun, 26 Jan 2020 15:03:25 GMT</pubDate>
            <atom:updated>2020-01-26T15:03:25.528Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>For a couple of races I’ve done in the past, I wanted to know beforehand which pace (in min/km) I needed to run to reach my goal. This way, I only needed to check my average pace during the run to make sure I reached my goal. However, most pace calculators you find online look something like this:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*GD0B9QW8O0lKRruTbYtJ4A.png" /></figure><p>While they do what they say and ultimately work fine, there’s just something very unintuitive about them to me. I really only need it to do one thing. I know that I’m about to run a marathon and I want to finish that marathon in less than four hours. Which pace do I then need to maintain? In other words: enter distance and pace, out rolls the pace. Having found a good enough excuse for a little project, I set about making the calculator I wanted. Step number one, what’s the logic behind the calculation? Let’s see..</p><p>If you want to finish a marathon in 4 hours, that’s 240 minutes. A marathon is 42 kilometers. That means you have 240/42 = 5,7143 minutes to finish every kilometer. With this very basic formula, we can write the first bit of code. We need two input fields, which we’ll place in a form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C8AcUERZ_Udpg_q9" /></figure><p>This bit of code gives us the two input fields in a form and a button. To make that button work, a script needs to run when it is clicked. That script contains the function you see below. In it, we take the value from both input fields and assign them to a variable. A third variable for pace, which is the division of the distance by the time. Next, we want to be able to print this pace in a sentence, so we add a variable that turns the integer into a string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/0*OV4NPMZfUGGzDD6S" /></figure><p>Finally, the function pastes that string into a sentence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1BL-AS8rZXmVEJvz" /></figure><p>At this point, technically my goal is reached. We can input distance and time, click a button and out rolls the pace that we have to run at. However, nobody thinks in 5,7143 minutes. You think in 5 minutes and x seconds. The next challenge is formatting the result that way. This means the pace variable has to be split up. We want to extract the 5 first. Next, we want to recalculate 0,7143 minutes to seconds. To extract the 5, we convert 5,7143 to an integer using the parseInt() function. The input for this function is a string, which we already calculated in variable pace. We’ll assign this integer to a new variable called minutes. To extract everything after the decimal, we simply subtract the integer from the original time/distance calculation.</p><p>(5,7143–5 ) = 0,7143</p><p>The formula to recalculate 0,7143 to minutes is simply to multiply it by 60.</p><p>0,7143*60 = 42.858 seconds</p><p>We put this into a new variable, called seconds. To make this all as readable as possible, I wanted to round the seconds to one decimal. For this, we use the math.rounded() function. Simply putting the seconds variable into the function would round it to a whole number. To add an extra decimal, we multiply seconds by 10 to add an extra digit, and divide by 10 to get the actual result with one decimal. All of this brings us to the following function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/0*cLT8MpOSvEaTMzXL" /></figure><p>It once again prints the result variables into a sentence</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8qAO7B-MB2-lpdKl" /></figure><p>At this point, my original goal was totally complete. The math works, and you get a simple pace output from your time and distance. However, you might want to change the distance to imperial units, and input hours instead of minutes. This sounded daunting to me at first (especially the metric to imperial conversion), but then I realized the math doesn’t change. So I decided to add two extra elements: a dropdown for kilometers/miles and one for hours/minutes. We can add these by adding selects with the different options to the original form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4rL7LwAr8DMBFgg_" /></figure><p>Next is the additional math we need. Starting with the time format, the conversion from hours to minutes is of course very basic: if we want to allow someone to input 4 hours instead of 240 minutes, we need to multiply the result of time/distance by 60. This means we can largely reuse the function we used for calculating the pace based on minutes. As you can see, if this function is triggered it will print out the result into the same sentence as the minutes() function does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*oaSRM6sr0Ls1Db_f" /></figure><p>Because the time/distance calculation does not change when you switch from kilometers to miles, the only thing needed to accommodate the kilometer/miles selector is a variable in the final output sentence. We can do this by taking the value of that selector and printing it into that sentence. The following function takes care of that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/0*ZgJQjYh3xvCdys94" /></figure><p>We then update the output sentence to accommodate this value as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H13n_ZV0D7ie0_DG" /></figure><p>Now we’re <em>almost </em>there. We need to add one more function. This function needs to pick the right time function (minutes versus hours) based on what was selected by the user. If hours was selected, the hours() function is triggered and if minutes was selected, the minutes() function is triggered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/0*-Q-Cd1wqwlnO20wk" /></figure><p>The very final step, is to make the “calculate” button trigger the correct functions when it is pressed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aPetm7WdADBEgbCV" /></figure><p>With all of this done, a user can select hours or minutes, input the distance in kilometers or miles and see their pace is in the correct format. If you want to see if what I’ve shared here is actually true and works as it should, you can check out my calculator <a href="https://pacecalculator.netlify.com/">here</a>. If that still doesn’t convince you, feel free to check out my exact code <a href="https://github.com/Hugeaux/pacecalculatorfinal">here</a>.</p><p>Hopefully this post helped you build your own calculator or you simply enjoyed seeing the logic and functions that make my pace calculator work. If you did enjoy it, please consider subscribing so you’ll occasionally receive posts like this one in your inbox. Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31cd6be356e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I’ve Learned Starting My First Project as an Indie Maker]]></title>
            <link>https://medium.com/@hugovndrhorst/what-ive-learned-starting-my-first-project-as-a-maker-fa857100f421?source=rss-fd4d70ed3977------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa857100f421</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[indiedev]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Hugo van der Horst]]></dc:creator>
            <pubDate>Sat, 22 Sep 2018 10:16:36 GMT</pubDate>
            <atom:updated>2018-09-22T10:18:05.610Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*btrNGbClwDNdn4mK" /><figcaption>Photo by <a href="https://unsplash.com/@richtervet?utm_source=medium&amp;utm_medium=referral">Rich Tervet</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Back in May, inspired by the likes of @levelsio, I decided that it was time to try my own hand at building products. I’d been looking into teaching myself how to program for a long time but had never managed to get any further than a tutorial or course here and there. To break that cycle, I simply wanted to start building something.</strong></p><p>To give you a bit of context; I don’t exactly have a technical background. After finishing my bachelors degree in Psychology I went almost straight into my first job in a business role. Here and there I’ve dabbled with some programming tutorials and web stuff, but I’m not what you’d call prime programming material. This is exactly the reason I want to learn how to code and build products. To show people that with just a laptop and some dedication you can start at (almost) zero and become a proficient builder/programmer/developer.</p><p>To get there, though, takes more than a couple of tutorials. After finishing a number of different ones, each time just thinking about what my next one would be, I noticed it wasn’t really getting me any further. The safety of having the solution to a problem just a click away is very different to starting from scratch and building something.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*_twVWaCZ-qCTV6BwbgOcaw.png" /></figure><p>Wanting to build but not knowing what to build, I set out the find the target of my first project. My main aim wasn’t to make any money from it but to find something that would be enjoyable to work on often and something I’d like to use myself. After sharing a couple of ideas on Twitter and asking for people’s opinion the result was a web app that allows you to quickly create an event, invite people and track attendance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*Lft7DwMq9YVXDTk_8teD0Q.png" /></figure><p>The idea was as follows: build a web app that allows people to create an event and easily invite people to that event. I wanted to do this by providing a place to manage event, view who’s attending and providing a link to text around so people can indicate whether they’re coming. This is where the fun started, because now I could get started on actually building something. The very next question was: how? As a beginner, there were only a few things I knew that I could definitely do:</p><ul><li>Making a mock-up of what it should kind of look like</li><li>Coming up with a name</li><li>Finding no-code tools to help me build an MVP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oj4m69PH2g7Vsh8mDTFBKA.jpeg" /><figcaption>Here’s what that looked like</figcaption></figure><p>My goal was to get something usable up and running as quickly as possible, which is also where I ran into my first mistakes. Eager to have something to show for my efforts, my focus was initially on building the landing page. After coming up with the mock-up you see above, I had suddenly added a feature to the product simply because I decided on the tagline “I would like to…” which implied it needed options to pick between. So instead of simply having the option to create an event, I now had to look into building a “ Find an event” feature too. This didn’t dawn on me until a few days later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bJBPa9YEauPLpiJyVVZ13A.png" /><figcaption>Keeping it simple</figcaption></figure><p>After ripping that feature out again I decided to get some more feedback from actual people. Things like product/market fit and competition were not a great concern for me on this project because it was more about learning how to do this stuff than to immediately start making money, but it’s still nice to know if you’re building anything remotely useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_BWa_XDrD5xTocpJ-_nJxw.png" /><figcaption>n = small but still nice to have some confirmation</figcaption></figure><p>At this point I’d built more than just the landing page. I’d found Webflow to build the actual page, Airtable for the creating and saving of events and Zapier to send people who created an event an email containing a link to manage their event and a link to text to people to invite them, the MVP was basically finished (credit to <a href="https://www.newco.app/">newCo.app</a> for providing some great resources on building MVPs without code). Learning how these tools worked, setting them up and getting everything to work correctly took a couple of days. This also meant that the part that I could build without code was practically finished. As I mentioned earlier, one of the main reasons for me to start building products in the first place was to learn how to code. Learning to code is also a very slow process, and I was keen on making more quick progress. After experiencing the ease of using no-code tools to build something I went looking around for plug-and-play alternatives for things like a database to store the events people made and a way to provide people with an account. After using both Firebase and Netlify to get working accounts on the website I had again focused on adding something visual to the page that looked cool. But accounts that don’t actually do anything are somewhat a waste of time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sQpJ4Ex5GE1qAGYCyw06Tg.png" /><figcaption>Looks cool, but ultimately pretty useless</figcaption></figure><p>At this point I decided that not every day needs a visual update with new functionality. Learning how this no-code version could be rebuilt with code written by myself is going to take some time, because there are no shortcuts when learning how to code. As of the writing of this post I’m knee-deep in learning more about JavaScript and databases. Before I started working on this project I’d try to do this by finishing endless tutorials and hoping something sticks. I’ve now found out that you’ll never feel like you’re ready to start writing actual code and it’s better to find something you’d really like to build. You’ll still have to consult tutorials here and there but you can do it a lot more precisely and efficiently if you know what you’re looking for to help your project along.</p><p>Starting this project has been super useful so far. There’s still a long way to go but by simply starting I’ve already learned a lot in a relatively short amount of time. If you’re thinking about building products yourself and you’re wondering what to do, I’d say:</p><ul><li>Just start building, you’ll find out how things work as you go along.</li><li>Find the right balance between tutorials and real-world projects. You won’t make it by only doing tutorials but you also won’t make it by avoiding them at all costs.</li><li>Design comes later. While it might feel good to be able to show people a name, a logo or a super slick landing page, make sure you prioritize actual functionality above design at the start.</li><li>Ask for help. If there’s one thing that I’ve noticed it’s how helpful the online community of Indie Makers is. And almost all of them will be more than happy to help you out.</li></ul><p>I’m still very excited about this journey and look forward to improving my skills, shipping my first products and making those sweet, sweet first online euros. Always looking to connect with more Indie Makers so be sure to hit me up on <a href="https://twitter.com/hugovanderhorst">Twitter</a> or come join us in <a href="https://t.me/beginningcreators">Beginning Creators</a>. Not to forget: check out <a href="https://attendy.co/">the actual project</a> I’ve been talking about the entire time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa857100f421" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>