<?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 Jamie Harding on Medium]]></title>
        <description><![CDATA[Stories by Jamie Harding on Medium]]></description>
        <link>https://medium.com/@jharding142?source=rss-9e6b04beab15------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lOpKti9zjrzJGcJdjxyUGQ.jpeg</url>
            <title>Stories by Jamie Harding on Medium</title>
            <link>https://medium.com/@jharding142?source=rss-9e6b04beab15------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 07:36:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jharding142/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[Turning a WhatsApp chat history into useable Javascript.]]></title>
            <link>https://medium.com/@jharding142/turning-a-whatsapp-chat-history-into-useable-javascript-d192eee2569b?source=rss-9e6b04beab15------2</link>
            <guid isPermaLink="false">https://medium.com/p/d192eee2569b</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[electronic-music]]></category>
            <dc:creator><![CDATA[Jamie Harding]]></dc:creator>
            <pubDate>Wed, 13 Oct 2021 15:10:21 GMT</pubDate>
            <atom:updated>2021-10-15T07:29:34.037Z</atom:updated>
            <content:encoded><![CDATA[<p>When lockdown began in Germany and millions of people were forced to work from home, some friends started a WhatsApp group to share long-form, usually instrumental mixes of music — the kind of stuff that bubbles away in the background, holding your attention without being distracting. This was around the time that I started coding seriously, and these hours-long mixes were perfect for reading docs, messing about in the dev tools or desperately trying to center a div in a flex container.</p><p>Recommendations were reliably well-considered — in the mornings a pillow of soft ambient or downtempo jazz, some midweek some garage and dub techno and Friday evening techno or house. I found myself scrolling back to weekend posts when I needed a lift. By the end of the year, there were over 1,000 links posted, most accompanied by evocative descriptions and hashtags.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*BADP5mDjayw-mIB-aSWKfQ.png" /><figcaption>The rules according to LockdownListens</figcaption></figure><p>On the first anniversary of the group’s inception I exported the chat to a .txt file, and in the final weeks of my studies at SPICED Academy I often spent my lunch breaks playing with the archive of that year’s music. <a href="https://lockdownlistens.herokuapp.com/">Lockdown Listens</a> is now a living, breathing website. Today I’m going explain how I got started — by translating that huge block of text into something that could exist in a database, and eventually assume form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*lIet1D0bAoFsOj4Sw8vJxw.gif" /><figcaption>Recommendations are based on the date and time wherever you are.</figcaption></figure><h3>First thing’s first, turn it into JSON</h3><p>WhatsApp exports chat history as a text file with the same basic formatting for each line. The format goes as follows:</p><p><strong>[10.03.21, 15:45:04] J Harding: miccachu vibes, “only hi-fi” 👌</strong></p><p>The simplest way to turn a thousand (or a million) lines of text into JSON is by using a text editor, then changing the file extension. I used Sublime Text for this purpose, as it has similar functionality to VSCode. First, I did a quick find + replace, swapping any double quotation marks for singles. Otherwise the strings would be split up (see above), and the JSON would not be reliable.</p><ol><li>Cmd + A (Select all)</li><li>Cmd + Shift + L (Add a cursor on every line)</li><li>Cmd + → (Send cursors to the end of every line)</li><li>“ , (Add the quote and comma at the end of the line)</li><li>Cmd + ← (Go to the first character of the line)</li><li>Cmd + ← (Go to the start of the line, avoiding tabs and line breaks)</li><li>“ (Add opening curly brackets)</li></ol><p>Wrap all those lines in a set of square brackets, and you’ve got a massive JSON array, ready to work with.</p><h3>Separate the beats from the chat</h3><p>For LockdownListens, the only messages I was interested in were ones with links. Most of the mixes shared were from Soundcloud and Mixcloud, so I filtered all the messages for links to those sites.</p><p>It’s worth pointing out at this point that I was using Node.js for this. The following code was all housed in a file called populate.js. As I built the functions, I would regularly test them in the VSCode terminal, to make sure the data was moving through the functions in the right way. This meant console.logging 1,000 lines of JSON over and over again in order to make sure the string methods were working as intended.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc59cff33477e34d1c5851a291d09e08/href">https://medium.com/media/dc59cff33477e34d1c5851a291d09e08/href</a></iframe><p>chat.JSON is an array of strings, so soundOrMix will be an array of strings that fit the criteria. They have URLs, and they have instances of “soundcloud” or “mixcloud”.</p><h3>Objectify</h3><p>The Postgres table has columns ready to accept date, time, message, link(s) and hashtag(s).With some creative queries, it will take apart the object and put the relevant values in the correct columns.</p><p>In order to separate the links and hashtags, I used a couple of regex. The hashtags should be separated into an array, naturally. The links array usually only contains one link, but occasionally throws up more than one. In that case, the database only accepts links[0], and the others are lost for eternity.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/471bef34a5d2372a220836eb52d1eefe/href">https://medium.com/media/471bef34a5d2372a220836eb52d1eefe/href</a></iframe><p>With these two functions defined, all that’s left to do is create the message object, using a few simple string methods to separate the dates and times. The result is a big array of objects, which can be fed into my queries to populate the PostGres (and later, Heroku) databases quickly and accurately. I like to create a local file of all these objects, in case anything goes wrong when I populate the database.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f6829777949f4b706ec301af9e032e4/href">https://medium.com/media/2f6829777949f4b706ec301af9e032e4/href</a></iframe><p>The end result is an array of objects of uniform formatting. With all my ducks in a row, it was possible to move on to the good stuff — namely, building a frontend that can put this music out into the world.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f09e7870d137f3076b5dad415c3f67e5/href">https://medium.com/media/f09e7870d137f3076b5dad415c3f67e5/href</a></iframe><p>I recommend this mix for Thursday afternoons, by the way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d192eee2569b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Fundamentals, fundamentals, fundamentals…]]></title>
            <link>https://medium.com/@jharding142/fundamentals-fundamentals-fundamentals-7eba7da964e?source=rss-9e6b04beab15------2</link>
            <guid isPermaLink="false">https://medium.com/p/7eba7da964e</guid>
            <category><![CDATA[career-change]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Jamie Harding]]></dc:creator>
            <pubDate>Sat, 11 Sep 2021 11:20:23 GMT</pubDate>
            <atom:updated>2021-09-16T12:34:18.718Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>…You’ve got to get the fundamentals down because otherwise the fancy stuff isn’t going to work.”<br>- Randy Pausch</em></strong></p><p>Getting job interviews is great. Job interviews <em>themselves </em>are great. Listening to senior devs talk about their work. Getting a peek behind the curtain at interesting companies. Feeling like I’m getting closer to my first role. For all the sense of achievement I felt after completing my bootcamp and producing <a href="https://lockdownlistens.herokuapp.com/">Lockdown Listens</a>, entering the job market has made me feel like Homer Simpson on the Murderhorn, realising that the “summit” was just a plateau. Not only that, but the lessons I learnt taking my first steps — lessons that feel like a distant memory — will be as important on the final ascent as they were at base camp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*ODDsahlIxDlnF7qrE1mmkA.jpeg" /><figcaption>Son, don’t go up that mountain! You’ll die up there, just like I did!</figcaption></figure><p>TypeScript and GraphQL are cool. Fancy. I’d be a fool not to at least get familiar with them — they show up in eight out of ten job ads. But this post isn’t about fancy stuff. In interviews for jobs that require TS knowledge, most employers want to see that I understand the benefit as opposed to just the feature, and I do. The things that have tripped me up have been questions about the fundamentals. Things that no amount of CodeWars challenges and tinkering with React can teach.</p><p>At the risk of sounding totally inept — here are some questions that tripped me up in a recent interview.</p><ul><li><em>What’s the difference between var and let, in terms of scope?</em></li><li><em>What’s the difference between null and undefined, and are they both types?</em></li><li><em>What’s hoisting?</em></li></ul><p>In my defence, I had just come back from a holiday where I contracted bronchitis. But there’s a lesson to be learned here…</p><p>There’s a difference between knowing <em>when </em>to use things, and knowing <em>why</em> I’m using them. Trial and error works, but it wastes a lot of time. Recruiters want to know that I didn’t stumble through my bootcamp holding Merle and Oli’s hands (thanks guys), so it’s important to be able to elucidate, explain, expand upon the fundamentals. So, here goes. These explanations are addressed to myself circa Summer 2020, bright-eyed, bushy-tailed and largely clueless. You can do it, champ!</p><h3>var, let and scope</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*QHtdVga77-jP1LEBodveJA.png" /><figcaption>bar is only defined inside the { } block in which it was declared</figcaption></figure><p>ES6 introduced let and const. Variables declared with these keywords cannot be accessed outside of the block in which they are declared.</p><p>On the other hand, variables declared with var exist in <strong>global scope</strong>. They can be accessed from anywhere.</p><p>Duh.</p><h3>null vs. undefined</h3><p>First thing’s first — both are types! I think I told my interviewer that undefined wasn’t a type but null was. I don’t know what I was thinking. Like I say, bronchitis.</p><p>Reflecting on my answer, I can think of use-cases for null that I didn’t have at my fingertips in the interview. I think a good answer would have been something like:</p><blockquote>“Undefined is used by the compiler to describe variables that don’t point to a reference. It doesn’t really serve a purpose for me when I’m coding. <br>On the other hand if I want to declare an empty object that I expect to be filled, I can intiate it with a null value. For example, I might want to conditionally render a component when some data exists after user input. Before that input, it should still be defined, so I would use null as a placeholder.”</blockquote><h3>What’s hoisting?</h3><p>For as long as I can remember, I’ve declared my variables at the top of my code. It seems obvious that I would create references to things <strong>before</strong> using those references. When I do this, I’m doing the job of the compiler — hoisting!</p><p>When compiling, JavaScript moves all declarations (<strong>not</strong> initializations, more on that below) to the top of their current scope — be it the function wrapper or the document entire.</p><pre>var declaration;                     // this WILL be hoisted </pre><pre>var newVariable = &quot;initialized&quot;      // this will NOT</pre><pre>let hoisted;                         // this WILL be hoisted<br>                                        but not initialized!</pre><p>As usual, the best examples are from MDN Docs. In the one below, the function declaration is hoisted above the invocation of the function, so it works as normal.</p><pre>catName(“Chloe”);</pre><pre>function catName(name) {<br> console.log(“My cat’s name is “ + name);<br>}<br>/*<br>The result of the code above is: “My cat’s name is Chloe”<br>*/</pre><p>Here’s another example demonstrating two points, just to confuse things futher…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*G_z6B4mEyYwWXznt4okZtg.png" /><figcaption>Until the line in which they are initialized is executed, any code that accesses these variables will throw an exception.</figcaption></figure><p>In this example let num; is the declaration and num = 5; is the initialization. <strong>Only </strong>the declaration will be hoisted. Although hoisted, let and const declarations are not initialized with the default undefined value, hence the big red message. How do we know that let num; has been hoisted? Because if it wasn’t, the error would tell us n is not defined .</p><p>With so much margin for error, it makes total sense to declare all variable at the beginning of every scope. I had always done this, but now I can explain <strong>why</strong>. Knowing is one thing, understanding is another thing entirely. I have to work for understanding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7eba7da964e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How injury, cocktails and lockdown turned my hobby into a new career]]></title>
            <link>https://medium.com/@jharding142/how-injury-cocktails-and-lockdown-turned-my-hobby-into-a-new-career-a6106c3c1799?source=rss-9e6b04beab15------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6106c3c1799</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[codingbootcamp]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[career-change]]></category>
            <category><![CDATA[berlin]]></category>
            <dc:creator><![CDATA[Jamie Harding]]></dc:creator>
            <pubDate>Fri, 10 Sep 2021 10:26:14 GMT</pubDate>
            <atom:updated>2021-09-10T10:26:14.366Z</atom:updated>
            <content:encoded><![CDATA[<p>I had been living in Berlin for three years, working mostly as a cocktail bartender in dive bars and polished hotels. I had no long-term goals but I had a lot of hobbies. I played football and tennis and slacklined and went to clubs. The neighbourhood was full of cinemas and I went three times a week. I went to the gym one day and the flat benches were taken, the incline bench too. I got on the decline bench — a new one for me — and put two small plates on the barbell. At the top of the first repetition I pushed my head back into the bench and felt a pinch in the top of my spine. That sharp unpredictable pain would stick around for months.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OEnIT1Z05su4qX9cRcvhJQ.png" /><figcaption>For the curious: Spiced Rum, White Rum, Orgeat, Fig Jam, Lemon</figcaption></figure><p>Shaking hundreds of cocktails four nights a week was out of the question. I took a job as a waiter and started to think about a career change. Then the pandemic hit, and suddenly I was out of a job with nothing but time on my hands. A year before, my friend Al Quinn had mentioned a course he’d taken on Full Stack Web Development. He’d been a bartender on the same strip as me, and he said the bootcamp was the best thing he’d ever done. His words came back to me in the stretched afternoons of Spring 2020 and I spoke to friends about the possibility of taking the same route. Before moving to Berlin, I’d had a career in the arts and as a teacher — I think of myself as a logical thinker with creative instincts. More carpenter than magician. I’ve always been into computers but I hadn’t written code since MySpace ruled the waves.</p><p>That Autumn I started Colt Steele’s Full Stack Web Development Bootcamp on Udemy. Testing the waters. In the morning I would go to my physio and learn strange new exercises and at night I would spend hours laying on my back, trying to find a position that wouldn’t cause the herniated disc to irritate my spinal cord. When I was coding, I could ignore the pain. I attacked the course with a hunger bordering on mania. My notes were hand-written and largely unintelligible, and nothing really stuck. After a couple of weeks, I started again. This time, instead of trying to stuff my head full of syntax, I treated each module as a chance to build a reference library for my future education. I made detailed inline notes in VS Code and found that rephrasing things (if sometimes erroneously) in my own words allowed me to feel that I was <em>owning</em> this knowledge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aqPXf7fgKdUN1pIZVJzgiw.png" /><figcaption>Better notes — better progress</figcaption></figure><p>In December I applied for twelve weeks of intensive study at SPICED Academy. The Colt Steele course had put me in excellent stead and I was accepted. I won’t go into detail here about the curriculum at SPICED — trade secrets and all that — but future posts will give you an idea of where I stand as a developer now. I have strengths, curiosities, (huge) gaps in knowledge and faith in my ability to bridge them.</p><p>Still haven’t been back to the gym though.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6106c3c1799" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>