<?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 Luke Duncan on Medium]]></title>
        <description><![CDATA[Stories by Luke Duncan on Medium]]></description>
        <link>https://medium.com/@luke_duncan?source=rss-9ab0be5baa1c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*CZGQ4Uq_NYthyAV3o8USfg.png</url>
            <title>Stories by Luke Duncan on Medium</title>
            <link>https://medium.com/@luke_duncan?source=rss-9ab0be5baa1c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:52:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@luke_duncan/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[Questions for a live technical interview — what questions I like to ask and why]]></title>
            <link>https://medium.com/swlh/questions-for-a-live-technical-interview-what-questions-i-like-to-ask-and-why-7d5fe0cfbd85?source=rss-9ab0be5baa1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d5fe0cfbd85</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[technical-interview]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Luke Duncan]]></dc:creator>
            <pubDate>Thu, 30 Apr 2020 03:23:28 GMT</pubDate>
            <atom:updated>2020-04-30T15:26:28.867Z</atom:updated>
            <content:encoded><![CDATA[<h3>Questions for a live technical interview — what questions I like to ask and why</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*1TQhFVERgm1_RTmx-i_LHw.png" /></figure><p>Technical interviews are probably the most daunting experience a software engineer can have. With every interview, comes a different set of expectations, skills needed and questions asked during an interview.</p><p>I’ve gone through a bunch of technical interviews as a candidate. These interviews have ranged from some of the biggest companies in the world, all the way down to small 2-person technology agencies. I have also been in the interviewer seat at companies I’ve worked at in the past. I’ve conducted white-boarding interviews, reviewed take-home assignments and sat in on live-coding sessions.</p><p>These experiences have allowed me to develop a good sense of what questions to ask during a technical interview — or at least questions that I like to use to gauge a candidates technical chops.</p><p>Before I go into the questions, let me first clarify what I like to see in candidates. I think this will provide some of the context as to why I ask certain questions. Most of the points below cater to both junior and senior engineers, and the candidate has at least broken through the HR gate and first phone screen.</p><h4>What I look for in candidates</h4><ul><li>A good base of knowledge in whatever language THEY choose. Demonstrate fundamentals e.g. loops, statements, data structures. If the candidate isn’t familiar with the language the company uses, no big deal. And if I feel like they do need help, I tell candidates to Google to get the specific method or helper function. After all — If I haven’t been using Javascript for a while, I always need to Google a simple for loop.</li><li>That being said — if it comes down to two candidates who we think are the exact same, and one has experience with the language my company uses, I’m probably picking them.</li><li>I’ll be able to tell if you don’t have a good grasp of the language just from the way your thinking, and typing. You can’t Google everything.</li><li>Good, clear, basic communication. While I get that some conversations have to get REALLY technical, speak to me in plain language to describe a problem and to tell me some of the ideas you have. Describe your solution and tell me some of the potential draw backs as well.</li><li>Ability to solve problems that the company currently deals with. Some of the code questions are setup to mimic this.</li><li>The ability to work alongside me. Showcase that you can work well in a team.</li></ul><p>Below you’ll find the questions I like to ask. Depending on the interview setup, I will ask a few of the smaller questions if it’s going to be a 45+ minute interview. If it’s 30–45 minutes then I like to ask one of the bigger questions.</p><p>I’ve purposely left some things vague in the questions, just in case a future candidate I’m interviewing with finds this article hehe! But +++ if you are prepping, tell me you saw this. Most of the questions I ask can be applied to any language, but obviously in some cases e.g. hiring a React developer, you want to use React.</p><h3>[Fullstack] Turn a CSV file into an array of objects.</h3><ul><li>This question requires you to use a IDE like <a href="https://coderpad.io/">CoderPad</a> that lets you upload files</li><li>Let’s me figure out/see how they work with objects, arrays and basic loops</li><li>Includes use of basic file system to read CSV — we purposely have the fs.readFileSync to start off. This lets me see what they know about file usage and what their thoughts are about how to handle it next.</li><li>The let variable is there on purpose. I want to see if they know what the difference is between const, let, var. I’m waiting to see if they do something with it.</li><li>I’m looking for senior engineers to complete this relatively quickly (10–20 minutes)</li><li>For junior engineers, I’m looking for them to complete this in around 30 minutes</li><li>From experience, senior engineers can usually complete this anywhere from 10–15 minutes</li></ul><pre>const _ = require(&#39;lodash&#39;);<br>const fs = require(&#39;fs&#39;);</pre><pre>// CSV contents<br>// Company,Total Users,MRR,AR,Profit\n<br>// &quot;A, Inc&quot;,100,359,2490,28\n<br>// &quot;B, Inc&quot;,43,86,1408,457\n<br>// &quot;C, LLC&quot;,99,1093,12753,5397</pre><pre>// Specifically used let here<br>let csv = fs.readFileSync(&#39;./data/test.csv&#39;);</pre><pre>// Below, turn the CSV into an array of objects</pre><h3>[Frontend] Create a simple counter using React</h3><ul><li>This question requires you to use a IDE like <a href="https://coderpad.io/">CoderPad</a> that lets you upload files</li><li>The counter should be able to increase, and decrease. The initial starting number should be 0. The numbers can go negative.</li><li>For front-end interviews, I like candidates to build out simple things. It allows me to see how they think in terms of component architecture</li><li>If we have an hour or longer, I like the candidate to be able to interact with 3rd party data and making a simple API call — but most of the time I just ask for a simple counter</li><li>Because it’s a rather large task — I like to help or work alongside the candidate.</li><li>Extra — will the candidate take time to think about styling, UI/UX etc.</li></ul><pre>&lt;html&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot; /&gt;<br>    &lt;title&gt;Hello World&lt;/title&gt;<br>    &lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/react/16.2.0/umd/react.production.min.js">https://cdnjs.cloudflare.com/ajax/libs/react/16.2.0/umd/react.production.min.js</a>&quot;&gt;&lt;/script&gt;<br>    &lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.2.0/umd/react-dom.production.min.js">https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.2.0/umd/react-dom.production.min.js</a>&quot;&gt;&lt;/script&gt;<br>    &lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js">https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js</a>&quot;&gt;&lt;/script&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;div id=&quot;root&quot;&gt;&lt;/div&gt;<br>    &lt;script type=&quot;text/jsx&quot;&gt;<br>      <br>      class Home extends React.Component {<br>        render() {<br>          return (<br>            &lt;div className=&quot;home&quot;&gt;<br>              &lt;h1&gt;Hello world!&lt;/h1&gt;<br>            &lt;/div&gt;<br>          ) <br>        }<br>      }</pre><pre>      // Render component to the page<br>      ReactDOM.render(&lt;Home /&gt;, document.getElementById(&#39;root&#39;))      <br>    &lt;/script&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><h3>[Fullstack] Fibonacci Series</h3><ul><li>This question requires you to use a IDE like <a href="https://coderpad.io/">CoderPad</a> that lets you upload files</li><li>Usually I don’t like asking these types of questions, but this is the one I do like — see below.</li><li>I want to see if they know and can talk about recursion/big-O notation</li><li>My hope is that they spit out the simplest solution, and then we can talk about recursion, and as the series of numbers goes up — how it effects the time for calculation</li><li>Candidate may have been asked this previously. I don’t care. It probably means they’ve thought and at least know the solution and recursion.</li><li>As a junior candidate, I don’t mind that they solve this with a simple solution and exponential runtime</li><li>As a senior candidate, I expect you to be able to solve this for O(1), O(logN) and at the very least O(n).</li></ul><pre># Ruby</pre><pre>n = 7 <br>def fibonacci(n)<br>  # write code here<br>end</pre><pre>puts &quot;#{n}&#39;s fibonacci value is #{fibonacci(n)}&quot;</pre><pre># RSpec is available within this pad<br># Below, write a test that makes sure the value of the 7th fibonacci value is 13<br><br>RSpec.describe fibonacci do<br>  # write code here<br>end</pre><h3>[Fullstack] Find the largest 5 digit number in a sequence</h3><ul><li>This question requires you to use a IDE like <a href="https://coderpad.io/">CoderPad</a> that lets you upload files</li><li>Looking for good use of loops, sorting and potentially indexing.</li><li>As a junior candidate, I don’t mind that they solve this with a simple solution and exponential runtime</li></ul><pre># In the following 6 digit number: 283910<br>91 is the greatest sequence of 2 consecutive digits.</pre><pre># In the following 10 digit number: 1234567890 <br>67890 is the greatest sequence of 5 consecutive digits.</pre><pre># Complete the solution so that it returns the greatest sequence of five consecutive digits found within the number given. The number will be passed in as a string of only digits. It should return a five digit integer. The number passed may be as large as 1000 digits.</pre><pre># Write code below</pre><p>These are only a few examples of some of the questions I like to ask in a technical interview. I think for the most part they are pretty straight forward — the only one that may cause a little confusion is the ability to understand Fibonacci sequence. Some candidates may take a few minutes to understand what it that is if they have never heard of it, and that is completely fine.</p><p><strong>The whole purpose of the technical interview is to figure out if a candidate will be able to fulfill the demands of a role, and another chance to see if they will fit character/personality wise.</strong> So I like to draw up and select a question that best aligns with the position the candidate has applied for.</p><p>For technical interviews, <a href="https://coderpad.io/">CoderPad</a> makes it super easy to conduct live technical interviews. While other companies focus on making alternative products, at <a href="https://coderpad.io/">CoderPad</a> the focus is completely on the IDE. This makes it the best in the industry for both candidates and the companies hiring.</p><p>If you have your own questions that you’d like to share or have any questions about CoderPad, let me know! Shoot me an email at luke@coderpad.io</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d5fe0cfbd85" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/questions-for-a-live-technical-interview-what-questions-i-like-to-ask-and-why-7d5fe0cfbd85">Questions for a live technical interview — what questions I like to ask and why</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The process of the technical interview — A perspective from CTO’s, VP’s and Directors of…]]></title>
            <link>https://medium.com/dev-magazine/the-process-of-the-technical-interview-a-perspective-from-ctos-vp-s-and-directors-of-11fcdd729549?source=rss-9ab0be5baa1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/11fcdd729549</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[technical-interview]]></category>
            <dc:creator><![CDATA[Luke Duncan]]></dc:creator>
            <pubDate>Mon, 20 Apr 2020 14:03:19 GMT</pubDate>
            <atom:updated>2020-04-20T14:03:19.814Z</atom:updated>
            <content:encoded><![CDATA[<h3>The process of the technical interview — A perspective from CTO’s, VP’s and Directors of Engineering</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8bBgViRsTzvGeVJCBe8rQ.png" /></figure><p>As many of may have read in my <a href="https://medium.com/@luke_duncan/the-interviewing-process-for-a-software-engineer-and-tips-for-getting-a-new-job-while-in-lockdown-ad01dc9fb079">last post</a>, I started at CoderPad 3 weeks ago as a Developer Advocate. Since then, I’ve been connecting with former bosses, co-workers and other software engineers to gather thoughts and to better understand the realm of technical interviews. Most of the people I’ve been reaching out to in my network work at established technology companies in higher up roles. Think CTO’s, Director of Engineering, Lead Engineers, VP’s of Engineering and Senior Software Engineers.</p><p>I started reading back my notes on these calls and I’ve started to see a pattern in their technical interviewing process. Here are some key findings…</p><p><em>Side Note: Would you be interested in learning about the specific companies technical interviewing process OR do you want to highlight your companies technical interview process? If yes, shoot me a message luke@coderpad.io</em></p><h3>Engineering higher-ups like to use their hiring process as a recruiting tool</h3><p>I spoke with two former colleagues that now lead engineering teams at some companies you have definitely heard of, but aren’t Google and Facebook. An interesting point that came up in my conversations with them is that they use their hiring process as a way to attract the big talent.</p><p>They both told me that they are highly involved in the recruiting process. Not so much vetting resumes and finding talent, but they were definitely leading the “Introductory First Calls”. Not only was this a tactic to make the engineering talent feel special, but it also allowed them to figure out the motivations of the candidate and if it was worth even moving forward to the technical interview.</p><h3>Take-Home projects are the go to for smaller companies</h3><p>Almost every person I talked to in the past week told me they were doing take-home projects for their candidates, instead of live coding sessions. The main reason for them preferring Take-Home projects seemed to be the opportunity for candidates to work in a “real world” scenario and for the company to see “real world” output.</p><p>One specific Director of Engineering told me how they set up their Take-Home projects. They took a problem that the company had in the past, simplified it, and came up with an exercise that mimicked that problem. So not only are the candidates in a more relaxed environment, they are also working on problems the company may have faced in the past or are currently facing. It’s a win-win for both sides in my opinion.</p><p>Another reason was the time saving that comes with the take home, and engineers not having to spend 30 minutes to 1 hour on a live coding interview.</p><h3>Languages don’t matter during the technical interview</h3><p>Most engineering managers are looking for how you think, rather than specific language ins and outs. It was almost a consensus — that once you know one language, you can learn them all. They were more focused on the tangible outputs like how do they write actual code, and how are they solving a problem.</p><p>Specifically they were looking for maintainable code, are they breaking down code into individual functions, are they using object orientated design, is the code readable for others etc.</p><h3>Most technical interviews are the same for Juniors &amp; Seniors — but managers are looking for different things</h3><p>Like the subtitle reads above, companies are looking for different traits out of junior versus a more senior engineer.</p><p>In a junior engineer, it seemed they were looking more in the direction of soft skills, team compatibility and the basic knowledge of the languages and frameworks that the companies use.</p><p>In senior engineers, they are looking for high quality, good grasp of software design knowledge and high end communication that will eventually allow them to lead projects.</p><p>Every company is different and finds success using different methods (live coding vs. take homes for example). But I thought this would be good to share to show potential candidates what to look out for in the world of technical interviews.</p><p>Technical interviewing is difficult. Both for companies and for candidates. At CoderPad, we are always trying to bridge that gap and make things easier for both sides. If you have any questions about CoderPad, or if you are a company looking to set up technical interviews, please reach out — happy to talk!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11fcdd729549" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dev-magazine/the-process-of-the-technical-interview-a-perspective-from-ctos-vp-s-and-directors-of-11fcdd729549">The process of the technical interview — A perspective from CTO’s, VP’s and Directors of…</a> was originally published in <a href="https://medium.com/dev-magazine">dotdev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The interviewing process for a software engineer and tips for getting a new job while in lockdown]]></title>
            <link>https://medium.com/@luke_duncan/the-interviewing-process-for-a-software-engineer-and-tips-for-getting-a-new-job-while-in-lockdown-ad01dc9fb079?source=rss-9ab0be5baa1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad01dc9fb079</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Luke Duncan]]></dc:creator>
            <pubDate>Tue, 31 Mar 2020 02:44:13 GMT</pubDate>
            <atom:updated>2020-03-31T15:18:14.992Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*80CsJPNCx7q6CPMrxJt8VA.png" /></figure><p>After being laid off 52 days ago, I’m happy to announce that today I’m starting with CoderPad (<a href="https://www.coderpad.io/">https://www.coderpad.io</a>) as a Developer Advocate (working in a mixture of marketing, product and dev). I’m super excited to work with some really smart people and look forward to learning a bunch/working my butt off. Plus I get to help candidates and companies in the technical interviewing space :). Funnily enough, one of the companies I was interviewing with was using CoderPad so it was cool to look at it from the candidate side.</p><p>Being that we are in crazy times, I thought it’d be beneficial to talk a little bit about searching and finding a job (specifically software development/tech) in today’s market. I learnt a bunch over the last 5 weeks and want to give some tips to anyone out there hunting for a new position.</p><h4>Before I get into the tips, here is some data surrounding my job hunt:</h4><ul><li>Amount of applications: 53</li><li>Applications responded by company to get first interview: 18</li><li>Applications rejected: 12</li><li>Recruiters worked with: 7</li><li>Live coding interviews: 5</li><li>Code Projects worked on: 3</li><li>Amount of whiteboard interviews: 4</li><li>Got to final interview but did not get offer: 2</li><li>Job Offers: 3</li></ul><h4>I don’t want to give away the exact companies that I was interviewing with, but I can tell you in an abstract way -</h4><ul><li>One of the MAJOR banks</li><li>A place you’ve probably shopped online before</li><li>Construction software company</li><li>Oil &amp; gas data company</li><li>Major oil/gas company (not a super major but big)</li><li>Legal software company</li><li>Electricity power company</li><li>A cyber security company</li><li>Technology agencies</li><li>Marketing Firm</li></ul><h4>Positions applied for:</h4><p>Software Engineer, Senior Software Engineer, Software Developer, Front-End Developer, UI Developer, Product Manager, Project Manager, Developer Advocate, Implementation Engineer, Web Developer</p><h4>Some of the live coding challenges:</h4><ul><li>Fizz Buzz (I don’t know why a company would use this anymore ha)</li><li>Write a for loop that goes over the array in reverse order and create an array of arrays grouping the numbers that are the same e.g. [[1,1], [5,5,5], [2,2], [21, 21]]</li><li>Figure out if input is palindrome (numbers and strings)</li><li>Create a function to determine if a number is a power of two</li><li>Turn this CSV string into an array of Objects with the same keys and associated values</li></ul><h4>Some of the white-boarding questions:</h4><ul><li>From two arrays, find the numbers that AREN’T in either array</li><li>What efficiency is this algorithm? Explain how you would improve it or make it better (Big O Notation)</li><li>Given this method, how would you make it better?</li><li>Build an abstraction of a shopping cart</li><li>Show us how you would build out a car utilizing Object Orientated design</li><li>Describe one of your most recent projects you worked on</li><li>Build out a relational database for a vet showing appointments and anything else you might find applicable</li></ul><h4>The take home projects:</h4><ul><li>Build out a simple CRUD API in NodeJS</li><li>Build out UI components that use an external API to digest data and show in graph</li><li>In this codebase, make changes to a method so that it caters to what they were looking for</li></ul><p>Ok so now we have all that stuff out the way, here are some of the things I learned and hopefully some tips you can take with you or pass a long to someone you know who’s in the interview process:</p><h3>Use Glassdoor</h3><p>It’s a good way of finding out what salaries you would be looking at for a role, and if someone has gone through the interview process before, you can perhaps even get a good grasp of what technical questions they might ask. I did this for the major bank that I interviewed with. And I got asked a question that I had prepared for. Part of me says this is wrong, you know moral high ground. But then part of me thinks what’s wrong with being prepared with all the information out there?</p><h3>LinkedIn is pretty cool when you actually need it</h3><p>Some people give LinkedIn a bad rap. I’ve never been one to use LinkedIn actively while I’ve been working at other jobs. But having used it pretty extensively during this job search — there are a few things that make it great. First off, their job search functionality is amazing for searching by location and position. Second, the quick application feature makes it super easy to apply to a bunch of jobs. Most of those jobs don’t require a cover letter, and maybe an answer to a question or two — so it’s super easy to apply to 30 jobs in an hour if you really wanted. And lastly, the amount of traffic your profile can get is pretty insane. I had at least 3 to 4 recruiters per week contacting me about open opportunities they thought I’d be a fit for. Not all are, but it’s still a great thing to see.</p><h3>Recruiters are awesome!</h3><p>I had never worked with a recruiter before this because I had never had to. In the past, I’ve been hit up by hundreds (not joking) of recruiters asking if I was looking for a new role or saying that I’d be the perfect candidate for X role. I always just responded “no thanks”.</p><p>But I think the biggest help on my job search was using recruiters. They allow you to skip the line of the interview process at companies because you’ve already been “vetted”. And they are there to help you. Ultimately, if you get hired, they make money so it’s in their best interest to set you up for success. Being it’s their full-time job, they have a good grasp of the market, what positions you would be good for and help prep you for interviews. All this being said, I actually didn’t use a recruiter to get my role at CoderPad, but the other offers I had were because of recruiters.</p><h3>You need to practice leet code and technical interviews</h3><p>No matter what you do, technical interviews are always going to be nerve wracking. So prepare! Take a bunch of Leet Code — most companies ask easy to medium questions that I’ve experienced. And most likely, if you practice enough, you’ll be asked problems you’ve solved before. I think if you are applying at the FANG companies and high up engineering positions (director of engineering), that’s when the “hard” questions start being asked.</p><p>Also get familiar with some of the technical interview IDE’s. You’ll be taking live coding interviews a bunch. Try one like CoderPad ;) <a href="https://www.coderpad.io/">https://www.coderpad.io</a></p><p>I often find that leet code questions bear no similarities to the things you’ll be working on in your actual job. My mind thinks differently when trying to solve Leet Code questions versus the usual tasks I have as a software engineer. Preparing and practicing these questions makes the switch into thinking about these questions easier in my brain.</p><h3>Think of creative ways to stand out</h3><p>You are competing with hundreds of people for a job. Think of ways you can stand out in the job application. One way is to use Recruiters like I said before to skip the line, but what I found really successful was creating a page on my website specifically for a company and hiring manager.</p><p>I can show you one I made for CoderPad: <a href="https://www.lukeduncan.me/coderpad">https://www.lukeduncan.me/coderpad</a> — I haven’t asked if this helped but I can only imagine it doesn’t hurt. It shows you put time and effort into your application and it’s a good way of getting your foot in the door. I have had major success with this in the past as well. It turns you into a person rather than an application in my opinion.</p><p>I’ve now worked at two places where I used this method to get in the door for the first interview. Trust me it works.</p><h3>Get the buzzwords into your resume, and what you did with those buzzwords at prior jobs</h3><p>Recruiters and companies are looking for specific languages, but they are also looking for the type of things you’ve worked on in your prior experience. Be specific on what languages you used and what you accomplished with them. Here is one of the lines I have on my resume as an example:</p><p>“Built custom solutions and features for Ticketbud’s enterprise level clients that led to new revenue channels and retention of clients using technologies such as Ruby on Rails and Javascript”</p><p>Recruiters are looking for these buzzwords all over and it will get you a lot more opportunities by including them in your resume.</p><h3>Get feedback from final interviews</h3><p>I reached a few final interviews during this process and didn’t get an offer. It can be a real hit to the gut especially when you are just one round way from being hired. But to move forward and learn, I ended up asking for feedback about why I wasn’t selected or what they liked and what they didn’t like. Ultimately I ended up using the feedback from a few final interviews and took it into my other opportunities. It helps you grow as a developer, thinker and candidate!</p><p>A big problem that I had/have, I think of a solution in my head to a problem which fine. But when I start to describe my solution, other things that I maybe missed out in my solution start to pop in my head and I start to include them into my solution. So I start to add random bits into my answer and everything becomes less clear. I got this feedback from one of the first interviews I was rejected from and used it to catch myself when I was doing this at later interviews.</p><h3>Hit me up!</h3><p>And that’s that. If you have any questions about my interviews, have any other tips you’d like to share (I’ll add them to this article) or are interested using CoderPad in your interview process (perfect for hiring Remote in todays climate) — I’d love to talk! Email me at luke@coderpad.io</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad01dc9fb079" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hosting a static website on S3 with SSL]]></title>
            <link>https://medium.com/@luke_duncan/hosting-a-static-website-on-s3-with-ssl-1ed101e35316?source=rss-9ab0be5baa1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ed101e35316</guid>
            <category><![CDATA[cloudfront]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Luke Duncan]]></dc:creator>
            <pubDate>Thu, 28 Feb 2019 23:38:52 GMT</pubDate>
            <atom:updated>2019-02-28T23:44:34.592Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMmo49zNSZCpbKIu636dmA.jpeg" /></figure><h3>Hosting an HTTPS static website on S3 with help from Cloudfront</h3><p>Every year, I like to re-design my personal website (https://www.lukeduncan.me) to learn new things, update my work and refresh for the new year. For the better part of three years now I have hosted my site on AWS S3 where I simply update my DNS records for my domain to point to my public bucket URL. The site has been super easy to update, manage and overall it’s been great!</p><p>Now that the web is making a huge deal of SSL (which it should be), I decided my project for this new year would be to get SSL working alongside my personal domain and static website. Basically my website was <a href="http://www.lukeduncan.me/">http://www.lukeduncan.me</a> — And I want it to be <a href="https://www.lukeduncan.me/">https://www.lukeduncan.me</a>.</p><p>This article will cover the exact steps I took to get my site running and working with SSL.</p><p>For this tutorial we will be using:</p><ul><li>AWS S3</li><li>AWS Cloudfront</li><li>AWS Certificate Manager</li><li>Static website (I use Middleman (<a href="https://middlemanapp.com/">https://middlemanapp.com/</a>) to build my static websites)</li></ul><h4>1) Upload your website to AWS S3</h4><p>This first step could probably be a whole other article, but basically upload your website to an AWS S3 bucket. Hopefully you already have your website set up to host through S3 but if not, there are plenty of articles around the web showing you how to set that up with your domain.</p><p>David Walsh does a great job in his article here: <a href="https://davidwalsh.name/hosting-website-amazon-s3">https://davidwalsh.name/hosting-website-amazon-s3</a> (ignore the Surreal CMS stuff unless it interests you)</p><p>Some helpful hints:</p><ul><li>Make sure your S3 bucket is named after your website e.g. my bucket is called www.lukeduncan.me</li><li>Use a static site generator to make it easier to build your website and then utilize deployment gems e.g. I use this <a href="https://github.com/fredjean/middleman-s3_sync">https://github.com/fredjean/middleman-s3_sync</a> which allows me to quickly deploy changes from my middleman site to my s3 bucket</li><li>Make sure that the bucket itself is public</li></ul><h4>2) Generate the SSL certificate using AWS Certificate Manager</h4><p>To make this easier to follow, I’ll break everything from here on out into actionable steps that you should be following.</p><ul><li>Access Certificate Manager from your AWS console</li><li>Click on the “Request a certificate” button</li><li>Request a public certificate</li><li>Add your domain name e.g. mine was <a href="http://www.lukeduncan.me/">www.lukeduncan.me</a></li><li>Next your going to have to validate your certificate somehow to make sure AWS knows you own the domain. I went with the email validation because I have control of the emails that hit my domain, but you can easily do this using DNS records as well</li><li>Once you have done this, and confirmed the certificate, you are all good to go!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*dGKzTtjMFGmmX4BUx1G2Hw.png" /><figcaption>yay!</figcaption></figure><h4>3) Create a distribution via Cloudfront to host our website via HTTPS</h4><p>So now we’re going to get Cloudfront going alongside the certificate we just created.</p><ul><li>Your going to want to create a new distribution. Simply click on the “Create distribution” button to get started</li><li>Your going to have option between selecting between creating a distribution for web or rtmp. Select web</li><li>Next the first input will be Origin Domain Name. Click on that and it will give you a dropdown of S3 buckets that you have. Select your website bucket. In my case it would be: <a href="http://www.lukeduncan.me.s3.amazonaws.com/">www.lukeduncan.me.s3.amazonaws.com</a></li><li>The next option we are going to touch is called Viewer Protocol Policy. Some people choose to redirect HTTP to HTTPS. But I just use the HTTP and HTTPS option.</li><li>Under Alternate Domain Names, your going to want to put your website domain. e.g. in my case <a href="http://www.lukeduncan.me,/">www.lukeduncan.me</a> and lukeduncan.me — both of these.</li><li>Now we are going to select the SSL certificate we made earlier. Under SSL certificate section, select custom SSL certificate. And once the dropdown shows up, select your domain.</li><li>Under the default root object (which I think is already handled by S3) but just in case, add index.html or whatever your homepage is for your website.</li><li>And finally — click Create Distribution.</li><li>It will take 15 minutes for Amazon to distribute this and successfully deploy. Before we take the next step your distribution should look like this below (I removed ID and domain name just for sake of):</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zEJ9DvjZSiO95VKwiuASg.png" /></figure><h4>4) Connect your domain name to the Cloudfront distrubution using CNAME records</h4><p>Now if any of you have hosted an S3 bucket as your website before, you know you could just set your CNAME record as the bucket URL e.g. the one shown above — <a href="http://www.lukeduncan.me.s3.amazonaws.com/">www.lukeduncan.me.s3.amazonaws.com</a></p><p>But — in order for SSL to take effect, we need to use the Cloudfront distribution that is taking in the S3 contents and distributing it correctly. For my domains, I use Namecheap but this can be used for any domain host.</p><ul><li>Your going to need your domain name from the Cloudfront distribution. It will look something like this (d1shfic93mswn.cloudfront.net)</li><li>Create a new CNAME record under your domain</li><li>Make the host WWW, and the value the Cloudfront distribution domain name. I always like to set the TTL to automatic but that’s up to you</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*W3be4jwsJTZ0QkcY6s63Gw.png" /><figcaption>Heres my CNAME record in Namecheap for my distribution</figcaption></figure><p>And MOOLAH BABY.</p><p>You should be all set to go. Wait a few minutes before this is up and working but you should now be able to go to <a href="https://yourwebsite.com/">https://yourwebsite.com</a> and now you have SSL on your own static website!</p><p>Let me know if you have any questions by asking me on Twitter (@luke__duncan) or by emailing me luke.will.duncan@gmail.com</p><h4>BONUS CONTENT:</h4><p>Now some of you are going to run into problems where Cloudfront caches your files, images, stylesheets, javascript — basically everything on your website. So when you make changes and push new content to your S3 bucket, they aren’t going to be reflected on your website.</p><p>To push through your changes, your going to have to invalidate files from your Cloudfront distribution. Go to your distribution and then click on the tab “invalidations”. From there your going to input the file name that you want to invalidate that has new stuff in it.</p><p>E.g. in my case, if I wanted to invalidate the CSS file I would create an invalidation and add this line in it:</p><pre>/stylesheets/site.css<br>/stylesheets/*</pre><p>I like adding the * route just in case. And then when I click on create, it should take around 10 minutes for Cloudfront to invalidate that file, and go and get the new one from my S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*yRQsOpQa5UqfvAeNc9Skyw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ed101e35316" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uploading a CSV to AWS S3 in Rails to use in an email]]></title>
            <link>https://medium.com/dev-magazine/uploading-a-csv-to-aws-s3-in-rails-to-use-in-an-email-ac2dfe2ba7fc?source=rss-9ab0be5baa1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac2dfe2ba7fc</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Luke Duncan]]></dc:creator>
            <pubDate>Fri, 04 Jan 2019 21:32:03 GMT</pubDate>
            <atom:updated>2020-02-10T19:52:22.731Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMmo49zNSZCpbKIu636dmA.jpeg" /></figure><h3>Uploading a CSV to AWS S3 in Rails and using the file</h3><p>Recently we were dealing with an issue for a customer (we’ll call them customer X) that has been with us for several years. They have hundreds of thousands of records in our system and we are starting to deal with issues of scale.</p><p>For a typical customer that isn’t customer X, they could simply go to a dashboard we had created, click on a button and a CSV report downloads straight from the browser with a few hundred records. For customer X this simply wouldn’t work because the calculations in the backend took too long for the browser and often ended up timing out. It was a simple problem to solve with a background job which is exactly what we did a few years ago.</p><p>We implemented a background job to run the query and when ready would allow the user to download the report from an email we had sent them. It was a perfect solution for customer X until another problem arose. Here is the email method that was performed and put in a background job:</p><pre>def email_sales_report(email)<br>  <a href="http://twitter.com/report_by_ticket_typ">@report</a> = Reports::Sales.new(report_params)<br>  attachments[&#39;sales_report.csv&#39;] = <a href="http://twitter.com/report_by_ticket_typ">@report</a>.csv</pre><pre>  mail to: email, subject: &quot;Email Sales Report #{Time.now}&quot;<br>end</pre><h4>This looks fine and dandy right?</h4><p>We thought it did too until one day we started receiving errors about this email report not being able to be sent. After a few hours of digging and irrelevant error messages, we found out that the email server could not handle attachments of the size we were trying to use.</p><p>In order to make this report work again, we had to come up with a solution where we could host the CSV and link to it from the email. AWS S3 which most of you should know is “simple storage service” allowing you to store documents, files and more was the perfect solution.</p><p>Here are the basic steps we took to set this up in our Rails application:</p><h4>1. Adding AWS SDK to gemfile and bundle install</h4><p>Just for this tutorial, if you don’t already have AWS-SDK within your Rails repo, go ahead and add it and then bundle install.</p><pre>gem &#39;aws-sdk&#39;</pre><h4>2. Setting up initializer</h4><p>First we setup an initializer to get S3 working. We set this up like so in a file we created — /config/initializers/amazon_s3.rb</p><p>We set this as a global variable that could be accessed at any point in our rails application through AMAZON_S3_CLIENT</p><pre>AMAZON_S3_CLIENT = Aws::S3::Resource.new(region: &#39;us-west-1&#39;,<br>  access_key_id: &#39;XXXXXXXXXXXXXXX&#39;,<br>  secret_access_key: &#39;XXXXXXXXXXXXXXXXXXXXXXXXX&#39;<br>)</pre><h4>3. Creating Class Command to instantiate S3 Upload</h4><p>We utilize commands throughout our app (<a href="http://wiki.c2.com/?CommandPattern">http://wiki.c2.com/?CommandPattern</a>) that are put into background jobs like the one we have been talking about with the reports. We created another command for uploading our CSV’s to S3. This is how we set it up below in a file named commands/reports/upload_to_s3.rb:</p><pre>class Report::UploadToS3 &lt; Command::Base<br>  attribute :csv</pre><pre>action do<br>    self.set_aws_bucket<br>    obj = AMAZON_S3_CLIENT.bucket(@<a href="http://twitter.com/amazon_s3_bucket_pat">bucket_pat</a>h).object(&quot;#{Time.now}/report.csv&quot;)<br>    obj.put(body: csv, acl: &#39;public-read&#39;, content_disposition: &#39;attachment&#39;)</pre><pre>return obj.public_url<br>  end</pre><pre>def set_aws_bucket<br>    case Rails.env<br>    when &#39;production&#39; then<br>      <a href="http://twitter.com/amazon_s3_bucket_pat">@bucket_pat</a>h = &#39;csv&#39;<br>    when &#39;staging&#39; then<br>      <a href="http://twitter.com/amazon_s3_bucket_pat">@bucket_pat</a>h = &#39;staging.csv&#39;<br>    else<br>      <a href="http://twitter.com/amazon_s3_bucket_pat">@bucket_pat</a>h = &#39;dev.csv&#39;<br>    end<br>  end<br>end</pre><p>There are a few things I’d like to point out. Notice that we use a different bucket path depending on the environment that we are working on, we don’t want to mix and match csv uploads.</p><p>Next — you’ll see that Time.now is included in the string for saving the file name in S3. This will create a folder called “01/01/2019 18:00:00” for example and within that the actual file. This was just to show that you can create subfolders.</p><p><em>In our actual app we do some complex things to create folders for individual users so that each user has their own folder and we can save all the reports they have been downloading. You should be able to figure out ways to do this on your own but it is highly recommended you do so and in a secure manner not using any common identifiers like user_id and things of that nature.</em></p><p>And lastly, you’ll notice content_disposition: &#39;attachment&#39; is vitally important as it allows the CSV to be downloaded and acl: &#39;public-read&#39; is important too because it makes your CSV’s viewable for your customers. The URL for this file is returned using public_url instance method which can be seen here: <a href="https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Object.html#public_url-instance_method">https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Object.html#public_url-instance_method</a></p><h4>4. Invoking the command and retrieving the URL</h4><p>Now this is what our email_sales_report method looks like :)</p><pre>def email_sales_report(email)<br>  <a href="http://twitter.com/report_by_ticket_typ">@report</a> = Reports::Sales.new(report_params)<br>  <br>  <a href="http://twitter.com/s3_public_url">@s3_public_url</a> = Report::UploadToS3.new(csv: @report.csv).execute</pre><pre>mail to: email, subject: &quot;Email Sales Report #{Time.now}&quot;<br>end</pre><p>@s3_public_url can be used in the email template for this method like so:</p><pre>&lt;p&gt;Your all attendee ticket list is attached. Please click on the link below:&lt;/p&gt;</pre><pre>&lt;a href=&quot;#{<a href="http://twitter.com/s3_public_url">@s3_public_url</a>}&quot; download&gt;Download Report&lt;/a&gt;</pre><p>Now you can send a file as you want over any email server. This has helped us immensely not only send out large reports to our customers, but it has also helped us to see which customers are downloading reports and how frequently they are downloading them.</p><p>Hopefully this has helped you out and is easy to follow along. If you have any questions or need any help uploading files to S3 and using those files throughout your rails app — shoot me an email at luke.will.duncan@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac2dfe2ba7fc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dev-magazine/uploading-a-csv-to-aws-s3-in-rails-to-use-in-an-email-ac2dfe2ba7fc">Uploading a CSV to AWS S3 in Rails to use in an email</a> was originally published in <a href="https://medium.com/dev-magazine">dotdev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to scrape a PDF for keywords using Ruby]]></title>
            <link>https://medium.com/dev-magazine/how-to-scrape-a-pdf-for-keywords-using-ruby-a8ffa47c186e?source=rss-9ab0be5baa1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8ffa47c186e</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[bootstrapping]]></category>
            <category><![CDATA[recruiting]]></category>
            <dc:creator><![CDATA[Luke Duncan]]></dc:creator>
            <pubDate>Sun, 11 Jun 2017 02:06:44 GMT</pubDate>
            <atom:updated>2017-06-11T02:06:44.349Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*iGIijb5Q4WmaEp_Kuuf1Hg.png" /></figure><p>I recently started a company called <a href="https://www.jobcrate.io/">Jobcrate</a> in Austin, Texas. The goal of <a href="https://www.jobcrate.io/">Jobcrate</a> is to build a platform that makes it easy for talent to apply to hundreds of technology companies and startups, while offering those companies and startups an affordable way to source and recruit the best talent in the tech industry.</p><p>In order to do this we get the best talent <a href="https://www.jobcrate.io/candidate-application">signed up onto our platform</a> and we have to make it easy for companies to search through this talent. We strictly make talent apply using a .PDF version of their resume. As you may know, it’s pretty standard in today’s job market to apply to all jobs using a .PDF version of your resume.</p><p>Typically you’ll find .PDF’s are pretty hard to work with unless you have the original MS Word file, Photoshop file or whatever you originally wrote your .PDF file through. However at Jobcrate, we have to analyze every single application and resume that comes our way.</p><p>In order to do this, we “scrape” specific keywords, skills and talents using the pdf-reader gem (<a href="https://github.com/yob/pdf-reader">https://github.com/yob/pdf-reader</a>). Our platform is built on Rails (STILL THE BEST!) and here is a method in one of our models that parses each keyword.</p><pre>def add_keywords_to_profile(user)<br>  io = open(user.resume_pdf.to_s)<br>  reader = PDF::Reader.new(io)</pre><pre>  reader.pages.each do |page|<br>    string = page.text<br>    KeywordHelper.keywords.each do |word|<br>      if string.downcase.include?(word.downcase)<br>        user.keywords.push(word)<br>        user.save<br>      end<br>    end<br>  end<br>end</pre><p>Since this method itself could take a while to run and parse through every single word, we run this in our background jobs just so that there are no problems to the user.</p><p>In this method, we pass in the user object. We then grab the actual .PDF (we utilize Paperclip and store the .PDF in an s3 bucket). Once we have that instance of the resume, we go through each page (typically there is just one but you never know). We then turn the page into one LOONGGGG string. Internally, we have built out a rather large list of skills, talents and basic keywords. We turn this into an array and looks something like this:</p><p>[&#39;html&#39;, &#39;css&#39;, &#39;marketing, &#39;github&#39;, &#39;spanish&#39;, &#39;customer service, &#39;angular, &#39;react&#39;, &#39;rails&#39;, &#39;javascript&#39;, ...........]</p><p>In our user model, in Rails 5 and Postgres, we are now able to have an array field in our database. We simply have a keywords column where we can store the keywords we find in a resume into the array.</p><p>This now allows us to easily create a search feature for companies. Let’s say that a company needs to find an Angular developer that is looking for a job, a company can now easily search ‘Angular’ and find awesome engineers that have Angular experience. We have plenty of other features that helps companies find talent, but this is one of our core features.</p><p>And that’s it! If you have any questions, looking for a job in Austin, or simply want to chat — shoot me an email: luke@jobcrate.io</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8ffa47c186e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dev-magazine/how-to-scrape-a-pdf-for-keywords-using-ruby-a8ffa47c186e">How to scrape a PDF for keywords using Ruby</a> was originally published in <a href="https://medium.com/dev-magazine">dotdev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Freelancing will soon become the norm for software developers]]></title>
            <link>https://medium.com/@luke_duncan/freelancing-will-soon-become-the-norm-for-software-developers-abbd73757a50?source=rss-9ab0be5baa1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/abbd73757a50</guid>
            <category><![CDATA[freelancing]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Luke Duncan]]></dc:creator>
            <pubDate>Mon, 27 Mar 2017 19:46:18 GMT</pubDate>
            <atom:updated>2017-03-27T19:48:11.769Z</atom:updated>
            <content:encoded><![CDATA[<p>In my opinion, freelancing in software development will become the norm. Why? Because it provides an awesome opportunity for engineers to work and pick projects that they care about. When developers get to work on things they care about, they usually write better code, are more passionate in their overall work and usually get to work with like minded individuals who care about similar causes.</p><p>Many engineers today in my opinion end up working for companies that they aren’t passionate about. Although the code will be well written, most of the time, an engineer will sit at their desk from 9–5, do their work in a robot like way and be done with it (not all engineers are like this might I add, just in my opinion). If software developers become passionate about projects, the product or project usually evolves into something greater. Engineers themselves usually have beneficial ideas and can bring great talking points to the overall discussion which is what freelancing and open gigs will allow developers to do. Forgetting the downsides for some contractors and freelancers (keeping the pipeline full of jobs, paying for their own medical insurance, taxes etc), I think you could say that most people would enjoy working for themselves and working on things they are passionate about instead of the 9–5 they sit at everyday coding projects they don’t care about in the long run.</p><p>Toptal is an immense solution for companies looking to hire developers, and for developers looking to pick up freelance opportunities. A two sided marketplace means that developers can pick the projects they want to work on, and it also means companies will be able to hire talent that are passionate and care about their product. That is why I am highly excited to potentially join the network and the <a href="https://www.toptal.com/web">Toptal Web freelancers community</a>. It would provide me with a way of connecting with companies and causes I care about, projects where I can write code I am passionate about while still allowing me to earn money and live my life.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abbd73757a50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an AWS Lambda function that can be triggered on the client-side]]></title>
            <link>https://medium.com/dev-magazine/building-an-aws-lambda-function-that-can-be-triggered-on-the-client-side-b9c7d596a4fa?source=rss-9ab0be5baa1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9c7d596a4fa</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Luke Duncan]]></dc:creator>
            <pubDate>Fri, 27 Jan 2017 03:12:20 GMT</pubDate>
            <atom:updated>2017-01-27T13:22:34.661Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e0-7zofixb-L3ru1oQTxjA.png" /></figure><p>Recently I’ve had the need to subscribe users to an email list in Mailchimp, but my site is completely static and on S3 so i’ve really needed a way to do this without reliance on a server. In steps AWS Lambda…</p><p>If you’ve never heard of AWS Lambda platform, think of it as an ‘event-driven, serverless platform that runs code in response to events that is super cheap’. If that sentence means nothing to you, the easiest way I can explain it is a server or place where you can run code off of your main platform. Many developers build micro-services utilizing the serverless architecture. Here are just some basic examples I can think of:</p><ul><li>Recording user events on marketing apps like Mixpanel</li><li>Resizing user uploaded images</li><li>Creating backups of data on the fly</li></ul><p>Think of any scheduled tasks you may have running in your application, and you could probably move it on over to AWS Lambda (most of the time).</p><p>Now for some actual code. I’m going to walk you through how to set up a function for Lambda, zip it up and then call it from the client-side through your browser using AWS Cognito.</p><p>First we’ll go through the actual code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5075bacfb874e7e2110347705f562abb/href">https://medium.com/media/5075bacfb874e7e2110347705f562abb/href</a></iframe><p>The .env file is where we host our environment variables to use in our actual function file. In this case just our Mailchimp api key and our list id that we want to subscribe people too.</p><p>Below our .env file in our gist, is our main function file. You’ll see here, we are using node.js at run time but you can use Java, C# and a few more. We require our .env file at the top of index.js and process these by using process.env.API_KEY for example. We then require the Mailchimp API. To install the necessary modules from this, we want to npm install before we zip the file up. You’ll see the request we make to Mailchimp in the addToList function where we require an email address to run the function. This email address run in the function is submitted via a POST request to the specific Mailchimp URL with our process.env.LIST_ID .</p><p>The exports.handler is where the real magic happens for Lambda. This is the code that is run upon the trigger of the function. In our case, we want to get the email address that is submitted to the function and then run the addToList function we created earlier using the email that was submitted.</p><p>The next file is our package.json which specifies that dependencies and an easy to use script that ‘zips’ up our project to be submitted to Lambda. To run this script, all we have to do is input npm run zip and everything is ready to go for our function.</p><p>In Lambda, all we had to do was create a new function from a blank template, give it a name and upload the zip file when asked too.</p><p>Now the tough part…Initially I tried to create an API endpoint using AWS API Gateway but found multiple issues with CORS and a few HTTP 502 errors which the AWS team told me they were planning on fixing. I was left stuck for a while on how to trigger the function.</p><p>Then I found out about Cognito which AWS tries to make user logins much easier to handle from a development stand point. Cognito allows us to create credentials per-user and will anonymize the users so they don’t need to login and the most important part: it also allows us to hide our AWS access and secret keys.</p><p>To do this:</p><ul><li>Click on Cognito from the dashboard</li><li>Click “Create new identity pool” and then click “Federated Identities”</li><li>Write in your app name (we’ll need to remember this for later for IAM roles)</li><li>Enable access to unauthenticated identities</li><li>and your all good here!</li></ul><p>Now we have created the mechanism that will allow us to hide our credentials in user details.</p><p>We now have to set up some access controls in AWS through IAM so we can allow our Cognito setup to invoke and trigger the Lambda function.</p><ul><li>Go To IAM</li><li>Click Policies</li><li>Click Create Policy and then “Create Your Own Policy”</li><li>Name the policy something you’ll remember and paste this in…</li></ul><p>{ &quot;Version&quot;: &quot;2012-10-17&quot;, &quot;Statement&quot;: [ { &quot;Sid&quot;: &quot;Stmt1433365260000&quot;, &quot;Effect&quot;: &quot;Allow&quot;, &quot;Action&quot;: [ &quot;lambda:InvokeFunction&quot; ], &quot;Resource&quot;: [ &quot;FILL THIS IN WITH YOUR RESOURCE ID&quot; ] } ] }</p><p>Make sure you fill in the resource ID which can be found in your Lambda function and will look something like this:</p><p>`arn:aws:lambda:us-east-1:234567889:function:my-function-name`</p><p>Next we will want to attach this policy to a role in IAM.</p><ul><li>In IAM click on Roles and then on Cognito_&lt;whatever you called your Cognito application&gt;Unauth_Role</li><li>Click Attach Policy and add the policy you just created</li><li>Now, that allows an unauthorized Cognito user to execute your function.</li></ul><p>When you created your Lambda function you also created a Role. So, we’re going to edit that Role so our function knowns what it can execute.</p><ul><li>Click on Roles</li><li>Click on the Role that was created (it tells you in your Lambda config page). Mine was lambda_basic_execution.</li><li>Click Edit Policy on your inline policy and paste the below. It’s telling us that our function can be invoked directly.</li></ul><p>{ &quot;Version&quot;: &quot;2012-10-17&quot;, &quot;Statement&quot;: [ { &quot;Effect&quot;: &quot;Allow&quot;, &quot;Action&quot;: [ &quot;logs:*&quot; ], &quot;Resource&quot;: &quot;arn:aws:logs:*:*:*&quot; }, { &quot;Effect&quot;: &quot;Allow&quot;, &quot;Action&quot;: [ &quot;lambda:invokefunction&quot; ], &quot;Resource&quot;: &quot;arn:aws:lambda:*:*:*&quot; } ] }</p><p>Now we’re all done with the hard stuff. If you have any questions about this, or get stuck, leave a comment and i’ll help you troubleshoot.</p><p>Onto the client and browser!</p><p>Right now, all I want to do is create a function in my HTML page that will invoke the function. We can do this by including the AWS SDK and Cognito files in our application.</p><p>Here is the script tag for the cdn:</p><p><em>&lt;script src=”</em><a href="https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.7.28/aws-sdk.js"><em>https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.7.28/aws-sdk.js</em></a><em>&quot;&gt;&lt;/script&gt;</em></p><p>And you will need to download the Cognito file yourself (here is a gist with the file: <a href="https://gist.github.com/lukewduncan/6db9b29ab5e614ba40f49fbc363062f5">https://gist.github.com/lukewduncan/6db9b29ab5e614ba40f49fbc363062f5</a>)</p><p>As far as my function goes, here it is:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55381f708b2a815e57a65a609da2e76a/href">https://medium.com/media/55381f708b2a815e57a65a609da2e76a/href</a></iframe><p>Now we can use this function whenever we want on the client and it will submit the email that is provided to the function. Whether you choose an onclick or submit function, it will work for whatever need you have.</p><p>And that does it, you now have a running Lambda function that is triggered from the client/browser!</p><p>If you want the code for the Lambda function, check out my Github repo here: <a href="https://github.com/lukewduncan/mailchimp-subscribe-aws-lambda">https://github.com/lukewduncan/mailchimp-subscribe-aws-lambda</a></p><p>Fork it, submit some suggestions, clone it :)</p><p>If you have any questions or suggestions, i’m all ears! Email me at luke.will.duncan@gmail.com or hit me up on twitter @luke__duncan</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9c7d596a4fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dev-magazine/building-an-aws-lambda-function-that-can-be-triggered-on-the-client-side-b9c7d596a4fa">Building an AWS Lambda function that can be triggered on the client-side</a> was originally published in <a href="https://medium.com/dev-magazine">dotdev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build an audio player with HTML5 and the Progress element]]></title>
            <link>https://medium.com/dev-magazine/how-to-build-an-audio-player-with-html5-and-the-progress-element-487cbbbaebfc?source=rss-9ab0be5baa1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/487cbbbaebfc</guid>
            <category><![CDATA[html5]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Luke Duncan]]></dc:creator>
            <pubDate>Thu, 13 Oct 2016 16:01:04 GMT</pubDate>
            <atom:updated>2017-12-01T17:54:32.643Z</atom:updated>
            <content:encoded><![CDATA[<p>HTML5 introduces built-in media support with the audio tag, which makes it very easy to embed media straight into any HTML document with limited code. It comes with built in browser controls, if you specify and plays audio nice and effectively.</p><p>This is typically what it will look like in your browser (some may vary).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*mxPFTYyWn0iq3e2yHzazPg.png" /><figcaption>Standard HTML5 audio player</figcaption></figure><p>You might be thinking: “Well what if I wanted to style my own audio player with it’s own buttons and scroll bar?”</p><p>With the audio element, the progress element and a few buttons, you can build your own audio player in no time! The progress element is mainly used to track the completion of a task and can be manipulated easily with Javascript. In our case, it would be to keep track of the length of a song. And the great thing is, HTML5 and browser capabilities make it easy to grab song lengths, current time and more.</p><p>Here is the <a href="http://codepen.io/luke__duncan/pen/dpZVOr/">link to a working example</a> at Codepen of the custom styled audio player (see image below of what it looks like). If you’d like to play with the code, go for it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z5W2ivCA6zQwA38DRFCHEA.png" /><figcaption>PLEASE NOTE THIS IS ONLY AN IMAGEEEEE</figcaption></figure><p>And below is the code. Note that their are two separate functions. One that keeps track of the audio player actually playing audio (initPlayers function) and the other that is keeping track of the audio for the progress element (initProgressBar function). I tried to keep jQuery to a minimum but used it to actually call the function, sorry, i’m not sorry JS purists.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d8f342ee16e7176e0785a9e700323bc5/href">https://medium.com/media/d8f342ee16e7176e0785a9e700323bc5/href</a></iframe><p>If you have any questions or suggestions, i’m all ears! Email me at luke.will.duncan@gmail.com or hit me up on twitter @luke__duncan</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=487cbbbaebfc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dev-magazine/how-to-build-an-audio-player-with-html5-and-the-progress-element-487cbbbaebfc">How to build an audio player with HTML5 and the Progress element</a> was originally published in <a href="https://medium.com/dev-magazine">dotdev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use Contentful, Codeship and Middleman to build a ‘Static Website’ with a CMS hosted on…]]></title>
            <link>https://medium.com/dev-magazine/how-to-use-contentful-codeship-and-middleman-to-build-a-static-website-with-a-cms-hosted-on-f5cfb502b7f4?source=rss-9ab0be5baa1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5cfb502b7f4</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Luke Duncan]]></dc:creator>
            <pubDate>Mon, 30 May 2016 15:24:01 GMT</pubDate>
            <atom:updated>2016-06-02T00:11:53.882Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*p1lXAF-1YzTbRX7yqcFrzg.png" /><figcaption>How to make a static website, not so static!</figcaption></figure><h3>How to use Contentful, Codeship and Middleman to build a ‘Static Website’ with a CMS hosted on Amazon S3</h3><p>Middleman allows you to build static websites with modern day development tools. It gives you the opportunity to use templates, SCSS, gems and even local reloading on save. If you are code savvy, it is a great way to build marketing websites, blogs and even dev centers.</p><p>Lately I’ve been wanting to take Middleman into my professional work flow and use it for building websites for clients. The only problem is, most clients want to edit their content and it’s pretty difficult to do when a website is completely static.</p><p>Well I have come up with a workflow so you can build a full-scale website that has a CMS and updates when new content is entered. By using Middleman to generate my website, Contentful for my CMS and Codeship for my deployment &amp; builds, I can now create fully-editable ‘static’ websites for clients.</p><p>Hopefully you already have your Middleman project set up and hosted on S3, but if not checkout this article: <a href="http://khoapham.me/blog/sync-middleman-with-amazon-s3/">http://khoapham.me/blog/sync-middleman-with-amazon-s3/</a></p><p>Here are the steps to get your project all set up:</p><h3>1.</h3><p>Include the Middleman Contentful gem into your project, bundle install and sign up for Contentful. If you have never used Contentful before, it is a CMS API which you can basically make calls to pull data — pretty awesome.</p><pre>// Gemfile</pre><pre>gem &#39;middleman&#39;, &#39;~&gt; 3.4.1&#39;<br>gem &#39;middleman-livereload&#39;<br>gem &#39;middleman-s3_sync&#39;<br>gem &#39;contentful_middleman&#39;</pre><h3>2.</h3><p>Create a content type in Contentful (I called mine Projects). Once created, click the JSON preview and find the ‘Space’ ID. We are now going to set up Contentful Middleman to pull in our data. You will need to input your access token which can be found by clicking on API’s from the top nav menu, then clicking API keys on the left hand side.</p><pre>// config.rb</pre><pre>activate :contentful do |f|<br>  f.access_token = ‘ACCESS TOKEN PLACED HERE’<br>  f.space = { site: ‘13v3alztc4hd’} // this is the space ID<br>  f.rebuild_on_webhook = true<br>  f.content_types = {<br>  projects: ‘projects’<br> }<br>end</pre><h3>3.</h3><p>Go to Entries on Contentful, and include some content in your content type so that we can pull that data into the Middleman project.</p><h3>4.</h3><p>Type in the following command in your terminal:</p><pre>bundle exec middleman contentful</pre><p>You should now see a folder called ‘data’ in your project with a YML file within that will have all of your posts within that file. So your probably asking yourself, so I have to do this every time to pull in new data….well keep reading.</p><p>It will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SwawTy0bA1hH6IN4Ajd5aQ.png" /></figure><h3>5.</h3><p>In your HTML template file (I use ERB), you now have access to that data file so you can loop over your data. See the code below on how I looped over the projects I created:</p><pre>&lt;div class=”content”&gt;<br>  &lt;div class=”container”&gt;<br>    &lt;div class=”row”&gt;<br>      &lt;h1&gt;Projects&lt;/h1&gt;<br>        &lt;div class=”col-md-6 col-md-offset-3”&gt;<br>          &lt;% data.site.projects.each do |id, partner| %&gt;<br>            &lt;h2&gt;&lt;%= partner[“name”] %&gt;&lt;/h2&gt;<br>            &lt;p&gt;&lt;%= partner[“description”] %&gt;&lt;/p&gt;<br>          &lt;% end %&gt;<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Pretty straight forward right.</p><h3>6.</h3><p>Well now we are going to setup Codeship so that we can have a fully functional CMS that will update whenever the content is saved in Contentful, so that we don’t have to run our middleman contentful command every time. Go to Codeship.com and sign up for an account (I prefer to sign up with my Github account to make it easy).</p><h3>7.</h3><p>Make sure you push your project to Github so that Codeship can have access to it and select the repo for use in Codeship.</p><p>There are two sections we are going to worry about in Codeship. Test and Deployment.</p><p>In the Test section, under Setup commands, I use this:</p><pre># Use Ruby 2.2.0<br>rvm use 2.2.0<br># Install PNGOUT (used by middleman-imageoptim)<br>wget <a href="http://static.jonof.id.au/dl/kenutils/pngout-20130221-linux.tar.gz">http://static.jonof.id.au/dl/kenutils/pngout-20130221-linux.tar.gz</a><br>tar -xzf pngout-*-linux.tar.gz<br>mv pngout-*-linux/x86_64/pngout ~/bin<br># Install dependencies specified in Gemfile<br>bundle install</pre><p>For the deployment section, we are going to set up our s3_sync command so that Codeship will push our site live to our S3 bucket. Input our S3 command by selecting the custom script option and then inputting:</p><pre># Compile the project<br>bundle exec middleman contentful<br>bundle exec middleman build</pre><pre># Deploy site to S3 bucket<br>bundle exec middleman s3_sync</pre><p>One quick note, if you do not have your AWS access key and secret key set up in your project, you will have to input them in the Environment Variables section in Codeship so that it can be pushed up to the S3 bucket.</p><p>Now that Codeship is all set up, any time you make a commit to Github, Codeship will create a new build of your Middleman project and deploy to S3. But what about when I update my content in Contentful? Well onto the last step.</p><h3>8.</h3><p>Now, we are going to set up a webhook on Contentful so that it will trigger Codeship to create a ‘new’ build. Unfortunately you cannot trigger a ‘new’ build, but we can get Codeship to run a previous build which will run the `middleman contentful` command which is all we need.</p><p>Simply input this into the webhooks section in Contentful available from the settings dropdown menu.</p><pre><a href="https://codeship.com/api/v1/builds/15169776/restart.json?api_key=f636833007fa0134f07c0e11c5137ec3">https://codeship.com/api/v1/builds/#GRAB_BUILD_NUMBER_AND_PLACE_HERE/restart.json?api_key=</a>YOUR_CODESHIP_API_KEY</pre><h3><strong>9.</strong></h3><p>BOOM! You are all set and any time someone updates content in Contentful, Codeship will run a new Middleman build and update the content. Also anytime you push to Github it will do the same thing.</p><p>Keep in mind, Codeship is running a previous build (from the build ID you put in the webhook url), so if you have made any changes at all, CSS, Gemfile, Templates…it will revert to the old commit and push those old files up to S3 again. You will need to update your build number in the webhook URL above so that it works correctly. If you are planning on keeping the website the same style and layout, this works perfectly.</p><p>I was super pumped to get this working and hopefully you are too! Codeship is free for one site and Contentful also has a free account making this awesome. The best part is that you can host this all on S3 which as you probably know, is dirt cheap!</p><h4><strong>Thanks for reading!</strong></h4><p>Have any questions or want to chat? Shoot me an email: luke.will.duncan [at ] gmail.com</p><p>Follow me on Twitter: <a href="http://twitter.com/luke__duncan">@luke__duncan</a> or add me on Linkedin <a href="https://www.linkedin.com/in/lukewduncan">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5cfb502b7f4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dev-magazine/how-to-use-contentful-codeship-and-middleman-to-build-a-static-website-with-a-cms-hosted-on-f5cfb502b7f4">How to use Contentful, Codeship and Middleman to build a ‘Static Website’ with a CMS hosted on…</a> was originally published in <a href="https://medium.com/dev-magazine">dotdev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>