<?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 Al Hinds on Medium]]></title>
        <description><![CDATA[Stories by Al Hinds on Medium]]></description>
        <link>https://medium.com/@al-hinds?source=rss-c445e1690efa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Tya3lpQZ4tj4SdwKouF22Q.jpeg</url>
            <title>Stories by Al Hinds on Medium</title>
            <link>https://medium.com/@al-hinds?source=rss-c445e1690efa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 19:17:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@al-hinds/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[Frontend Performance: Why Lighthouse has made us lazy]]></title>
            <link>https://al-hinds.medium.com/frontend-performance-why-lighthouse-has-made-us-lazy-b7a1247db7cb?source=rss-c445e1690efa------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7a1247db7cb</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Al Hinds]]></dc:creator>
            <pubDate>Wed, 06 Jan 2021 03:04:18 GMT</pubDate>
            <atom:updated>2021-01-06T03:35:46.405Z</atom:updated>
            <content:encoded><![CDATA[<p>The greatest trap of optimising web application performance is failing to understand the limitations of the tools we use to measure it, and the type of performance we’re trying to extract. These are far less objective decisions than most would like to believe and don’t naturally lead to the same outcome.</p><p>Consider the performance needs a content-driven website, like a site that delivers news content, a wiki, or maybe a basic ecommerce offering will require. Mostly, they’ll feel performant if they load fast. So how can we make a site <em>load</em> fast? Well, we can;</p><ol><li>Send less bytes over the wire and cache where possible (scripts, stylesheets, assets etc), defer non-critical assets where possible and asynchronously load additional content</li><li>Serve static or server rendered pages to show content faster (without scripts)</li><li>Minimise above the fold reflows</li></ol><p>If executed well, the above will make a site <em>load </em>fast.</p><p>But some of these things come at an implicit performance tradeoff, and this tradeoff needs to be considered more carefully the more rich / or complex a web application becomes. For a proper Single Page Application (SPA), or non-trivial web application pushing load time too far starts to erode the SPA’s runtime performance.</p><p>Sure, bloated scripts will affect both the initial load time and runtime overhead of the application, but if an application requires additional deferred or lazily-loaded scripts to arrive before its properly functional, it’s not really loaded. The loaded experience also fails to properly encompass the complex combination of interactions of an entire user session. A user might <em>see</em> content fast, but if the 99% of their time in the app thereafter feels sluggish, we’ll still hear the same complaints about performance.</p><p>Let’s consider the original two points above in the context of a SPA like Jira.</p><blockquote>Send less bytes over the wire and cache where possible (scripts, stylesheets, assets etc), defer non-critical assets where possible and asynchronously load additional content</blockquote><p>&gt; Sending less bytes <em>also </em>means sending more later. If all of a user’s paths from a Kanban board (for example) are deferred scripts; to create an issue, update an epic, edit a sprint; every time a user moves away they’ll be hit by the friction of additional loading spinners, and lost time. This is fundamentally performance degradation.</p><blockquote>Serve static or server rendered pages to show content faster (without scripts)</blockquote><p>&gt; SSR or even statically rendered pages still require hydration to be useful in the context of a SPA. Servers need to do more processing to produce pages, and the usefulness of these pages is questionable if a user is still stuck waiting for more parts of a core experience to load even after the page is delivered.</p><p>This is to say nothing of the additional complexity we add to our application code by trying to allow for more asynchronous operations. And yet, we put considerable time into optimising these same things for all applications.</p><p>Why do we do this? That’s been a burning question I’ve been pondering in my mind for some time, but if I’m honest I believe it comes to down to how we measure, and what we measure with. The biggest issue with frontend metric-ing is the absence of good proxies for things we’re used to leaning on server-side. Things like CPU and Memory usage, and more user-focused things like the amount of time the main thread is blocked by scripting. We can guesstimate and discern some of these things using synthetic testing or by piercing the browser internals in lab environments to get some of these metrics directly, but if we want true, ‘real-user’ metrics, we’re limited.</p><p>So invariably we measure what we can, and this gets us into trouble.</p><p>Consider, Lighthouse. The distilled simplicity makes it an attractive offering. TTI (Time to Interactive), FID (First Input Delay), FMP/TTR (First Meaningful Paint/Time to Render), CLS (Cumulative Layout Shift) — together these are great heuristics for measuring a web application’s performance. And while I wouldn’t say that an application could be performant and fail Lighthouse’s heuristics, it also gives false significance to what some of these metrics mean. The biggest issue with them is how much they all focus on the load performance experience. And as I’ve already said, this is a false idol.</p><p>Science struggles with ill-defined objectives. Humans love to aim for simplicity. But sometimes the reality is neither. Better performance measurement pushes most of these notions aside, using them as guides rather than gospel. Unfortunately it’s also more complex to instrument, more subjective, and harder to abstract, and when time pressed we’re lazy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7a1247db7cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to: Deploy a Vue, React SPA with Travis CI and GitHub Pages]]></title>
            <link>https://medium.com/alex-hinds-portfolio/how-to-deploy-a-vue-react-spa-with-travis-ci-and-github-pages-5f1563ca3473?source=rss-c445e1690efa------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f1563ca3473</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[single-page-applications]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Al Hinds]]></dc:creator>
            <pubDate>Wed, 27 Mar 2019 05:58:48 GMT</pubDate>
            <atom:updated>2019-03-27T22:03:14.469Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*u0cyiQdkGNhUIdV-UZNAxQ.png" /></figure><p>Javascript web frameworks like <a href="https://reactjs.org/">React.js</a> and <a href="https://vuejs.org/">Vue.js</a> have made the building of dynamic web applications easier than ever, but deployment steps often leave newer developers scratching their heads. While there are <a href="https://facebook.github.io/create-react-app/docs/deployment">lots of valid ways</a> to go about deployment for simple applications, my issue with many of these approaches is that they obscure what’s actually being done, and thus beginners can tend get stuck customising or changing their configurations later on.</p><p>Personally I’ve really come to like the flexibility and out-of-the-box functionality provided by plain old <a href="https://pages.github.com/">GitHub Pages</a>. Pages is a free service that integrates with your GitHub account and allows you to host static web assets on a personalised domain.</p><p>By default it:</p><ul><li>Serves your web assets via HTTPS — no need to worry about managing your own SSL certificates ✅</li><li>And through a localised CDN which means you also don’t have to worry about things like caching and server response times. 🚀</li></ul><p>You’ll need a GitHub account first of course — if you don’t have one, <a href="https://github.com/">grab one now.</a> It’s free. I’m also going to use <a href="http://travis-ci.com/">Travis CI</a> to help automate all of the build steps so we won’t have to worry about whether the latest commit we’ve made also has our latest build in it. That’s all you’re going to need.</p><p>I’m going to use <a href="https://github.com/DarkPurple141/deploy-tutorial">this repository</a> as demo for all the skeleton code you’ll need.</p><p>Okay, so with all that out of the way let’s get into it.</p><h4>…in case you’re starting from scratch</h4><p>If you’re starting from scratch as a proof of concept create a new git repository now. Clone it locally, and then add at the very least an index.html file in it with some basic HTML. I’ve scaffolded mine with create-react-app and removed some of the boilerplate.</p><p>We now need to push what we’ve got to our remote.</p><pre>git add -A<br>git commit -m &quot;Test build&quot;<br>git push origin master</pre><h4>1. Setting up GitHub pages</h4><p>In its simplest form configuring pages is as simple as toggling the functionality in your repository settings. Settings should appear https://github.com/&lt;yourUsername&gt;/&lt;yourRepo&gt;/settings. It should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bG4tYuT80FPa3EqG65LRwg.png" /></figure><p>We’ll start by activating Pages on the master branch, by selecting master under the source selection. At this point you should be able to verify that your page is working by navigating to the link provided by Github pages. For reference mine looks like <a href="https://alhinds.com/deploy-tutorial/">this</a>. (<a href="http://darkpurple.github.io/deploy-tutorial">https://darkpurple141.github.io/deploy-tutorial</a>). And it should be showing either:</p><ol><li>An index.html file (if you put one in the root of your repository)</li><li>Your README.MD file, if one exists.</li></ol><h4>2. Moving our build to a clean branch</h4><p>One thing you want to avoid as your web applications get more complex is filling your repository with autogenerated files from compiles/builds. For one, these files shouldn’t be tracked as they can always be generated from your source, and two; they create large git diffs between commits, which bloat your repo. Bad :(.</p><p>Github offers the special gh-pages branch to deal with this issue. Create this branch now if you don’t have one:</p><pre>git checkout -b gh-pages<br># and push it to ur remote<br>git push</pre><p>Assuming that’s worked we should now have an additional selection (gh-pages) to us available in the same ‘Source’ settings menu we previously specified in the repository pages’ settings. Select this now.</p><p>To clean up, we’re going to check back into master and remove anything that was part of our previous deploy (eg. our old build files). Again, push these changes, and verify it’s all still working (eg. <a href="http://darkpurple.github.io/deploy-tutorial">https://darkpurple141.github.io/deploy-tutorial</a>).</p><h4>3. Automating deployment with Travis</h4><p>If you’ve followed all of the above you’re at a point where you could happily stop, and use the configuration we’ve just set up — but a lot of it will require manual processes that we’d rather avoid, so let’s start automating.</p><p>Add TravisCI to your GitHub project. You can do this through GitHub (in GitHub Apps), or via TravisCI directly after you set up a TravisCI account. Add any repository you want Travis to monitor and build from. You’ll need to authorise TravisCI’s access on GitHub when prompted.</p><p>Once this done we need to add a file to our existing project repository on the master branch. The file <em>needs</em> to be called .travis.yml and needs to sit in our project root. Once created, add the following lines:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/229ca492f88e4fbe9ad74f59a94ea745/href">https://medium.com/media/229ca492f88e4fbe9ad74f59a94ea745/href</a></iframe><p>This file acts as a recipe for TravisCI to build and deploy our application. The language and node_js sections specify the language of the scripts and the version required (in this case, “lts” or long term stable). The script section is the task we want TravisCI to run, and the deploy section controls our actual deployment. More on Travis Pages deploy configurations can be found <a href="https://docs.travis-ci.com/user/deployment/pages/#further-configuration">here</a>.</p><p>The $GITHUB_TOKEN variable is a secret personal access token that we need to generate on GitHub and allows Travis to push to our gh-pages branch. You can read up on how to create a personal access token <a href="https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line">here</a>. When you generate your token you’ll be prompted to give it certain permissions. The only permissions required are as pictured below: ‘public_repo’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BxIuctbvL-4zeVw92KaT4A.png" /></figure><p>Save your token! You won’t get to view it again.</p><p>We need to do a couple of additional changes to finish up. First, back in TravisCI’s dashboard, under repository settings, add your token. I’ve called mine GITHUB_TOKEN, but it can be called anything. Save this configuration.</p><p>Finally, if we’re using React in our project we need to add the “homepage” field in our package.json file with the url of our github pages page (again this should be something like <a href="http://darkpurple.github.io/deploy-tutorial">https://darkpurple141.github.io/deploy-tutorial</a>). And in the “scripts” section, we’re going to also add the following:</p><pre>&quot;scripts&quot;: {<br>  &quot;start&quot;: &quot;react-scripts start&quot;,<br>  &quot;clean&quot;: &quot;rm -rf build&quot;,<br>  &quot;build&quot;: &quot;react-scripts build&quot;,<br>  &quot;deploy&quot;: &quot;npm run clean &amp;&amp; npm run build&quot;<br>},</pre><p>Right! We’re good to go. Stage all your changes that you’ve made on master and push to update your remote repository. If all this has worked we can now go to Travis and see the build in progress. If it’s successful it should also have deployed!</p><h4>Bonus: Optimising our deployed build for static hosting</h4><p>One thing to note about SPA’s is they don’t have the best SEO. This is due to the fact that most crawlers will not wait for your JavaScript to finish building your page and thus will only see a blank page when they visit your site.</p><p>Modern commercial SPA’s get round this in two main ways; server side rendering (SSR) or pre-rendering. Given SSR requires us to have a server in place (and to be honest a more complex configuration), we’re going to opt for the far simpler pre-rendering option.</p><p>We can basic pre-rendering by adding the react-snap package to our project.</p><pre>&quot;scripts&quot;: {<br>  &quot;start&quot;: &quot;react-scripts start&quot;,<br>  &quot;clean&quot;: &quot;rm -rf build&quot;,<br>  &quot;build&quot;: &quot;react-scripts build&quot;,<br>  &quot;postbuild&quot;: &quot;react-snap&quot;,<br>  &quot;deploy&quot;: &quot;npm run clean &amp;&amp; npm run build&quot;<br>},</pre><p>And amending the way we mount our app as follows in your entry point file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a11233c05be7238b0d8633a3f8933f01/href">https://medium.com/media/a11233c05be7238b0d8633a3f8933f01/href</a></iframe><p>And that’s it. Every time we push to master now our project will build — and if the build is successful it’ll deploy our optimised SPA to Pages.</p><h4>Conclusion</h4><p>A small final note about this admittedly long guide — once you’ve done it once it’s trivial to do it again with other projects. You’ll have push-deploy built-in, and you’ll be able to focus more on what’s important — developing and designing your app.</p><p>Project live at <a href="https://alhinds.com/deploy-tutorial/">https://darkpurple141.github.io/deploy-tutorial/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f1563ca3473" width="1" height="1" alt=""><hr><p><a href="https://medium.com/alex-hinds-portfolio/how-to-deploy-a-vue-react-spa-with-travis-ci-and-github-pages-5f1563ca3473">How to: Deploy a Vue, React SPA with Travis CI and GitHub Pages</a> was originally published in <a href="https://medium.com/alex-hinds-portfolio">Alex Hinds Portfolio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Beatles, “Hey Jude”, as clarified by Donald Trump]]></title>
            <link>https://al-hinds.medium.com/the-beatles-hey-jude-as-clarified-by-donald-trump-d1539afa5a17?source=rss-c445e1690efa------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1539afa5a17</guid>
            <category><![CDATA[donald]]></category>
            <category><![CDATA[donald-trump]]></category>
            <category><![CDATA[music]]></category>
            <dc:creator><![CDATA[Al Hinds]]></dc:creator>
            <pubDate>Thu, 19 Jul 2018 22:47:54 GMT</pubDate>
            <atom:updated>2018-07-19T22:47:54.055Z</atom:updated>
            <content:encoded><![CDATA[<h4>Inspired by this: <a href="https://twitter.com/Cydster61/status/1019929901393154052">https://twitter.com/Cydster61/status/1019929901393154052</a></h4><p>Hey Jude, go make it bad<br>Take a sad song, don’t make it better<br>Remember don’t let her into your heart<br>Then you won’t start to make it better</p><p>Hey Jude, go be afraid<br>You weren’t made to go out and get her<br>The minute you let her under your skin<br>Then you’ll never start to make it better</p><p>And anytime you feel the pain, hey Jude, refrain<br>Go carry the world upon your shoulders<br>For well you know that it’s not a fool who plays it cool<br>By making his world a little colder<br>Yeah yeah yeah yeah yeah yeah yeah yeah yeah</p><p>Hey Jude, let me down<br>You haven’t found her, don’t go and get her<br>Remember don’t let her into your heart<br>Then you’ll never start to make it better</p><p>So let it out and let it in, hey Jude, begin<br>You’re not waiting for someone to perform with<br>And you know that it ain’t you, hey Jude, you’ll do<br>The movement you need ain’t on your shoulder<br>Yeah yeah yeah yeah yeah yeah yeah yeah yeah yeah</p><p>Hey Jude, go make it bad<br>Take a sad song, don’t make it better<br>Remember don’t let her under your skin</p><p>Then you’ll not begin to make it<br>Better better better better better better, oh<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude<br>Yeah yeah yeah yeah yeah yeah, yeah yeah yeah, hey Jude</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1539afa5a17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Basic Text Editor]]></title>
            <link>https://medium.com/alex-hinds-portfolio/building-a-basic-text-editor-ccbb39be3e11?source=rss-c445e1690efa------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccbb39be3e11</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Al Hinds]]></dc:creator>
            <pubDate>Mon, 02 Jul 2018 04:16:53 GMT</pubDate>
            <atom:updated>2018-07-02T04:16:53.204Z</atom:updated>
            <content:encoded><![CDATA[<h4>Vue.js + some basic javascript, html and css. live here: <a href="https://editor.alhinds.com/">https://editor.alhinds.com/</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p-gNcQCn2eNgo1kmELvUwA.png" /><figcaption>A simple, but largely finished product.</figcaption></figure><p>If you’ve ever used GitHub, you’re likely to have used its text editor. Maybe you cooked up a simple gist, or perhaps you made a simple change to an existing commit — or maybe that’s how you write all your code.</p><p>What’s interesting about the editor, and for the matter editors like <a href="https://codepen.io/">CodePen</a>, Ideone, and similar is that they have to resolve how they’re going to deal with things like syntax highlighting, various forms of markup, selections, spacing, all sorts of issues, because the basic `&lt;textarea&gt;` html tag is very limited.</p><p>See for yourself. Click on most sites which allow richer text formatting or syntax highlighting and notice how you’re most often not actually entering your text into a textbox — or if you are the textbox is not where it appears to be.</p><p>Here’s GitHub’s for example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RgNGnfATcC4vjJX1ffbu9Q.png" /><figcaption>In the above, the &lt;textarea/&gt; which has the style attribute display: none, is manually overriden to show how it’s sitting above the lower &lt;div/&gt; section you believe you’re editing.</figcaption></figure><p>To allow us to take full advantage of CSS and HTML, GitHub has created a secondary render &lt;div/&gt; which we *think* we’re interacting with which includes all of our rich elements, our nice font, and highlighting, with an underlying &lt;textarea/&gt; that we’re actually interacting with.</p><p>There are various levels of complexity to do this, but at its heart it’s a pretty simple concept to try and implement, so on I went.</p><h4>How I did it</h4><p>I didn’t want to go too deep into what multiple libraries have already attempted but I did have an idea as to how implement a ‘mirror’ to create the same as the above effect.</p><p>I’m using <a href="https://github.com/markedjs/marked">marked</a> for markdown parsing, and <a href="https://highlightjs.org/">highlightjs</a> for all other syntax highlighting. This eased my focus on simply creating the mirror rather than worrying about other parsing challenges.</p><p>Similar to how I’ve explained above I used a &lt;textarea/&gt; to hold the input text, although having played around with it, it would’ve also worked with a vanilla contenteditable &lt;div/&gt;. This sits perfectly aligned with the render &lt;div/&gt;, which the user believes they are editing their text in.</p><p>The result is <a href="http://editor.alhinds.com/">pretty good</a>, there’s no perceptible difference in input lag due to the dual-rendering, although I’ve not tried with huge documents (not really the point of the project).</p><p>The key challenge was getting the spacing, alignment, and selections to lineup as desired. This wasn’t entirely trivial as it required font syncing, appreciation and proper rendering of whitespace (HTML strips by default).</p><p>ALSO disregard tab-spacing and font-size, they’re yet to be dynamic despite being selectable options.</p><h4>HTML, Markdown &amp; JS execution</h4><p>Happy with the initial structure I went on to add a few more features including JS code execution (using eval :() and an &lt;iframe&gt; to allow proper inline html rendering. You can play around with those by simply changing the file-type. Yay.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccbb39be3e11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/alex-hinds-portfolio/building-a-basic-text-editor-ccbb39be3e11">Building a Basic Text Editor</a> was originally published in <a href="https://medium.com/alex-hinds-portfolio">Alex Hinds Portfolio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[To the first-time web developer]]></title>
            <link>https://al-hinds.medium.com/to-the-first-time-web-developer-e6623a624a83?source=rss-c445e1690efa------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6623a624a83</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Al Hinds]]></dc:creator>
            <pubDate>Tue, 30 Jan 2018 11:17:54 GMT</pubDate>
            <atom:updated>2018-01-30T21:26:33.282Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*862OavCalAT6sY-xK06PmQ.jpeg" /></figure><p>Well, hello!</p><p>So I understand you’re looking to make a website? Well, great. It’s super easy, it’s just a sprinkle of HTML, CSS, and JS and you’re done!</p><p>Well sort of.. you must realise that these are really only the basic tools. And only scrubs code directly with vanilla CSS and JS. You’d be far better suited with less.js or postcss.js, or SCSS. No? Fair, but you’d be <em>crazy</em> not to use a frontend framework! React.js or Angular.js perhaps? Facebook and Google built them and they’re so fancy and flash, and they’ll make things soooo much smother. Or something else entirely? Vue.js, Ember.js? We don’t need to settle on that now though. There’s just so much else to talk about.</p><p>You mustn’t forget the idiosyncrasies of the different browsers — say how Mozilla Firefox and Apple’s Safari can render the same HTML and CSS differently. Google’s Chrome isn’t quite the same as Microsoft’s Internet Explorer — and oh, by the way, what version of Chrome are you running? And what version of IE? What about devices and viewports and how you’re site works with iOS and Android and touch and scroll, and sizing and oh I can see you’re already looking a little pale, you’re alright aren’t you?</p><p>But we’re getting ahead of ourselves! What about getting your website online? Do you have a computer connected to the internet? Good, that’s a start but you’ll need to configure it to be a web server, find out whether your internet provider even allows you to run servers behind its firewall, and then find out what your localised IP address is. Then maybe we can host your website.. Oh speaking of hosting it, do you have a domain name? Maybe coolwebsite.com or example.net? If not you’ll need to buy one and register it. Name taken? Bad luck!</p><p>Oh and how were you configuring your web server? You’ll probably need a server side application language to handle your requests, perhaps, Python or Java or Node.js. What’s that? You want to use Node.js because it uses javascript! Well great! Except it’s kinda different — well very different — oh don’t worry you’ll get there. What’s your build system like? And do you have the right system permissions set?</p><p>What does your server do anyway? Does it simply serve your nicely crafted HTML page or can it do more? Can it respond to different types of requests, and push out dynamic pieces of data based on those differing requests. Is it secure? Can it restart itself if it crashes? Hopefully, you’d hate to have your website go down!</p><p>Ha, speaking of, we should probably use a framework for our server too. Maybe Flask, or Express.js or maybe we should make it all static? Hmmmmm.</p><p>AND A DATABASE! Oh silly me! You’ll definitely need a database. There are hundreds of options locally, but maybe you’ll opt for the cloud. Or not. Do you know SQL? No? Maybe a non-relational database is for you then? Maybe that’ll be easier. Or throw the towel in, stoop over a toilet and feel sick for a few months. To say nothing of security..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6623a624a83" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t ignore the basics: JS, CSS, HTML]]></title>
            <link>https://al-hinds.medium.com/dont-ignore-the-basics-js-css-html-563fdcd6fe2e?source=rss-c445e1690efa------2</link>
            <guid isPermaLink="false">https://medium.com/p/563fdcd6fe2e</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Al Hinds]]></dc:creator>
            <pubDate>Tue, 30 Jan 2018 10:54:23 GMT</pubDate>
            <atom:updated>2018-01-30T10:54:23.358Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why the building blocks of the web remain the core drivers of success in the modern web</h4><p>The modern web is a daunting place for the novice. Gone are the days when good ole’ HTML, CSS and PHP would get you by. This is the era of progressive web applications, there’s a whole industry spawned called frontend engineering, security has become a thing, and browsers have become infinitely more capable and powerful — and that aint even the half of it. There’s a lot more to learn that there ever has been, and there are hundreds and thousands of truly excellent places to learn from. But a lot — and I really mean a lot — is a distraction.</p><p>We somehow forget, I believe, that at the heart of the web are three core building blocks, CSS, HTML and Javascript. Given this it’s honestly astounding how few web developers properly understand the vanilla instances of each language. People might know how to use say, React.js, but fail to properly understand async concepts of Javascript, promises or the principles of the DOM. Or they might copy a whole chunk of CSS but be unable to edit or manipulate it without getting confused or lost.</p><p>For anyone that hasn’t or needs a refresher please spend some time poring over the excellent, comprehensive documentation that exists over at <a href="https://developer.mozilla.org/en-US/docs/Web">Mozilla</a>.</p><p>Each of these sub-parts are deep rabbit-holes of their own mastery and to be truly on top of them takes time, but none are strictly too difficult to start fiddling around with. A moderate level of HTML/CSS/JS underwritten by a good foundational programming knowledge is enough to make almost any complex website. Don’t forget the fundamentals, and don’t retreat to the flashy frameworks too quickly, it’ll do you a disservice in the end.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=563fdcd6fe2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web development is easy, right?]]></title>
            <link>https://al-hinds.medium.com/web-development-is-easy-right-6c27129d9764?source=rss-c445e1690efa------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c27129d9764</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Al Hinds]]></dc:creator>
            <pubDate>Mon, 29 Jan 2018 12:29:51 GMT</pubDate>
            <atom:updated>2018-01-30T11:20:07.214Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*tGze4gTMf6wavC3P6256MQ.png" /><figcaption>source: <a href="https://twitter.com/davechenell/status/557328423602098178">https://twitter.com/davechenell/status/557328423602098178</a></figcaption></figure><h4>My journey properly wading into the web.</h4><p>There’s an old meme that surfaced on my facebook feed (above) not so long ago that basically sums up how (many) people perceive web development. It’s funny in that it probably should be (and who knows — maybe someday will) just that easy.</p><p>Part of this cognitive dissonance stems, I think, from the programs we’re used to and have grown up on. We’ve all used a program like Microsoft Word, or Google Docs — formatting and markup is made pretty simple — so we’re led — quite intuitively to think the web should be the same. And in someways, it is.</p><p>A lot of my friends for example know some basic HTML and some even with a bit of hacking around, or google searching have even put together a basic Wordpress site, or coded a cool addition to their mySpace way back when.</p><pre>&lt;p&gt;Making websites is so easy!&lt;/p&gt; &lt;!-- Simple, right? --&gt;</pre><p>Only, as with about a billion other things in the world, the more you know, the less you know, you know.</p><p>I coded my first basic website in high school with some simple HTML that was available on the school intranet. That in itself felt like a triumph, but a lot had been done for me. I didn’t have to worry about things like servers, or routes, it was just a simple page. It had no Javascript, (Javascript was very nascent) and used no CSS. Style was inline in each element, where needed. It was fun, but it wasn’t extensible, and it was ultimately pretty limited. When I’d completed it, it was nice, and flashy, but it didn’t look that different to a well-formatted Word document and had been significantly more finicky to put together.</p><p>I lost interest in looking into it further. It didn’t seem that hard, it just felt tedious. Why bother?</p><p>It wouldn’t have been until the late <em>noughties</em> that I began to re-examine the foundations of the web after working in online journalism. Here I was once again, coding some basic HTML, but the web, and the possibilities it afforded had grown immensely. Javascript had evolved and changed the game — websites serving complex applications that looked slick were popping up all over the place, and my appetite to dive in again was well and truly whet.</p><p>I dabbled around and made some progress in my spare time but progress was slow and I was busy with work. I found the initial forays surprisingly challenging. I say surprising, because it had never appeared that it would be so hard from the outside, and the early strides had been smooth.. But then I kept getting stuck.</p><p>I got stuck in the mountains of documentation, in the dime a dozen tutorials that promised results in weeks — in the forums, and discussion boards explaining why one web development language was better than another, or about build systems, compiling your code, minification and automation — the list went on — and on — and on. After about 18 months of playing around on the side I gave up again. I did have a fresh appreciation for what the web was, and some of its tools, but I didn’t have the time to further pursue.</p><p>Until I did. I’ve often found that time apart from something allows you to properly reflect and think about what you’ve learnt. For the knowledge to really sink in. For me it was the kind of bug that pushed me into a decision to retrain as Software Engineer — just shy of a decade into a prospering journalism career. It’s a decision I don’t regret for an instant, it was purely a gut, intuition type thing but it was 100 per cent the right thing to do.</p><p>Without the distraction of a full-time job I began studying in my daytime, and programming in my evenings. What I quickly came to learn was that our instincts of programming, and the web are mainly correct. It is simple, and need not be so complicated but it’s a far deeper rabbit hole, in time, information and expertise than is easy to do justice when you’re just getting your feet wet. It’s undeniably a jungle out there, but it’s the kind of jungle that with a little consideration and perseverance, can be navigated.</p><p>Some three years on and I now understand enough at least to make camp for the night and survive. I know I don’t know a lot, but a know reams and reams more than I could verbalise not so long ago. I’m still fascinated. If anything my fascination has deepened and progressed, and taken me down pathways I didn’t know existed.</p><p>I’ve just completed a website (my own in fact) with a framework called <a href="http://vuejs.org/">Vue.js</a> (will be writing about that more soon). It’s nothing special, but pulls together a lot of web knowledge I’ve picked up over the past 18–24 months. It was a massive learning experience. It’s taken me upwards of 80 hours to put together from scratch. This is perhaps slightly exception given it’s my own website and I’m liable to tinker unnecessarily, but it should put into perspective the grift required.</p><p><em>TL;DR — Becoming an web developer takes skill time, and dedication and it won’t happen overnight..</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c27129d9764" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making an HTML5 game using Paper.js]]></title>
            <link>https://medium.com/alex-hinds-portfolio/making-an-html5-game-using-paper-js-dc05f51119d5?source=rss-c445e1690efa------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc05f51119d5</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[canvas]]></category>
            <category><![CDATA[games]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Al Hinds]]></dc:creator>
            <pubDate>Thu, 11 Jan 2018 11:12:08 GMT</pubDate>
            <atom:updated>2018-01-11T11:12:08.310Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bhKlTiNvLLB_n_AKCzrtZQ.png" /></figure><h4>How I made Tank Hunter, a simple desktop HTML Canvas game.</h4><p><em>Preface: I began this with very basic html, and css knowledge and a vague understanding of javascript.</em></p><p>Why do I like tanks? I have NFI, but I do and when I needed an idea to make a game just before the second year uni-break, I thought the idea of a tank game would be pretty friggin’ fun.</p><p>Overall the project took me a little under two weeks. I wasn’t working on it everyday, but it was a nice procrastination tool during the end of my exam period.</p><p>I had a basic idea of what I wanted to do but it was really a ‘let’s see where this goes’ type of thing and so there were many points where — had I had my time again I probably would’ve made different decisions — but that’s learning ‘innit?</p><h4>The how</h4><p>The core is simple enough. A basic index.html file with some simple css to control things like menus, display and some of the interactivity. Overall though, 90% of the project was deep in javascript, most of that, deep in paperscript (a subtle variant of vanilla used for a more seamless paper.js experience) conducting the canvas orchestra. As with a lot of littler html projects I do these days I used <a href="http://surge.sh/">surge.sh</a> to host and deploy.</p><h4>Design</h4><p>Throwing together graphics quickly tends to lend itself to simple shortcuts. My tanks were collections of basic shapes and polygons, collected and packaged together with some basic functionality. My explosions, randomly dispersing circles that dissipate over time. My shells, fast-moving circles.</p><p>Before I had any real gameplay I set up some basic up-down-left-right w-a-s-d controls for tank and turret control so I could test the feel. I wanted it to be sluggishly responsive and simple enough to master the basics.</p><h4>Gameplay</h4><p>I set the game up as a contest between two teams; green, black, with the user identified as a yellow and black hybrid (for differentiation), as a member of the black team. The core gameplay revolves around moving across the map to meet the enemy. Shots from longer distances can deflect, or at the very least do lesser damage. Point blank can do critical damage, disabling and even destroying the tank. There are accuracy bonuses if the tank is not moving, with a minor scatter if the tank is moving.</p><h4>Introducing AI</h4><p>Basic AI was simple. Get the tanks to try and move toward and enemy. When in range, begin shooting. This algorithm was run on every repaint, and meant games ended relatively quickly but it turned out to be a) slightly boring and predictable, and b) slightly too difficult to beat the AI. The tanks also didn’t use their turret and I wanted them to.</p><p>After a lot of tweaking, the addition of an invisible vision cone ahead of the tanks to introduce ray casting type target tracking, and a much more vague level of information provided to the AI the game was a lot more playable. I was wary to go to deep on tweaking.</p><h4>Next steps</h4><p>Even though this was very much a toy project I have two main things I’d like to do to extent the game.</p><ul><li>Integrate with a free database to get some high scores permanency.</li><li>And add a co-op mode (at the very least some basic-level of multiplayer)</li></ul><p>For now though, check it out and let me know what you think.</p><p>The game is live <a href="http://cheap-nation.surge.sh/">here</a>.</p><p>And the source code for the project is on <a href="https://github.com/DarkPurple141/Tank-Hunter-2D">github here</a>.</p><p>Let me know what you think!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc05f51119d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/alex-hinds-portfolio/making-an-html5-game-using-paper-js-dc05f51119d5">Making an HTML5 game using Paper.js</a> was originally published in <a href="https://medium.com/alex-hinds-portfolio">Alex Hinds Portfolio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing a deck of cards; considerations]]></title>
            <link>https://al-hinds.medium.com/implementing-a-deck-of-cards-considerations-dd2e3bf5c36f?source=rss-c445e1690efa------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd2e3bf5c36f</guid>
            <category><![CDATA[c]]></category>
            <category><![CDATA[adt]]></category>
            <category><![CDATA[card-game]]></category>
            <category><![CDATA[abstraction]]></category>
            <category><![CDATA[teaching]]></category>
            <dc:creator><![CDATA[Al Hinds]]></dc:creator>
            <pubDate>Tue, 17 Oct 2017 02:41:36 GMT</pubDate>
            <atom:updated>2017-10-17T02:41:36.624Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*4sw33Q33tnZDOcpKCdmIHQ.png" /><figcaption>PROGRAMMING ❤</figcaption></figure><p>A deck of cards for a game had a lot of student’s scratching their head — even when the appropriate data structures had been drilled into them for the previous few weeks. The problem here was connecting the dots. There are many correct possible ideas here, and that in itself is intimidating for newcomers.</p><p>What does a deck need to do?</p><ul><li>An abstracted deck should hold a number of cards.</li><li>It should be simple to add and remove cards from the deck</li><li>It can hold order, but doesn’t have to. That is; order isn’t guaranteed.</li><li>The size is going to be dynamic and often changing (HINT: Don’t use an array).</li></ul><p>Possible implementations:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b51a2e355abd4dfbadf8a47701ccdca6/href">https://medium.com/media/b51a2e355abd4dfbadf8a47701ccdca6/href</a></iframe><p>There are tradeoffs with all of the above.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd2e3bf5c36f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TIL: Pipelines on BitBucket]]></title>
            <link>https://al-hinds.medium.com/til-pipelines-on-bitbucket-63b847785e4f?source=rss-c445e1690efa------2</link>
            <guid isPermaLink="false">https://medium.com/p/63b847785e4f</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[bitbucket]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[pipeline]]></category>
            <dc:creator><![CDATA[Al Hinds]]></dc:creator>
            <pubDate>Tue, 01 Aug 2017 12:03:57 GMT</pubDate>
            <atom:updated>2017-08-01T12:13:35.333Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hrkQlS5kuWbrHtX-t-mX2w.png" /><figcaption>bitbucket.com</figcaption></figure><p>I’ve been using Atlassian’s git repository software ‘BitBucket’ for quite some time but have only recently started experimenting with their pipelines feature, and it’s pretty damn impressive.</p><p><em>tl;dr Pipelines are not just novelty, they’re free*, and allow for some pretty cool functionality to do with your software’s build status. You should give ’em a try.</em></p><h4>Long version</h4><p>If you’re a git power user, you might have already experimented with <a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks">git-hooks</a>. For those that don’t know, git-hooks allow you to insert scripts into the base git command workflow. In practice, this could mean having a complicated test suite run before a push is executed, or something as simple as forcing a commit comment to be above a certain length and of a certain style.</p><p>These are nice features to shape your workflow, but you definitely ‘feel’ them as you develop. If you’re simply doing a quick commit and bugfix, which you’ve already tested, you probably don’t want to go through that process again. What’s more it becomes even more jarring if you’re doing multiple updates a day, or doing changes that are don’t even affect your core software.</p><p>This is where <a href="https://bitbucket.org/product/features/pipelines">pipelines</a> come in.</p><h4>Pipelines</h4><p>What’s a pipeline you say?</p><p>They’re essentially just a little mini remote server that you use to run your current build. This is *super* useful as it takes away any local machine time, test toiling and runs it in the background while you get on with your work. If something does go wrong, you’ll get a notification. If it doesn’t. No worries.</p><p>At their heart they’re designed for continuous integration and they’re neatly packed in with bitbucket’s existing ecosystem.</p><p>Pipelines aren’t for everyone, and make far more sense with more complex software but considering they’re free to use (1000mins of server time is gifted to you per month as a base user) and super easy to get started with. I’d strongly encourage developers who haven’t used them to at least experiment with the feature. You’ve got nothing to lose.</p><h4>Getting started</h4><p>As simple as committing a file called bitbucket-pipelines.yml into the base directory of your repository which includes syntax similar to this:</p><pre># This is a sample build configuration for all languages.<br># Check our guides at <a href="https://confluence.atlassian.com/x/5Q4SMw">https://confluence.atlassian.com/x/5Q4SMw</a> for more examples.<br># Only use spaces to indent your .yml configuration.<br># — — -<br># You can specify a custom docker image from Docker Hub as your build environment.<br># image: docker-image:tag</pre><pre>pipelines:<br>  default:<br>     — step:<br>       script:<br>         — echo “Everything is awesome!”</pre><p>The syntax is pretty easy to get your head around and will work for all sorts of build system. I’ve been using it with gcc+6.1 to play with my uni c projects for no other reason than I can.</p><p>But you can run all sorts of builds with no major tweaking. Below is a sample configuration script (it just runs make and makes sure it compiles successfully, without errors) I have run as part of my first ‘play’ pipeline.</p><pre>#!/bin/sh -e</pre><pre># nothing special going on here.</pre><pre>DIR=&quot;$HOME/usr/local/bin&quot;;</pre><pre>mkdir -p $DIR;</pre><pre>PATH=&quot;$PATH:$DIR&quot;;</pre><pre>ln -s `which gcc` &quot;$DIR/dcc&quot;;</pre><pre>cd labs;</pre><pre>for f in `ls` do<br>  <br>  cd $f;<br>  echo &quot;$f now compiling&quot;<br>  make clean<br>  make<br>  cd ..</pre><pre>done</pre><p>I could add a whole bunch of other scripts to this pipeline, to increase the coverage or inject more tests, but at least for now I’m guaranteed that my pushes will at least compile and run cleanly.</p><p>I’ve used this at work (where real devs have put together much more complex pipes) and it’s super impressive when you’ve got multiple teams working together, but even on a small project it’s been fun and thoughtless to have in the background running. It doesn’t affect my workflow, but does let me know when things go awry.</p><p>Anyway. I’m going to look at extending it further and using it with some of my other existing projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cd0rXmJL7mBK7YfIQMFkLQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63b847785e4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>