<?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 Joe Karlsson on Medium]]></title>
        <description><![CDATA[Stories by Joe Karlsson on Medium]]></description>
        <link>https://medium.com/@joekarlsson?source=rss-de3cfcb5f7c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VB04TVDcLgZWscWRlFKikQ.jpeg</url>
            <title>Stories by Joe Karlsson on Medium</title>
            <link>https://medium.com/@joekarlsson?source=rss-de3cfcb5f7c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 06:11:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joekarlsson/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Build A Spotify Player with React in 15 Minutes]]></title>
            <link>https://levelup.gitconnected.com/how-to-build-a-spotify-player-with-react-in-15-minutes-7e01991bc4b6?source=rss-de3cfcb5f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e01991bc4b6</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[spotify]]></category>
            <dc:creator><![CDATA[Joe Karlsson]]></dc:creator>
            <pubDate>Fri, 22 Mar 2019 22:29:26 GMT</pubDate>
            <atom:updated>2019-03-26T01:02:22.879Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Gentle Introduction to the Spotify Developer API</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*KGOTMV8KD120TApnijDauQ.png" /></figure><p>Have you ever wanted to add Spotify integration into your app or website? Adding personalized music to any application is super easy with the Spotify Developer API. Personally, I have been playing around the Spotify API with an IoT project I have been building in my free time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qIg_-BGURcZ3UkuXxfS6ig.jpeg" /><figcaption>My MagicMirror project with Spotify integration.</figcaption></figure><p>The Spotify API is easy to use and can be added to any application.</p><p>In this post, I am going to walk through how to access the Spotify Developer API in the browser using React. The goal is to be a starting point for frontend devs who want to get set up with Spotify API as quickly as possible. Together, we will be creating a Spotify Web player that displays information about your currently played music from Spotify. We will also demonstrate how to:</p><ul><li>Register an application with Spotify</li><li>Authenticate a user and get authorization to access user data</li><li>Retrieve the data from a Web API endpoint</li></ul><p>You can find all of the source code here:</p><p><a href="https://github.com/JoeKarlsson/react-spotify-player">JoeKarlsson/react-spotify-player</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*Hz5eVZX6IbrXvwb2qEUcRA.gif" /><figcaption>Our Spotify Web Player in Action</figcaption></figure><p>Note: This article will not be a deep dive into React, and it will require knowledge of the basics of JavaScript and React.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*m5UdqrCtEW7w83Bpfcv7xQ.gif" /><figcaption>Okay, now let’s jump in!</figcaption></figure><h3>Set Up Your Account</h3><p>To use the Web API, start by creating a Spotify user account (Premium or Free). To do that, simply sign up at <a href="http://www.spotify.com/">www.spotify.com</a>.</p><p>When you have a user account, go to the <a href="https://developer.spotify.com/dashboard">Dashboard</a> page at the Spotify Developer website and, if necessary, log in. Accept the latest <a href="https://developer.spotify.com/terms">Developer Terms of Service</a> to complete your account set up.</p><h3>Register Your Application</h3><p>Any application can request data from Spotify Web API endpoints and many endpoints are open and will return data <em>without</em> requiring registration. However, if your application seeks access to a user’s personal data (profile, playlists, etc.) it must be registered.</p><p>You can <a href="https://developer.spotify.com/documentation/general/guides/app-settings/#register-your-app">register your application</a>, even before you have created it.</p><p>Go to the <a href="https://developer.spotify.com/dashboard">Dashboard</a> page at the Spotify Developer website, and click on ‘My New App.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8TqczPy9qXktRPtwTsUZw.png" /></figure><p>Fill out the information for your new app using the form as a guide. Then click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mYgEks-YVy9-n1N5AjiGUw.png" /></figure><p>Click on Edit Settings to continue your app registration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vwwrjL8TM_Ityqs6M3sB8Q.png" /></figure><p>The most important thing is that you must put in a redirect URL. We are going to use the default URL of from the Create React App. Enter <a href="http://localhost:3000/">http://localhost:3000</a> in this field. This is the URL you want to be redirected to after a user has authenticated through Spotify.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tb4PLnsPM1MupL_dMgh1xA.png" /></figure><p>Click “Save” and be sure to write down the Client ID from your application. And congrats, you’ve just registered your application and now we are ready to jump into the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*DcKWZ0I6VQhemLfg4KGxHg.gif" /><figcaption>You did it!</figcaption></figure><h3>Setting Up The Code</h3><p>We are going to get started quickly by running <a href="https://github.com/facebook/create-react-app">Create React App</a>. You can do this by running the following commands in your terminal.</p><pre>npx create-react-app react-spotify-player<br>cd react-spotify-player<br>npm start</pre><p>Open up the project in your favorite text editor and then let’s get our app authenticated to Spotify so we can get that juicy data. There are many many ways to authenticate to Spotify, but we are going to use <a href="https://developer.spotify.com/documentation/general/guides/authorization-guide/#implicit-grant-flow">Implicit authorization</a>.</p><p><a href="https://developer.spotify.com/documentation/general/guides/authorization-guide/#implicit-grant-flow">Implicit grant flow</a> is for clients (Like ours) that are implemented entirely using JavaScript and running in the resource owner’s browser. Implicit Grant flow is carried out client-side and does not involve secret keys. The access tokens that are issued are short-lived and there are no refresh tokens to extend them when they expire.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oRSho09JSaDFuJ0bCOSj0g.png" /><figcaption>Source: <a href="https://developer.spotify.com/documentation/general/guides/authorization-guide/#implicit-grant-flow">https://developer.spotify.com/documentation/general/guides/authorization-guide/#implicit-grant-flow</a></figcaption></figure><p>We need to write some code that performs a couple of actions:</p><ol><li>We will redirect the user to the /authorize endpoint of the Accounts service:</li></ol><p>GET <a href="https://accounts.spotify.com/authorize">https://accounts.spotify.com/authorize</a></p><p>2. The user is asked to authorize access within the scopes. The Spotify Accounts service presents details of the <a href="https://developer.spotify.com/documentation/general/guides/authorization-guide/#list-of-scopes">scopes</a> for which access is being sought.</p><ul><li>If the user is not logged in, they are prompted to do so using their Spotify username and password.</li><li>When the user is logged in, they are asked to authorize access to the data sets defined in the scopes.</li></ul><p>3. The user is redirected back to your specified URI. After the user grants (or denies) access, the Spotify Accounts service redirects the user to the redirect_uri. In this example, the redirect address is: <a href="https://example.com/callback">https://example.com/callback</a></p><p>In App.js add the following code:</p><pre>import React, { Component } from &quot;react&quot;;<br>import hash from &quot;./hash&quot;;<br>import logo from &quot;./logo.svg&quot;;<br>import &quot;./App.css&quot;;</pre><pre>export const authEndpoint = &#39;https://accounts.spotify.com/authorize&#39;;</pre><pre>// Replace with your app&#39;s client ID, redirect URI and desired scopes<br>const clientId = &quot;YOUR_CLIENT_ID_GOES_HERE&quot;;<br>const redirectUri = &quot;http://localhost:3000&quot;;<br>const scopes = [<br>  &quot;user-read-currently-playing&quot;,<br>  &quot;user-read-playback-state&quot;,<br>];</pre><pre>// Get the hash of the url<br>const hash = window.location.hash<br>  .substring(1)<br>  .split(&quot;&amp;&quot;)<br>  .reduce(function(initial, item) {<br>    if (item) {<br>      var parts = item.split(&quot;=&quot;);<br>      initial[parts[0]] = decodeURIComponent(parts[1]);<br>    }<br>    return initial;<br>  }, {});</pre><pre>window.location.hash = &quot;&quot;;</pre><pre>class App extends Component {<br>  componentDidMount() {<br>    // Set token<br>    let _token = hash.access_token;<br>    if (_token) {<br>      // Set token<br>      <em>this</em>.setState({<br>        token: _token<br>      });<br>    }<br>  }</pre><pre>render() {<br>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>      &lt;header className=&quot;App-header&quot;&gt;<br>      &lt;img src={logo} className=&quot;App-logo&quot; alt=&quot;logo&quot; /&gt;<br>      {!<em>this</em>.state.token &amp;&amp; (<br>        &lt;a<br>          className=&quot;btn btn--loginApp-link&quot;<br>          href={`${authEndpoint}client_id=${clientId}&amp;redirect_uri=${redirectUri}&amp;scope=${scopes.join(&quot;%20&quot;)}&amp;response_type=token&amp;show_dialog=true`}<br>        &gt;<br>          Login to Spotify<br>        &lt;/a&gt;<br>      )}<br>      {<em>this</em>.state.token &amp;&amp; (<br>        // Spotify Player Will Go Here In the Next Step<br>      )}<br>      &lt;/header&gt;<br>    &lt;/div&gt;<br>  );<br>  }</pre><pre>}</pre><pre>export default App;</pre><p>This code snippet creates a “Login With Spotify” button that redirects the user to authenticate with Spotify, we can obtain an Auth token that we will then use to make a request to the Spotify API.</p><p>Now, let’s add a function that will call the Spotify API and return the data. You will need to add the additional info.</p><pre>import * as $ from &quot;jquery&quot;;<br>import Player from &quot;./Player&quot;;</pre><pre>class App extends Component {<br>  constructor() {<br>    <em>super</em>();<br>    <em>this</em>.state = {<br>      token: null,<br>    item: {<br>      album: {<br>        images: [{ url: &quot;&quot; }]<br>      },<br>      name: &quot;&quot;,<br>      artists: [{ name: &quot;&quot; }],<br>      duration_ms:0,<br>    },<br>    is_playing: &quot;Paused&quot;,<br>    progress_ms: 0<br>  };</pre><pre>  <em>this</em>.getCurrentlyPlaying = <em>this</em>.getCurrentlyPlaying.bind(<em>this</em>);<br>  }</pre><pre>  getCurrentlyPlaying(token) {<br>    // Make a call using the token<br>    $.ajax({<br>      url: &quot;https://api.spotify.com/v1/me/player&quot;,<br>      type: &quot;GET&quot;,<br>      beforeSend: (xhr) =&gt; {<br>        xhr.setRequestHeader(&quot;Authorization&quot;, &quot;Bearer &quot; + token);<br>      },<br>      success: (data) =&gt; {<br>        <em>this</em>.setState({<br>          item: data.item,<br>          is_playing: data.is_playing,<br>          progress_ms: data.progress_ms,<br>        });<br>      }<br>    });<br>  }</pre><pre>  ...</pre><pre>}</pre><p>Then, of course, we need to make the actual player. We will first need to create a new Player component called Player.js .</p><pre>import React from &quot;react&quot;;<br>import &quot;./Player.css&quot;;</pre><pre>const Player = props =&gt; {<br>  const backgroundStyles = {<br>    backgroundImage:`url(https://medium.com/$%7Bprops.item.album.images[0].url%7D)`,<br>  };<br>  <br>  const progressBarStyles = {<br>    width: (props.progress_ms * 100 / props.item.duration_ms) + &#39;%&#39;<br>  };<br>  <br>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>      &lt;div className=&quot;main-wrapper&quot;&gt;<br>        &lt;div className=&quot;now-playing__img&quot;&gt;<br>          &lt;img src={props.item.album.images[0].url} /&gt;<br>        &lt;/div&gt;<br>        &lt;div className=&quot;now-playing__side&quot;&gt;<br>          &lt;div className=&quot;now-playing__name&quot;&gt;{props.item.name}&lt;/div&gt;<br>          &lt;div className=&quot;now-playing__artist&quot;&gt;<br>            {props.item.artists[0].name}<br>          &lt;/div&gt;<br>          &lt;div className=&quot;now-playing__status&quot;&gt;<br>            {props.is_playing ? &quot;Playing&quot; : &quot;Paused&quot;}<br>          &lt;/div&gt;<br>          &lt;div className=&quot;progress&quot;&gt;<br>            &lt;div<br>              className=&quot;progress__bar&quot;<br>              style={progressBarStyles}<br>            /&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>        &lt;div className=&quot;background&quot; style={backgroundStyles} /&gt;{&quot; &quot;}<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><pre>export default Player;</pre><p>Here’s the CSS for Player.css .</p><pre>/** Now Playing **/<br>.now-playing__name {<br>  font-size: 1.5em;<br>  margin-bottom: 0.2em;<br>}</pre><pre>.now-playing__artist {<br>  margin-bottom: 1em;<br>}</pre><pre>.now-playing__status {<br>  margin-bottom: 1em;<br>}</pre><pre>.now-playing__img {<br>  float: left;<br>  margin-right: 10px;<br>  text-align: right;<br>  width: 45%;<br>}</pre><pre>.now-playing__img img {<br>  max-width: 80vmin;<br>  width: 100%;<br>}</pre><pre>.now-playing__side {<br>  margin-left: 5%;<br>  width: 45%;<br>}</pre><pre>/** Progress **/<br>.progress {<br>  border: 1px solid #eee;<br>  height: 6px;<br>  border-radius: 3px;<br>  overflow: hidden;<br>}</pre><pre>.progress__bar {<br>  background-color: #eee;<br>  height: 4px;<br>}</pre><p>Then in your App.js you will need to pass in the data from Spotify to your Player component.</p><pre>class App extends Component {</pre><pre>...</pre><pre>  render() {<br>    return (</pre><pre>      ...</pre><pre>      {<em>this</em>.state.token &amp;&amp; (<br>        &lt;Player<br>          item={<em>this</em>.state.item}<br>          is_playing={<em>this</em>.state.is_playing}<br>          progress_ms={<em>this</em>.progress_ms}<br>        /&gt;<br>      )}<br>     &lt;/header&gt;<br>   &lt;/div&gt;<br>  );<br> }<br>}</pre><p>And that’s all the code you’ll need. By this stepx, your app should look and work like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*Hz5eVZX6IbrXvwb2qEUcRA.gif" /></figure><p>And that’s it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*OTlBtshwFr_J4WfPfp6B1w.gif" /><figcaption>You did it!</figcaption></figure><p>If you have any questions or comments, feel free to reach out or <a href="https://github.com/JoeKarlsson/react-spotify-player/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc">open an issue in the repo</a>.</p><blockquote>You can find the source code for this tutorial here: <a href="https://github.com/JoeKarlsson/react-spotify-player">https://github.com/JoeKarlsson/react-spotify-player</a></blockquote><p>My name is Joe Karlsson, and I am a Software Engineer from the frozen tundra known as Minneapolis, Minnesota. I write code, build teams and give talks. You can follow me on:</p><ul><li><a href="https://twitter.com/JoeKarlsson1">Twitter</a></li><li><a href="https://github.com/JoeKarlsson">GitHub</a></li><li><a href="https://www.linkedin.com/in/joekarlsson/">LinkedIn</a></li><li><a href="https://www.instagram.com/joekarlsson/">Instagram</a></li><li><a href="https://www.joekarlsson.com/">Website</a></li></ul><figure><a href="https://levelup.gitconnected.com/"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E6CoI_MRyZ1JInNPsBSHtA.png" /></a></figure><p><a href="https://gitconnected.com/learn/react">Learn React - Best React Tutorials (2019) | gitconnected</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e01991bc4b6" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/how-to-build-a-spotify-player-with-react-in-15-minutes-7e01991bc4b6">How to Build A Spotify Player with React in 15 Minutes</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Tech Talks That Have Had The Biggest Impact On My Career]]></title>
            <link>https://medium.com/@joekarlsson/the-tech-talks-that-have-had-the-biggest-impact-on-my-career-5de33c25e45?source=rss-de3cfcb5f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5de33c25e45</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[best-of]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tech-talk]]></category>
            <dc:creator><![CDATA[Joe Karlsson]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 05:07:15 GMT</pubDate>
            <atom:updated>2019-04-02T16:49:27.627Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*aQFJO7rAL_20abJeKPviYw.png" /></figure><p>It’s not that often that I go to a conference or watch a talk on YouTube that truly changes the way I think about programming or software development. Even though I’m someone who does frontend development for a living, most of the talks that were most illuminating for me are talks that are either language-agnostic or unrelated to my daily work. These are the tech talks that have had the biggest impact on my career and my life.</p><p>I find good tech talks to be a combo of entertainment and broadening my toolbox of programming concepts. When I hit good talk I generally do a double take, “what, I have not thought that way before.” There are definitely some good talks on this list.</p><p>Here are a few of the best talks I’ve ever seen on programming or the field of technology. If you have an amazing one you think I’m missing, feel free to tweet it to me <a href="https://twitter.com/JoeKarlsson1">@JoeKarlsson1</a>.</p><h3>The Myth of the Genius Programmer [Google I/O 2009]</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0SARbwvhupQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0SARbwvhupQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0SARbwvhupQ%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e4809db56e284aa87a4328130577fc32/href">https://medium.com/media/e4809db56e284aa87a4328130577fc32/href</a></iframe><p><em>By Brian Fitzpatrick and Ben Collins-Sussman</em></p><p>In the technology industry, a pervasive elitism hovers in the background of collaborative software development: everyone secretly wants to be seen as a genius. In this talk, Brian and Ben discuss how to avoid this trap and gracefully exchange personal ego for personal growth and super-charged collaboration.</p><p>Listening to this talk, especially coming from people who work at Google, made me feel much better about my work and my abilities. We programmers are also human and we will make mistakes, the best thing we can do is try not to repeat them.</p><p>Also, the synergy between these two speakers is amazing. They tag team each other brilliantly.</p><h3>The Impermanence of Software [RubyConf 2017]</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fl2WgVr1rv3c%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dl2WgVr1rv3c&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fl2WgVr1rv3c%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/191d4880807958e0e970b016b52fd867/href">https://medium.com/media/191d4880807958e0e970b016b52fd867/href</a></iframe><p><em>By Andy Croll</em></p><p>This is a talk that I think about often and is one that I aspire to create someday. I love how Andy Croll is able to put our jobs into perspective and he helps me to remember that the work we do has a short shelf life, and so do we as human beings. This is a wonderful talk to watch to remember that Software Engineering isn’t the most important thing in the universe.</p><h3>Build Impossible Programs [Deconstruct 2018]</h3><p><em>By Julia Evans </em><a href="https://twitter.com/b0rk"><em>@b0rk</em></a></p><p>This talk is a squishier talk about the myths Julia believed about doing ambitious work and how a lot of those myths turn out not to be true. It’s also an inspiring talk that has helped push me to take on projects that I thought would be too large or too scary to take on.</p><p>As a related side note, you should check out Julia Evan’s wonderful zines. You can check those out here: <a href="https://wizardzines.com/">https://wizardzines.com/</a></p><p><a href="https://jvns.ca/blog/2018/09/18/build-impossible-programs/">Build impossible programs - Julia Evans</a></p><h3>Simple Made Easy</h3><p><em>By Rich Hickey</em></p><p><a href="https://www.infoq.com/presentations/Simple-Made-Easy">Simple Made Easy</a></p><p>One of my biggest code crushes, Rich Hickey, emphasizes simplicity’s virtues over easiness’. In this talk, he shows that while many choose easiness when programming, they may end up with greater complexity. He explains how the better way forward is to choose easiness along the simplicity path.</p><p>This talk has been foundational in my architecture and code cleanliness values.</p><h3>wat [CodeMash 2012]</h3><p><em>by Gary Bernhardt</em></p><p>A true JavaScript classic. When I taught JavaScript at a coding bootcamp in Hawaii, I would show this to all of my students at the start. I think it does a great job of showing how the community rallies around JavaScript. It’s a weird and unpredictable language, but we all love it in spite of it peculiar quirks. This is a must watch if you have ever used, want to use or have heard of JavaScript/</p><p><a href="https://www.destroyallsoftware.com/talks/wat">https://www.destroyallsoftware.com/talks/wat</a></p><h3>If Coco Chanel Reviewed Elm [Elm Conf 2017]</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWiw3YcwGwrU%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWiw3YcwGwrU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWiw3YcwGwrU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/70f0149e9dd45af01ae857834a6343d0/href">https://medium.com/media/70f0149e9dd45af01ae857834a6343d0/href</a></iframe><p><em>By Tereza Sokol</em></p><p>I remember that the first time I watched this video, I thought to myself, “What the hell is this?” But damn, this is a great tech talk. I love the structure of the talk, plus I learned about a lot about the fashion industry and language design. Thanks Tereza for putting this talk together.</p><h3>You and Your Research [1995]</h3><p><em>By Richard W. Hamming</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fa1zDuOPkMSw&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1zDuOPkMSw&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2Fa1zDuOPkMSw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/70791d910c2b5748671fad34eec86b8c/href">https://medium.com/media/70791d910c2b5748671fad34eec86b8c/href</a></iframe><p>This talk was intended to instill a “style of thinking” that will enhance your ability to function as a problem solver of complex technical issues as an engineer.</p><p>Most importantly though, Hammon provides a first person perspective about the thought processes and reasoning that took place as Dr. Hamming, his associates and other major thinkers, in computer science and electronics, progressed through the grand challenges of science and engineering in the twentieth century.</p><h3>Getting Comfortable Being Uncomfortable [AngularConnect 2015]</h3><p><em>By Aimee Knight</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FB22o_yeDE_s%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DB22o_yeDE_s&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FB22o_yeDE_s%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3b64de8da82a9553a21b974879496ff/href">https://medium.com/media/c3b64de8da82a9553a21b974879496ff/href</a></iframe><p>As software engineers, we all need to be pushed out of our comfort zones every once in a while in order for us to remain relevant and up to date. Aimee does a great job of reminding us to try new things in a friendly and non-judgmental way.</p><p>Aimee also conveys the feelings and perspectives of a junior engineer so eloquently. Every time I bring a new junior engineer onto my team, I watch this video to get practical tips and to gain greater empathy for my new team members.</p><h3>Programming Well with Others: Social Skills for Geeks [Google I/O 2011]</h3><p><em>By Brian Fitzpatrick and Ben Collins-Sussman</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fq-7l8cnpI4k%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dq-7l8cnpI4k&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fq-7l8cnpI4k%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2152d0f67e2feeabd55f61eb491d94c7/href">https://medium.com/media/2152d0f67e2feeabd55f61eb491d94c7/href</a></iframe><p>When I first started programming, I sincerely believed in the myth of the genius lone programmer. It really wasn’t until I watched this talk until I understood that programming was about teamwork. It really changed my opinion and career focus on improving my social and communication skills.</p><h3>Honorable Mentions:</h3><p>These are a collection of videos that I really like and I think you will too 😉</p><h3>Inventing on Principle</h3><p><em>By Bret Victor</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPUv66718DII%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPUv66718DII&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FPUv66718DII%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b270379d0807a7b43d53d2bc295008bc/href">https://medium.com/media/b270379d0807a7b43d53d2bc295008bc/href</a></iframe><h3>Linus Torvalds on git</h3><p><em>By Linus Torvalds</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4XpnKHJAok8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4XpnKHJAok8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4XpnKHJAok8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e2ecf029f88fc59583ed83ff6b29b7e/href">https://medium.com/media/3e2ecf029f88fc59583ed83ff6b29b7e/href</a></iframe><h3>What We Actually Know About Software Development, and Why We Believe It’s True</h3><p><em>By Greg Wilson</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F9270320%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F9270320&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F45468186_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1280" height="720" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ad453ebc14aeb08b597fe3a1b779f17/href">https://medium.com/media/9ad453ebc14aeb08b597fe3a1b779f17/href</a></iframe><h3>Making Impossible States Impossible</h3><p><em>By Richard Feldman</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FIcgmSRJHu_8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIcgmSRJHu_8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FIcgmSRJHu_8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6213d99c66a1dc824636f5976a09b03/href">https://medium.com/media/c6213d99c66a1dc824636f5976a09b03/href</a></iframe><h3>Virtual Machines, JavaScript and Assembler [Fluent 2014]</h3><p><em>By Scott Hanselman</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUzyoT4DziQ4%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUzyoT4DziQ4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUzyoT4DziQ4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/071452c5ff13417bd1d9a73064dcac15/href">https://medium.com/media/071452c5ff13417bd1d9a73064dcac15/href</a></iframe><h3>Lecture Time Management</h3><p><em>By Randy Pausch</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3tim1sjY7q8%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3tim1sjY7q8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3tim1sjY7q8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea6c8ae762d78d61e0038e9aeb76d559/href">https://medium.com/media/ea6c8ae762d78d61e0038e9aeb76d559/href</a></iframe><h3>CS75 (Summer 2012) Lecture 9 Scalability Harvard Web Development</h3><p><em>By David Malan</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-W9F__D3oY4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-W9F__D3oY4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-W9F__D3oY4%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/14ce8c0f94f7d5bf2be8a1b8e1c9af37/href">https://medium.com/media/14ce8c0f94f7d5bf2be8a1b8e1c9af37/href</a></iframe><h3>Hammock Driven Development</h3><p><em>By Rich Hickey</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Ff84n5oFoZBc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Df84n5oFoZBc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Ff84n5oFoZBc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/803949d3e78f263d550bbe47cbd71498/href">https://medium.com/media/803949d3e78f263d550bbe47cbd71498/href</a></iframe><h3>The Birth &amp; Death of JavaScript [PyCon 2014]</h3><p><em>By Gary Bernhardt</em></p><p><a href="https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript">The Birth &amp; Death of JavaScript</a></p><p><em>Originally published at </em><a href="https://www.joekarlsson.com/2019/01/the-tech-talks-that-have-had-the-biggest-impact-on-my-career/"><em>www.joekarlsson.com</em></a><em> on January 8, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5de33c25e45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Gentle Introduction to Setting Up a MongoDB Stitch App from Scratch in 10 Minutes]]></title>
            <link>https://medium.com/@joekarlsson/a-gentle-introduction-to-setting-up-a-mongodb-stitch-app-from-scratch-in-10-minutes-4d51764e6b85?source=rss-de3cfcb5f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d51764e6b85</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Joe Karlsson]]></dc:creator>
            <pubDate>Fri, 28 Dec 2018 23:09:49 GMT</pubDate>
            <atom:updated>2019-04-02T00:41:56.062Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Gentle Introduction To Setting Up A React and MongoDB Stitch App From Scratch In 10 Minutes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*n2TS-yUR3jDunyhCkQVZMA.png" /></figure><p>Are you interested in learning how to use the MongoDB Stitch serverless platform? Like many of you, I have been interested in learning more about MongoDB’s cloud offerings while simultaneously not spending a dime. This guide is for the developer who only has 10 minutes to spare and who wants to learn a brand new tool from MongoDB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*zIzh9CW5C3QCpRetsbKgxg.gif" /><figcaption>If this is your reaction, then this is the tutorial for you!</figcaption></figure><p>Okay, first of all, what is MongoDB Stitch? Well…</p><blockquote><a href="https://docs.mongodb.com/stitch/"><em>MongoDB Stitch</em></a><em> is a cross-platform application on top of MongoDB. Stitch removes the need for tedious boilerplate when setting up a new app and automatically manages your app’s backend so you can focus on building what matters.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*ttg9ZoWbDPCV74ESDvmOHw.gif" /><figcaption>Stitch sounds awesome, right?</figcaption></figure><p>Now that we have got that out of the way, let’s see if we can set up a new app in record time. For this tutorial, we will be setting up a todo app.</p><blockquote><em>Not</em>e: This tutorial does not touch all of the features of Stitch, it is intended to be a quickest possible way to explore the platform.</blockquote><blockquote>You can find the source code for this tutorial here: <a href="https://github.com/JoeKarlsson/mongodb-stitch-todo-tutorial">https://github.com/JoeKarlsson/mongodb-stitch-todo-tutorial</a></blockquote><ul><li>First things first, you will need to set up a <a href="https://www.mongodb.com/cloud/atlas?jmp=docs">MongoDB Atlas account</a>.</li></ul><blockquote>For additional information on setting up an Atlas account, check out the <a href="https://docs.atlas.mongodb.com/getting-started/#a-create-an-service-user-account">MongoDB Atlas Creating an Atlas User Account guide</a>.</blockquote><ul><li>You will also need to set up a MongoDB cluster hosted on Atlas.</li></ul><blockquote>You can create an M0 Atlas cluster for free. No credit card is required to get started.<br>To get up and running with a <strong>free</strong> M0 cluster, follow the <a href="http://docs.atlas.mongodb.com/getting-started">MongoDB Atlas Getting Started guide</a>.</blockquote><ul><li>Once you have initialized your new Atlas account and set up your free Atlas cluster, you will have to create a new Stitch Application.</li><li>First of all, make sure you are <a href="https://www.mongodb.com/cloud/atlas">logged into MongoDb Atlas</a>.</li><li>Click <strong>Stitch Apps</strong> in the left-hand navigation of the MongoDB Atlas console.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eiuS-UB08oHnOgB3TWbzPg.png" /></figure><ul><li>Click <strong>Create New Application</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k74T_D89AdAMvi1pvGdQvA.png" /></figure><ul><li>Give the application a name (e.g. <strong>TodoTutorial</strong>) and click <strong>Create</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QZJMPVW-p9VfYKI52vdx5g.png" /></figure><ul><li>Wait for your application to initialize. Upon creation of your app, you will be redirected to the Stitch UI.</li><li>Once, your app has been initialized, you will need to turn on <a href="https://docs.mongodb.com/stitch/authentication/anonymous/">Anonymous Authentication</a>.</li></ul><blockquote>Note: MongoDB and Atlas come secure by default, this is why we need to do this step.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ydE3aIhH9ZRJdtJ7UGtgTw.gif" /><figcaption>MFW I authenticate to our todo app.</figcaption></figure><ul><li>From the <strong>Getting Started</strong> page of the Stitch UI, enable <strong>Anonymous Authentication</strong> under the <strong>Turn On Authentication</strong> heading.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sAZhA2gZguBHloJQG5x7aA.png" /><figcaption>Turn on Anonymous Authentication</figcaption></figure><ul><li>Next, we will need to configure <a href="https://docs.mongodb.com/stitch/mongodb/mongodb-rules/">rules</a> for the todo collection before Stitch will allow users to query it. To configure the collection:</li></ul><ol><li>Click <strong>Rules</strong> under <strong>MongoDB Atlas</strong> in the left-hand navigation of the Stitch UI.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZ6jXYhaTsxkyO2oQfeaVw.png" /></figure><ol><li>Click <strong>Add Collection</strong>.</li><li>Enter todos for the <strong>Database Name</strong>. Enter item for the <strong>Collection Name </strong>and Select <strong>No Template.</strong> Then click <strong>Add Collection</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vgZ-OI69Q7IqPRLS4yB5Gg.png" /></figure><ul><li>You should now see the <strong>Permissions</strong> tab of the rules for the item collection. The default role doesn’t allow any user to read or write to the collection.</li><li>To enable reading and writing to the comments collection:</li></ul><ol><li>Click the <strong>Read</strong> and <strong>Write</strong> check boxes for the <strong>default</strong> role.</li><li>Click <strong>Save</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HvsC4xkKircXYDgQHUmrOQ.png" /></figure><ul><li>Okay! Now that we are done with setting up Atlas, we can get to the really fun part, building our app! In your terminal run:</li></ul><pre>$ npx create-react-app mongodb-stitch-tutorial<br>$ cd mongodb-stitch-tutorial<br>$ npm install mongodb-stitch-browser-sdk<br>$ npm start</pre><ul><li>In src/App.js replace the App component with this code snippet and save. Be sure to replace the YOUR_APP_ID with your client app id.</li></ul><pre>import React, { Component } from &quot;react&quot;;<br>import {<br>  Stitch,<br>  AnonymousCredential,<br>  RemoteMongoClient<br>} from &quot;mongodb-stitch-browser-sdk&quot;;<br>import &quot;./App.css&quot;;</pre><pre>class App extends Component {<br>  constructor() {<br>    super();<br>    this.state = {<br>      todos: [],<br>      value: &quot;&quot;<br>    };</pre><pre>    this.handleChange = this.handleChange.bind(this);<br>    this.displayTodos = this.displayTodos.bind(this);<br>    this.addTodo = this.addTodo.bind(this);<br>  }<br>  <br>  componentDidMount() {<br>    // Initialize the App Client<br>    this.client = Stitch.initializeDefaultAppClient(&quot;YOUR_APP_ID&quot;);</pre><pre>    // Get a MongoDB Service Client<br>    // This is used for logging in and communicating with Stitch<br>    const mongodb = this.client.getServiceClient(<br>      RemoteMongoClient.factory,<br>      &quot;mongodb-atlas&quot;<br>    );</pre><pre>    // Get a reference to the todo database<br>    this.db = mongodb.db(&quot;todos&quot;);<br>    this.displayTodosOnLoad();<br>  }<br>  <br>  displayTodos() {<br>    // query the remote DB and update the component state<br>    this.db<br>      .collection(&quot;item&quot;)<br>      .find({}, { limit: 1000 })<br>      .asArray()<br>      .then(todos =&gt; {<br>        this.setState({todos});<br>      });<br>   }</pre><pre>  displayTodosOnLoad() {<br>    // Anonymously log in and display comments on load<br>    this.client.auth<br>      .loginWithCredential(new AnonymousCredential())<br>      .then(this.displayTodos)<br>      .catch(console.error);<br>  }</pre><pre>  addTodo(event) {<br>    event.preventDefault();<br>    const { value } = this.state;<br>    // insert the todo into the remote Stitch DB<br>    // then re-query the DB and display the new todos</pre><pre>    this.db<br>      .collection(&quot;item&quot;)<br>      .insertOne({<br>        owner_id: this.client.auth.user.id,<br>        item: value<br>      })<br>      .then(this.displayTodos)<br>      .catch(console.error);<br>  }</pre><pre>  handleChange(event) {<br>    this.setState({ value: event.target.value });<br>  }</pre><pre>render() {<br>    return (<br>      &lt;div className=&quot;App&quot;&gt;<br>        &lt;h3&gt;This is a todo app&lt;/h3&gt;<br>        &lt;hr /&gt;<br>        &lt;p&gt;Add a Todo Item:&lt;/p&gt;<br>        &lt;form onSubmit={this.addTodo}&gt;<br>          &lt;label&gt;<br>            &lt;input<br>              type=&quot;text&quot;<br>              value={this.state.value}<br>              onChange={this.handleChange}<br>            /&gt;<br>          &lt;/label&gt;<br>          &lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;<br>        &lt;/form&gt;<br>        &lt;ul&gt;<br>          {<em>/* Map over the todos from our remote DB */}<br>          </em>{this.state.todos.map(todo =&gt; {<br>            return &lt;li&gt;{todo.item}&lt;/li&gt;;<br>          })}<br>        &lt;/ul&gt;<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>export default App;</pre><p>And that’s it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*CKCcQ7cu4nfiv3tzrY2MQg.gif" /></figure><p>By the end, your app should look and work like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*qHriJwRfw2mQXfpAPZ2VMQ.gif" /><figcaption>By the end, your todo app should look like this</figcaption></figure><p>If you have any questions or comments, feel free to reach out or <a href="https://github.com/JoeKarlsson/mongodb-stitch-todo-tutorial/issues/new">open an issue in the repo</a>.</p><blockquote>You can find the source code for this tutorial here: <a href="https://github.com/JoeKarlsson/mongodb-stitch-todo-tutorial">https://github.com/JoeKarlsson/mongodb-stitch-todo-tutorial</a></blockquote><p>My name is Joe Karlsson, and I am a Software Engineer from the frozen tundra known as Minneapolis, Minnesota. I write code, build teams and give talks. You can follow me on:</p><ul><li><a href="https://twitter.com/JoeKarlsson1">Twitter</a></li><li><a href="https://github.com/JoeKarlsson">GitHub</a></li><li><a href="https://www.linkedin.com/in/joekarlsson/">LinkedIn</a></li><li><a href="https://www.instagram.com/joekarlsson/">Instagram</a></li><li><a href="https://www.joekarlsson.com/">Website</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d51764e6b85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Work]]></title>
            <link>https://medium.com/@joekarlsson/how-i-work-f0abd43e42a9?source=rss-de3cfcb5f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0abd43e42a9</guid>
            <category><![CDATA[desk]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[dev-setup]]></category>
            <category><![CDATA[battle-station]]></category>
            <dc:creator><![CDATA[Joe Karlsson]]></dc:creator>
            <pubDate>Mon, 24 Dec 2018 05:05:21 GMT</pubDate>
            <atom:updated>2019-04-02T16:48:03.981Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*FPujmOuZLai4bCeopll7uQ.png" /></figure><p>There are times where people ask me how I work and about what software or gear I am using. This page will serve as a living document for people to always know the latest and greatest.</p><p>If there is something missing leave a comment below or ask in my <a href="https://github.com/JoeKarlsson/ama">AMA</a> — happy to chat and help you figure out your own situation.</p><h3>My Desk Setup</h3><p>I have a work machine and a personal machine at home.</p><ul><li>My primary work laptop is a fully loaded MacBook Pro 2018 with an i9, 32GB RAM, and 512GB hard drive.</li><li>My home laptop is a fully loaded<a href="https://www.dell.com/en-us/shop/dell-laptops/xps-15/spd/xps-15-9570-laptop?cid=298252028&amp;st=dell%2Bxps%2B15&amp;VEN1=Q7ml4lLY,73942327051226,901pdb6671,c,,%7BProductID%7D&amp;VEN2=be,dell%2Bxps%2B15&amp;lid=57027020526&amp;dgc=st&amp;dgseg=dhs&amp;acd=123098073120600&amp;VEN3=111004735251046151"> Dell XPS 15 9570</a>. With a 16 GB RAM, i7 and a 1 TB hard drive.</li></ul><p>My other gear:</p><ul><li>My main monitor is a <a href="https://www.amazon.com/gp/product/B07CKXCBWB/ref=ppx_yo_dt_b_asin_title_o00__o00_s00?ie=UTF8&amp;psc=1">HP Business Z27 27″ LED LCD Monitor</a></li><li>To my left, I run a 27″ <a href="https://www.amazon.com/gp/product/B01IOO4TIM/ref=ox_sc_saved_title_3?smid=ATVPDKIKX0DER&amp;psc=1">Dell U3417W 34-Inch Screen Led-Lit Monitor</a></li><li>My keyboard is a custom built <a href="https://www.amazon.com/Mechanical-Keyboard-Keycaps-Switches-Mx-Brown/dp/B07FKN7Z95/ref=sr_1_1?ie=UTF8&amp;qid=1545624453&amp;sr=8-1&amp;keywords=pok3r">Vortex POK3R with a custom wood case and Cherry Blues</a></li><li>My current mouse is a stock mouse: <a href="https://www.amazon.com/gp/product/B00MYTSDU4/ref=oh_aui_search_detailpage?ie=UTF8&amp;psc=1">Razer DeathAdder Chroma — Multi-Color Ergonomic Gaming Mouse</a></li><li>My desk is a custom built standing desktop an <a href="https://www.ikea.com/us/en/catalog/products/50106773/">Ikea Gerton Desktop</a> on industrial black steel legs</li><li>Here are some photos of my setup.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*MJZ5JWqqb5u7vIXxu0m5vg.jpeg" /></figure><h3>Editor</h3><ul><li><a href="https://atom.io/">Atom</a> is my code editor of choice. I was a die-hard <a href="http://sublimetext.com/">Sublime Text</a> fan before and even bought a license with my own money. So suffice to say I went kicking and screaming over to Atom, but honestly, I can’t imagine going back.</li><li><a href="https://atom.io/themes/monokai-seti">Monokai Seti</a> is my font theme of choice.</li><li><a href="https://atom.io/themes/seti-ui">Seti UI</a> has been my theme of choice for a few years now. I try to switch to new ones from time to time, but this one has been a staple for me because of how many scenarios it accounts for.</li><li><a href="https://atom.io/packages/file-icons">File Icons</a> allows you to assign file extension icons and colors for improved visual grepping.</li><li><a href="https://atom.io/packages/wakatime">Wakatime</a> is like a Fitbit for programmers. Get automated time tracking and metrics about your programming.</li><li><a href="https://atom.io/packages/sync-settings">Settings Sync Gist</a> for those who are wondering what extensions I’m running. I would be happy to write a post on essential extensions if people are interested.</li></ul><h3>Terminal</h3><ul><li><a href="https://iterm2.com/">iTerm2</a> is my terminal of choice for now, but I have been eyeing <a href="https://hyper.is/">hyper</a> for some time as well.</li><li><a href="https://ohmyz.sh/">oh my zsh</a> with a <a href="https://gist.github.com/JoeKarlsson/c6bfce645c33bd51333ab1de68f01e06#file-joe-zsh-theme">custom theme</a> is what I use instead of bash since the overall experience is more enjoyable for me in the terminal and makes everything visually pleasing to look at.</li><li>I use the <a href="https://github.com/agnoster/agnoster-zsh-theme">agnoster</a> zsh theme.</li><li>You can see most of my config files (.eslint, VS Code settings) over at my <a href="https://github.com/wesbos/dotfiles">Dot Files</a>, but please don’t just take these settings carte blanche — they work for me but might not be the best</li></ul><h3>Mac Desktop Apps</h3><ul><li>I use <a href="https://smilesoftware.com/textexpander">Text Expander</a> for canned responses and for most of my code snippets</li><li>I’m a huge <a href="https://www.alfredapp.com/">Alfred</a> fan and have many <a href="http://wes.io/fY7q">workflows.</a></li><li>I design almost entirely in <a href="https://www.sketchapp.com/">Sketch</a></li><li>I backup with 2, time machines local <a href="https://www.amazon.com/gp/product/B01H9QMMYE/ref=oh_aui_search_detailpage?ie=UTF8&amp;psc=1">Seagate Backup Plus 4TB External Desktop Hard Drive Storage</a>, and I use <a href="https://drive.google.com/">Google Drive</a> for most files.</li><li>I have customized my Mac Touch bar with <a href="https://folivora.ai/">Better Touch Tool</a>.</li><li>Window management is something I love. I use <a href="https://www.spectacleapp.com/">Spectacle</a>, it’s free and awesome.</li><li>For my tech talks and presentations, I use <a href="https://www.apple.com/keynote/">Keynote</a>.</li></ul><h3>Linux Desktop Apps</h3><ul><li>My Linux OS of choice is a <a href="http://releases.ubuntu.com/18.04/">Ubuntu 18.04.1 LTS</a>.</li><li>I use the <a href="https://itsfoss.com/install-numix-ubuntu/">Nimux theme and Icons</a>.</li></ul><h3>Apps for Linux and Mac</h3><ul><li>I use <a href="https://todoist.com/">Todoist</a> to manage my tasks.</li><li>I stream music with <a href="https://www.spotify.com/us/">Spotify</a>.</li><li>I use <a href="https://products.office.com/en-us/onenote/digital-note-taking-app">OneNote</a> for managing all of my notes and thoughts</li><li>I use <a href="https://rambox.pro/">Rambox</a> for all of my messaging clients.</li><li>I use <a href="https://www.lastpass.com/">LastPass</a> for my password manager.</li><li>My VPN of choice is <a href="https://www.privateinternetaccess.com/">Private Internet Access</a>.</li><li>I use <a href="http://buffer.com/">Buffer</a> to queue up my posts on social media. Works great for making a consistent posting schedule with minimal effort.</li></ul><h3>Recording</h3><ul><li>I use <a href="https://obsproject.com/">Open Broadcast Tool</a> for streaming.</li><li>My mic is a <a href="https://www.amazon.com/gp/product/B07CY5HS72/ref=ox_sc_saved_title_4?smid=ATVPDKIKX0DER&amp;psc=1">Blue Yeti USB</a> microphone.</li><li>My webcam is a <a href="https://www.amazon.com/gp/product/B006JH8T3S/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=webo080-20&amp;camp=1789&amp;creative=9325&amp;linkCode=as2&amp;creativeASIN=B006JH8T3S&amp;linkId=65a64ee5dd16f2fa18faf2f2d33d0538">Logitech HD Pro c920</a></li><li>I use an <a href="http://amzn.to/2kVaDCz">Amazon Basics 10 Port USB Hub</a> to make it all work at once while only having to plug in a single cable.</li></ul><h3>Other Gear</h3><ul><li>After a lengthy search for the perfect backpack for both traveling and schlepping gear around the city, I bought a <a href="https://www.amazon.com/dp/B00KSYM4SE?tag=thewire06-20&amp;linkCode=xm2&amp;ascsubtag=AgEAAAAAAAAAARLl">black Incase Icon Pack</a>. It holds everything and it looks incredible (and very expensive 😑).</li></ul><p><em>Originally published at </em><a href="https://www.joekarlsson.com/2018/12/how-i-work/"><em>www.joekarlsson.com</em></a><em> on December 24, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0abd43e42a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building High Performance React Applications]]></title>
            <link>https://medium.com/@joekarlsson/building-high-applications-react-applications-3d02145a81e6?source=rss-de3cfcb5f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d02145a81e6</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Joe Karlsson]]></dc:creator>
            <pubDate>Thu, 11 Oct 2018 00:23:33 GMT</pubDate>
            <atom:updated>2018-10-11T18:48:07.550Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Lrdmxs5FVMlqK3b8cwcTA.png" /></figure><p>Okay, we all know that React was built with performance in mind, but when is React slow? I want to break down for you, dear reader, common bottlenecks in React and when you might be making your program work harder than it should.</p><p>First of all, we need to set a baseline. How the heck do we measure performance in a React Application? Well, I am glad you asked! As of React 16, <a href="https://reactjs.org/docs/optimizing-performance.html#profiling-components-with-the-chrome-performance-tab">React has a performance monitoring tool baked into the vanilla development mode of React</a>!</p><p><a href="https://reactjs.org/docs/optimizing-performance.html#profiling-components-with-the-chrome-performance-tab">Optimizing Performance - React</a></p><p>Okay, let’s check it out. When you are in a <strong>development</strong> build, you can now perform a performance audit and see how your React components are spending their time. This feature can be used to fine tune your app and find expensive components and methods. This is also the tool we will be using to measure the performance of our app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/0*OVVNvjti__wCFwDx.png" /></figure><p>I’m not going to go into great detail of how this tools works, but if you want a more detailed walk through, check out <a href="https://building.calibreapp.com/debugging-react-performance-with-react-16-and-chrome-devtools-c90698a522ad">this article by Ben Schwarz</a>.</p><p><a href="https://building.calibreapp.com/debugging-react-performance-with-react-16-and-chrome-devtools-c90698a522ad">Debugging React performance with React 16 and Chrome Devtools.</a></p><p>For example, let’s try it out. I have <a href="https://github.com/JoeKarlsson/high-performance-react-demo">built the least performant React application possible</a>, you can check out the code here on my <a href="https://github.com/JoeKarlsson/high-performance-react-demo">GitHub</a>.</p><p><a href="https://github.com/JoeKarlsson/high-performance-react-demo">JoeKarlsson/high-performance-react-demo</a></p><p>Let’s go through and see how these tips boost the performance of our crummy ‘lil app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PX6E9HQ3uJorvXAzv0rEvg.gif" /><figcaption>Initial performance audit of our slow React app</figcaption></figure><p>As we update items on this list, we can see through the performance audit that every time I add a new item to the list through the form, <em>every single item</em> in the list has to re-render to the DOM. This process takes approximately<em> 34 ms</em> for every single re-render.</p><p>Now that we know how to measure performance on a React application and we have a performance baseline, let’s get to the thing that you came to this blog post to learn about. How exactly do you make a high performance React app? <em>Well, the short answer is only render to the DOM when you really need to. </em>The long answer is a little more involved… ;)</p><p>Using our example app, and our initial analysis, we see that there is a LOT of re-rendering happening when new items are added. We want to tell React to only re-render the parts of the app that we care about. Let’s dig into specific ways to accomplish this.</p><h3>Use 🔑Key🔑 Correctly</h3><p>So, who has this had this happen to them before? You are writing a react app and you start looping over a list of data and you are dynamically creating React nodes. All is fine and your app is rendering to the DOM just fine, but you see this little warning pop up for you in the console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-w6avZfftP7Uckvy7_a0zw.png" /><figcaption>Console warning you should see if you do not supply a key</figcaption></figure><p>I don’t know about you, but the first thing I did was put in Math.Random() in the key field, and BOOM, the warning magically disappeared! Problem solved! Well, not so fast, it turns out that even though React is no longer complaining, you are actually messing with how React keeps track of those nodes in the virtual DOM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*Kj5C5bwv7XC0DLpllhX9zg.gif" /><figcaption>Sonic says “Do not abuse the key!”</figcaption></figure><p>The key attribute is actually used by React to keep track of and identify unique nodes. This element allows React to easily keep track of how your application is changes and helps it decide if it needs to re-render to the DOM or not. And by using Math.Random() or the index in an array to track the unique key, every single time the list re-renders or the data changes, React loses track of your element and has to start over from scratch. You can learn more about how the key is used <a href="https://reactjs.org/docs/lists-and-keys.html">here</a>. <strong>Do not forget to supply an appropriate key!</strong></p><p>So how does using the <em>key</em> attribute correctly affect our performance? Let’s check it out!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KU08TdKUInB7duKPVnM4ow.gif" /></figure><p>We went from<em> 34 ms to 16 ms</em>. We just cut the render time in <strong>half</strong> by using key’s correctly!</p><h3>Manage shouldComponentUpdate()</h3><p><a href="https://reactjs.org/docs/react-component.html#shouldcomponentupdate">shouldComponentUpdate</a>()is a React life cycle method used to improve performance of React applications by defining exactly when you want your component to re-render. By default, React will re-render your component each and every time the state or props change. However, there might be instances when you do not want your component even if your state has changed.</p><p>In this example, we are passing in the nextProps and nextState and we are returning a boolean that reports the state/prop changes that we actually care about and that we actually want to re-render on. React is able to ignore all other changes. Here’s the code of how the use shouldComponentUpdate().</p><pre>class Item extends Component {</pre><pre>  <strong>shouldComponentUpdate(nextProps, nextState) {<br>    if (this.props.title !== nextProps.title) {<br>      return true;<br>    }<br>    return false;<br>  }</strong></pre><pre>  render() {<br>    return &lt;h3&gt;{ this.props.title }&lt;/h3&gt;<br>  }<br>};</pre><p>When we take control and tell React about the state changes that we care about, how does that affect our re-render time?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hvGQEyr8Smp6EoriPhzRTg.gif" /><figcaption>Performance audit after implementing shouldComponentUpdate()</figcaption></figure><p>We’ve cut the re-render time from approximately <em>16 ms to 9 ms</em>. We’ve nearly cut the render time in <strong>half</strong> again!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*G5d24wwTOh6gOx6Ax8UJMQ.gif" /><figcaption>GOTTA GO FAST!</figcaption></figure><h3>Extend ✨ PureComponent ✨</h3><p>shouldComponentUpdate() is wonderful and it does great things for helping improve the performance of our React applications, but you should consider using the built-in PureComponent instead of writing shouldComponentUpdate() by hand. A PureComponent performs a shallow comparison of props and state, and reduces the chance that you’ll skip a necessary update.</p><p>When React is performing a shallow comparison, it treats scalar values differently from objects. When it is comparing scalar values (numbers, strings) it compares their values. When comparing objects, it does not compare their’s attributes — only their references are compared (e.g. “do they point to same object?). This gif shows how JavaScript performs a deep or shallow comparison</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*uL63s4lQc9Yfv-Lx-Twc1g.gif" /></figure><p>Shallow compare is efficient way to detect changes. It should be noted that shallow comparisons, expect that you don’t mutate data (which we will address when we talk about in the immutable data section below).</p><p>So, what does a PureComponent look like in code? For those who want a real code snippet, here it is:</p><pre>class Item extends <strong>PureComponent</strong> {</pre><pre>render() {<br>    return &lt;h3&gt;{ this.props.title }&lt;/h3&gt;<br>  }<br>};</pre><p>For those who want to see the dramatic reduction and increased clarity PureComponents brings over using shouldComponentUpdate(), check out this incredible gif I made!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*QAuPqdDxw_qFL-I-g2SFlw.gif" /><figcaption>Look at the dramatic reduction and increased clarity PureComponents brings over using shouldComponentUpdate()</figcaption></figure><p>Isn’t it so much shorter and easier to read than before? This gif perfectly sums up how I feel after I refactor a code base to use PureComponents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*9GZke3-EUsFiLkfpAEjCQw.gif" /><figcaption>Doesn’t it feel good to not have to write all that code?</figcaption></figure><p>Okay, so it looks pretty, but do PureComponents actually make our application perform faster? If it is truly a replacement for shouldComponentUpdate(), than we should expect that the performance boost should be equivalent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FkL-tpXLhGanzkElPuYM1w.gif" /><figcaption>PureComponents give you the same performance boost as shouldComponentUpdate()</figcaption></figure><p>We can see that we see exactly the same performance gains as when we use shouldComponentUpdate(). Yahoo!</p><h3>Use 🔒Immutable🔒 Data</h3><p>Immutable is one of those fancy programming words you’ve probably heard tossed around, but you might not know what it means. <em>Immutable</em> is a fancy word that means instead of changing data you are instead <em>making new copies of objects/arrays</em>. Using immutable data in your React app allows the React diffing algorithm to make tracking the changes to your app cheap. Below is an example of how differences are tracked with Mutable and Immitable data. In the first mutable example, JavaScript needs to check each key in the object to check for differences, but in the Immutable example, JavaScript is able to check if the object pointer is in a different memory location. This is SO MUCH FASTER!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*uL63s4lQc9Yfv-Lx-Twc1g.gif" /></figure><p>For more information on how immutable data helps improve the performance of your React application, check out this info straight from the source.</p><p><a href="https://reactjs.org/docs/optimizing-performance.html#using-immutable-data-structures">Optimizing Performance - React</a></p><h3>Use Stateless Components</h3><p>Okay, to be honest, I’m not exactly sure why using stateless components is faster than using React components with state, but Dan Abramov reports that in version 16+ of React, stateless components give a small performance boost. I haven’t actually seen any information or explanation about why is this, but if Dan says it’s true, so I believe it. If anyone has any info on why this is, please let me know in the comments below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NmmaaQ3rskKL-RqdA3sOnA.png" /><figcaption>Tweet from Dan explaining that Stateless Components are faster in React 16+</figcaption></figure><h3>Go Universal</h3><p>Universal (or Isomorphic) React won’t make your whole application faster, but it will make your component <em>initial render</em> to go much faster. And sometimes, performance is all about making your user think your fast ;)</p><p>Universal rendering works by performing the initial render of your React component on the server. The server than sends an pre-rendered HTML string of your initial render, CSS, and JS. This can be easily cached on your servers to further reduce and reuse your initial render. Using Universal React allows the users of your application to see and interact with your site while React is still firing up behind the scenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*Nwq2l68Z9OfFwPc-Lf0yxg.gif" /><figcaption>Flow of how Isomorphic React component render on the client</figcaption></figure><p>Universal React works great if you have a humongous app that takes a long time to do the initial render. You can find out more information about isomorphic React here:</p><p><a href="https://www.smashingmagazine.com/2015/04/react-to-the-future-with-isomorphic-apps/">React To The Future With Isomorphic Apps</a></p><h3>⚡️ Build React for Production ⚡️</h3><p>When you are building your React component on your development machine, it is expected that you build it using <strong>development</strong> mode. This is because this mode includes a bunch of helpful tools to help you debug you application. <strong>Development</strong> mode includes the performance audit tool that have been using to benchmark our app. However, when you run your app in <strong>production</strong> mode, React automatically strips out all of the development tools and builds a minified version that runs faster in the browser. In fact, the <strong>production</strong> build can even make your app run <em>two to eight times</em> faster! Let’s check it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sg1QXgg0aQXVT-74ColsBw.gif" /><figcaption>Running our app in “Production” mode</figcaption></figure><p>When running the <strong>production</strong> build, the performance auditing tool has been removed. Since this is missing, we will now look at how quickly the component can repaint the DOM after an update using the default performance tools in Chrome. With the production build of our app, we can see that we now re-paint in <em>6 ms. Woohoo!</em></p><p>More information about building your React app in production mode can be found here.</p><p><a href="https://reactjs.org/docs/optimizing-performance.html#use-the-production-build">Optimizing Performance - React</a></p><h3>Analyze Your Webpack Bundle 🔬</h3><p>This tip isn’t exactly React specific, but most of us use Webpack as their bundler with React, and I have found that this is actually one of the <em>most beneficial </em>things we have implemented to make our React apps faster.</p><p>We have started to to add a Webpack analysis into our development workflow. Using Webpack Bundle Analyzer, we check to make sure that nothing unexpected has made it’s way into our final bundle. We also use this step to ensure that there are no unexpectedly large packages has slipped in.</p><p>Analyzing your bundle and reducing bundle size is important to improve application performance because the more data you are sending across the internet tubes, the slower it takes get to the end user and the longer it takes to parse and load the bundle.</p><p>Our team has included Webpack Bundle Analyzer in our build process to help keep the package size under control. It’s easy for us to pull in a new npm package in order to provide a quick fix for our app, but often times, it’s not clear how that actually impacts our final bundle size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*dusVhPiL44VDoS4gJHMWSg.gif" /><figcaption>Webpack Bundle Analyzer makes it easy to visually see what your bundle is made of</figcaption></figure><p><a href="https://github.com/webpack-contrib/webpack-bundle-analyzer">GitHub - webpack-contrib/webpack-bundle-analyzer: Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap</a></p><h3>Make It Work, Then Make It Fast 🏃💨</h3><p>I personally believe that this is the most important point of all. When building any application, you should focus on getting your app working first, and only focus on making it fast once you have it released and you see that you have performance issues (note: this is generally true, however, I am aware that there are situations where you need to focus on speed from the very beginning).</p><p>Often times, I see engineers to focused on making a “perfect” app that they fail to ever finish it and release it. Releasing an app (even if it’s not perfect) is even more important when working on a professional software project.</p><p>Alright, let’s recap everything learned. If you want to make your React applications fast you should do the following:</p><ul><li>Use 🔑key🔑 correctly</li><li>Manage shouldComponentUpdate()</li><li>Extend ✨ PureComponent ✨</li><li>Use 🔒immutable🔒 data</li><li>Use stateless components</li><li>Go universal</li><li>⚡️ Build React for production ⚡️</li><li>Analyze your Webpack bundle 🔬</li><li>Make it work, then make it fast 🏃💨</li></ul><p>There you have it, I hope these are some practical and easy to implement things you can do to start making your React apps faster. If I missed anything, please feel free to let me know in the comments below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*H1l9k2ruGjHDxqmoHgaD1Q.gif" /><figcaption>Thanks for reading!</figcaption></figure><h3>Further reading:</h3><ul><li><a href="https://reactjs.org/docs/optimizing-performance.html#use-the-production-build">Optimizing Performance - React</a></li><li><a href="https://github.com/JoeKarlsson/high-performance-react-demo">JoeKarlsson/high-performance-react-demo</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fspeakerdeck.com%2Fplayer%2Fef17b991737848179b4455f0da960b6c&amp;url=https%3A%2F%2Fspeakerdeck.com%2Fjoekarlsson%2Fbuilding-high-performance-react-applications&amp;image=https%3A%2F%2Fspeakerd.s3.amazonaws.com%2Fpresentations%2Fef17b991737848179b4455f0da960b6c%2Fslide_0.jpg%3F458182&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=speakerdeck" width="710" height="532" frameborder="0" scrolling="no"><a href="https://medium.com/media/10606c83a04d8874b4f212e5efbf1d2e/href">https://medium.com/media/10606c83a04d8874b4f212e5efbf1d2e/href</a></iframe><p>This blog post was written to accompany talk, Building High Performance React Applications.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FJNs1ZvRzOYM%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJNs1ZvRzOYM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FJNs1ZvRzOYM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ba041d7f56f3b202974b2725aa3dc1d/href">https://medium.com/media/7ba041d7f56f3b202974b2725aa3dc1d/href</a></iframe><p>You can check out my other talks on my website <a href="https://www.joekarlsson.com/">joekarlsson.com</a></p><p><a href="https://www.joekarlsson.com/">Home</a></p><p>My name is Joe Karlsson, and I am a Software Engineer from the frozen tundra known as Minneapolis, Minnesota. I write code, build teams and give talks. You can follow me on:</p><ul><li><a href="https://twitter.com/JoeKarlsson1">Twitter</a></li><li><a href="https://github.com/JoeKarlsson">GitHub</a></li><li><a href="https://www.linkedin.com/in/joekarlsson/">LinkedIn</a></li><li><a href="https://www.instagram.com/joekarlsson/">Instagram</a></li><li><a href="https://www.joekarlsson.com/">Website</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d02145a81e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Ran My First Hackathon, and So Can You!]]></title>
            <link>https://medium.com/@joekarlsson/i-ran-my-first-hackathon-and-so-can-you-77b60187a013?source=rss-de3cfcb5f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/77b60187a013</guid>
            <category><![CDATA[tech-events]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[event-planning]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Joe Karlsson]]></dc:creator>
            <pubDate>Mon, 30 Jan 2017 05:14:52 GMT</pubDate>
            <atom:updated>2017-02-01T06:46:29.213Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*b7SRvqwJ_QcdTT899lggHQ.png" /></figure><p>I Ran My First Hackathon, and So Can You! Here are the lessons I learned from planning, organizing, and executing my first hackathon. The hackathon I ran was the <a href="https://stupidshitnooneinhawaiineedshackathon.github.io/">Stupid Shit and Terrible Ideas Hackathon</a>) in Honolulu, Hawaii.</p><p>Okay, so first of all, what exactly is a hackathon? I find that when I tell people about hackathons, they assume I am hacking into some mainframe with my hack friends, like some scene out of Hackers.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F14kdiJUblbWBXy%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2F14kdiJUblbWBXy&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F14kdiJUblbWBXy%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="192" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7ea59a67089179f3a6b148deeea1043/href">https://medium.com/media/e7ea59a67089179f3a6b148deeea1043/href</a></iframe><p>I define “<strong>hackathon</strong>” very broadly:</p><ul><li>Hacking is creative problem-solving. (It does not have to be about technology.)</li><li>A hackathon is any event of any duration where people come together to solve problems or build something.</li></ul><p>The idea for the Stupid Shit Hackathon was born out of the idea that tech — specifically corporate tech — can solve any problem with a weekend of hacking. Climate Change — give me four hackers and 48 hours and I can solve that for you. Homelessness — No problem, we’ll start a hackathon and solve that in a jiffy. The Stupid Hackathon was intended to be a meta-hackathon. Self-aware of corporate tech, male dominated self-seriousness I found at most hackathons.The bottom line is that everyone at the event came in order to build stuff for the sheer joy of creation, not for profit or for glory. Okay, enough by my event, let’s talk about yours!</p><p>Over the years as my career as a Software Engineer, I had attended dozens of hackathons, but until now, I had not organized one on my own. I learned a ton through trial and error, research (see resources below), friends (Ray Farias, Jon and Kelli Borgonia, Jason Sewell, Russel Cheng and Victor Lee). I am by no means an expert, but here are the lessons I learned from organizing my first hackathon ever. I hope it helps and encourages other new hackathon organizers to run an amazing event.</p><p><strong>In this article, I will cover the following:</strong></p><ol><li>How to get prepared for your hackathon</li><li>How to market your hackathon</li><li>How to get sponsors</li><li>How to run the kickoff ceremonies</li><li>What to do during the hackathon</li><li>How to run the final presentations and award ceremony</li><li>What to do after your hackathon</li></ol><p>A couple of notes before we dig in:</p><ul><li>The event I organized had about 60 people in attendance, if you are planning an event with 100 people or more, you are probably on a whole other level and you will need to do a lot more prep work. I would recommend checking out the <a href="https://hackathon.guide/">Hackathon Guide</a> for details on how to run an event with lots of people in attendance.</li><li>This was a Stupid Shit and Terrible Ideas hackathon, which by its very nature is a very nonstandard hackathon. We wanted to create more of a collaborative and warm vibe so that all of our entrants have fun, but hopefully you can bring the positive and welcoming vibes to your hackathon.</li><li>This was the first hackathon I ever ran — I definitely still have lots to learn in regards to running a smooth, diverse and inclusive event, but I am trying my hardest.</li><li>I am a software engineer, not a lawyer. <strong>Do not take anything I say here as legal advice.</strong></li></ul><h3>How To Get Prepared For Your Hackathon</h3><h4>Think To Yourself — What Do You Want To Get Out Of Running This Event</h4><p>Do you want to promote your business? Acquire new talent? Generate new ideas? Solve a problem? Make some stupid shit? Whatever your reason, just know that hackathons are not the be all end all. Hackathons should be used in conjunction with a larger strategy to promote your objectives.</p><p>You might not even want to run a hackathon, I would suggest reading, <a href="https://medium.com/@elle_mccann/so-you-think-you-want-to-run-a-hackathon-think-again-f96cd7df246a">So You Think You Want to Run a Hackathon? Think Again</a> by Laurenellen McCann for thoughts on other (and sometimes better) ways of engaging a community.</p><h3>Assemble A Diverse Organizing Team</h3><p>Assemble a diverse team just like the Avengers.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F7t3vlQAJCZCU0%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2Favengers-assemble-7t3vlQAJCZCU0&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F7t3vlQAJCZCU0%2F200.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/6fbf24a96a8357063c07072b2c1a6093/href">https://medium.com/media/6fbf24a96a8357063c07072b2c1a6093/href</a></iframe><p>If you want to attract a diverse audience, you will want your organizing team to reflect the audience that you hope to attract. For my hackathon, I don’t think that I did a great job at doing of getting together a diverse team, and for my next event, this is something that I really want to focus on improving.</p><h3>Setup Communication For Your Organizing Team</h3><p>For our hackathon, we created a <a href="https://slack.com/">Slack</a> channel for the organizing team to talk about our tasks. This has worked great for communicating in real time with the team and with the attendees during the hackathon. We were also able to use this Slack account for the team during the hackathon, to organize their own teams and to send out live updates to the teams while they were hacking.</p><h3>Find A Venue To Host Your Event and Reserve The Date</h3><p>This is the only thing you need to do significantly in advance of the event. The earlier you can reserve space the better. When looking for a space to host your hackathon, be sure to find a venue that can provide:</p><ul><li>Proper seating</li><li>One power strip per table</li><li>Wifi (is it fast and reliable? can it connect all of your participants? does it block any ports?)</li><li>Projector</li><li>A microphone, at least in large rooms</li><li>Accessible entrances and wheelchair-friendly seating space (and if there is a stage, check if it is accessible, if applicable)</li><li>Gender-neutral, single-occupancy, accessible bathrooms</li><li>Is food allowed in your venue</li><li>Is not in the middle of nowhere</li></ul><p>Venues are typically very expensive. If you are reserving a professional space like a banquet or conference center, it can run you anywhere from $10 to $40 a head. For our hackathon, we were lucky enough to be sponsored by a local government agency that supports tech growth in Hawaii, <a href="http://htdc.org/">HTDC</a>. It might be worthwhile to try and find a place that is willing to sponsor your space, this will especially be easier if your hackathon is for a good cause. If you are running a corporate hackathon, you might be out of luck.</p><h3>Picking a Date For Your Hackathon</h3><p>Picking a date for your event is actually really hard. There are many things that you will want to keep in mind. First of all, look at a calendar of other similar events. You do not want to pick a date when all of your developers are at a big local conference if you are trying to attract a large number of developers. You will also want to avoid:</p><ul><li>Holidays</li><li>Summer (especially late summer) — This is especially hard for parents</li><li>Major events in your area (especially other tech events or conferences)</li></ul><p>Have it on a weekend — trust us — just do it. Nobody can jam during the week.</p><p>Picking a date about 6 months ahead was really helpful for us. We were able to stake a claim on a date before anyone else had a chance to take the great event dates. If you have the ability, be sure to reserve your date as early as you possibly can. We never regretted planning our event so early.</p><h3>Food</h3><p>Okay, here are some guidelines for selecting food for your hackathon:</p><ul><li>The first rule of picking food for a hackathon is “No Pizza”. Pizza is just about the most unhealthy thing you can eat, and tech people eat it at 90% of the events they go to.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3oriNWxJAEYUt59Ego%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2Fpizza-skeleton-delivery-3oriNWxJAEYUt59Ego&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3oriNWxJAEYUt59Ego%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/e520ff536ecc259828be5b32558dc018/href">https://medium.com/media/e520ff536ecc259828be5b32558dc018/href</a></iframe><p>I have a confession to make, I had pizza at my hackathon. I know, I know, I hate pizza at hackathons, but money was short, and pizza is the cheapest thing you can order for a large group of people.</p><ul><li>You usually halfway healthy food, right? Order food that you would actually eat if you weren’t at a hackathon.</li><li>Provide options for people with dietary restrictions. Something I did not do well at my hackathon was providing options for vegetarians, people with allergies, or people with other dietary restrictions. Be sure to have food for everyone.</li><li>Provide coffee and light pastries and/or fruit for breakfast.</li><li>Make sure you have lots of water throughout the whole day.</li><li>Sugar and caffeine are okay. Soda and energy drinks are usually appreciated.</li><li>Budget about $20 to $40 per head per day for food.</li><li>When ordering food, be sure to order it at least a couple of days before the event.</li></ul><p>Alright, one final thought, for a small event or a non-profit event, food can be optional. Food was the most expensive part aspect of our hackathon, and I would have rather allocated money for swag for everybody, or more inclusive prizes for the winners. For my next hackathon, I would will questions whether we need to provide full meals for the participants or not.</p><h3>Registration</h3><p>When your participants are signing up for your event is a great time to collect preliminary information about the audience of your hackathon. For our event, we set up an <a href="https://www.eventbrite.com/">Eventbrite</a> registration form, you can easily collect as much info as you want with it. This worked great for our free event. Hackathon.guide has some great suggestions for types of information that you should be looking to collect on the registration form.</p><ul><li>Name (and possibly other information as required by venue security)</li><li>Email address</li><li>Job title</li><li>Are they new to hackathons?</li><li>What kind of hacker are they? Examples: Developer. Designer. Data Scientist. Domain Expert. Government Staff. Communicator. Project Manager. Advocate.</li><li>What are they interested in hacking on? (free form question)</li><li>Are they interested in any of the workshops?</li><li>How they heard about the event</li><li>Special needs/requests</li></ul><p>This information you can collection ahead of time, the better you can plan and prepare.</p><p>One final note, according to the <a href="http://hackathon.guide/">Hackathon Guide</a>, “For a free event, about 65% of those who register will actually show up. This number is very consistently seen across events. So cap registration at 150% of your actual maximum capacity.”</p><h3>Legal Stuff</h3><p>Be sure your organization is adequately insured for the event, venue and any other liability (lost or stolen goods at the event, injuries, etc.). While people aren’t likely to be skateboarding or sword-fighting at hackathons, it’s always better to be prepared for the worst.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FisMS5AtzBOxMY%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2Flegal-isMS5AtzBOxMY&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FisMS5AtzBOxMY%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="491" frameborder="0" scrolling="no"><a href="https://medium.com/media/df136fc0fc8ae40b5a64dacce735e199/href">https://medium.com/media/df136fc0fc8ae40b5a64dacce735e199/href</a></iframe><h3>How To Market A Hackathon</h3><p>Okay, so you have been doing all this planning for your big event, but now you actually want people to show up and participate in your event? How the heck do you get people to show up? Well, you gotta get the word out on the street, that’s how! As an engineer, marketing an event is something that I naturally suck at. This was actually a great chance to up my marketing skills.</p><p>One note, your marketing plan should be put together in order to fit your objectives for the hackathon. Do you want to reach a particular audience? Do you want to get a massive numbers of submissions? Do you want to attract the top talent in the industry? Do you want to simply promote your brand? Be sure to keep your objectives in mind as you are developing your marketing plan.</p><h3>Make A Website</h3><p>You’re running a hackathon, you have got to make a website for your event. This is important for so many reasons. One, make it easy for people to get information about your event. Two, you are going to need it to get sponsors (see below). Your website should cover the following:</p><ul><li>Make it look professional — this is the site your sponsors will be looking at when deciding if they want to give you money.</li><li>The who, what, when, where, and why’s of your event (duh).</li><li>Start and end dates</li><li>Location</li><li>Information about parking</li><li>Reminder about materials needed for the event (laptop, charger, camera, etc)</li><li>Schedule of events during the day</li><li>Food that will be provided (if applicable)</li><li>Times of workshops or training sessions before the event</li><li>The Code of Conduct</li><li>Information about the previous years event (if applicable)</li><li>Information about your sponsors.</li><li>Contact information for the organizers</li><li>Link to Eventbrite registration form</li></ul><h3>Social Media</h3><p>Alright, this is a tech event, you basically gotta have an online presence for your hackathon. You should have at least a Twitter account, and a Facebook event page.</p><p><strong>Twitter</strong></p><ul><li>Create a twitter account for your event</li><li>Choose a hashtag for your event</li><li>Encourage people during the event to follow your events Twitter if they want to be updated about future events.</li></ul><p><strong>Facebook Group/Event</strong></p><ul><li>Facebook pages and events are a great way to interact with the community. I have found that people feel more comfortable posting to Facebook event pages then Twitter pages for Hackathons, but that could just be the community I am in.</li></ul><h3>Training Workshops</h3><p>If you want to attract a lot of people that are new to programming or if you anticipate that many of your participants will be new programmers, than having training workshops leading up to the start date of your event is a great way.</p><p>Offer a variety of workshops to the public, with a variety of languages and topics. Marketing them as low pressure workshop will help lower the barrier of entry many people feel when considering joining a hackathon.</p><h3>Prizes</h3><p>I find that prizes can be a great way to market your event, but you need to be careful about the prizes you offer, as they can severely affect the mood of your event. For example, large cash prizes can make the event more competitive, which might turn off lots of inexperienced programmers, future programmers, and future technical leaders. The folks over at Major League Hacking wrote up a <a href="http://news.mlh.io/are-hackathon-prizes-the-worst-thing-since-moldy-sliced-bread-04-18-2014">much better article</a> than I could ever hope to write about how to select “good” prizes for your event. I encourage you to check out their take on what makes a great or terrible hackathon prizes.</p><h3>Swag</h3><p>Swag is a great way to do some guerrilla marketing for your event.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fa6h71JgwZKz6w%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2Fswag-mr-bean-a6h71JgwZKz6w&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fa6h71JgwZKz6w%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="218" frameborder="0" scrolling="no"><a href="https://medium.com/media/88a2670b5f86d6eb884332342e8fb878/href">https://medium.com/media/88a2670b5f86d6eb884332342e8fb878/href</a></iframe><p>Here are some great example of good swag for your event:</p><p><strong>Stickers</strong></p><ul><li>Making exclusive stickers. Devs love putting stickers on their laptops, water bottles, children, bosses. Basically, we put them everywhere.</li></ul><p><strong>T-Shirts</strong></p><ul><li>Don’t get those crappy one size fits all t-shirts though, nobody like that shit. In fact, read <a href="http://conference.hopper.org.nz/#tshirts">Hopper Conference Diversity Guide’s section on t-shirts</a>.</li></ul><h3>Word of Mouth</h3><p>This last one is huge, but be sure to get the word out about your hackathon with your mouth. Tell everybody you know, talk about it all the time. Get comfortable with asking your friends and acquaintances to come to your event. Lots of the traffic at my event was due to word of mouth.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FZJqPtMjmHbNN6%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2Fanyone-cafe-personality-ZJqPtMjmHbNN6&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FZJqPtMjmHbNN6%2F200.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="319" frameborder="0" scrolling="no"><a href="https://medium.com/media/a42838c6a053d92fa68c1b2b55c07a2a/href">https://medium.com/media/a42838c6a053d92fa68c1b2b55c07a2a/href</a></iframe><h3>How To Get Sponsors</h3><p>Organizing hackathons costs money, there is no way around it. Even if you are running a bare bones hackathon, you are going to need find some money for food, prizes, and space to hack. You basically have two options:</p><ol><li>Pay for it out of pocket or</li><li>Find corporate sponsors to help you fund your hackathon.</li></ol><p>This section is going to cover the later section. I am going to tell give you some tips I picked when you are trying to get people to give you money to help you run your event.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3osxYamKD88c6pXdfO%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fseason-3-money-unicorn-3osxYamKD88c6pXdfO&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2F3osxYamKD88c6pXdfO%2Fgiphy.gif%3Fcid%3D790b76118b7dbc51ae970774d1845f9ef663f8e93e37d860%26rid%3Dgiphy.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/e049c1d99323c5afa8e5d8a327472f1a/href">https://medium.com/media/e049c1d99323c5afa8e5d8a327472f1a/href</a></iframe><h3>Make A Website</h3><p>When people are considering whether they want to give you money for your hackathon, the first thing they are going to do is check out your website. Your website will give you credibility, and help sell your event to potential sponsors. Make sure your message is clear and that you represent yourself well. For more tips about what you should have on your website, check out my section about on how to build a great marketing website.</p><h3>Figure Out What you Are Offering To Your Sponsors</h3><p>Companies are going to be giving you money, but they will expect something in return. This is your job to sell them on why the people that you are bringing to your hackathon are a good fit for their company. Usually companies sponsor hackathons to get exposure for their products, acquire new talent, to promote their brand. With your team, brainstorm how your are going to sell your event to your sponsors. Be able to explain in simple terms why a company should give you money.</p><h3>Reach Out To Big Tech Companies</h3><p>Reach out to big companies that have money allocated to sponsor hackathons, like Microsoft, Google, or GitHub. They are usually easily sold on sponsoring your event since they already have money allocated for events like yours. Plus, once you have these big sponsors, it is usually easier to get smaller companies because you can share how big well-known companies have already sponsored your event. 😉</p><p>Okay, so you want to make a cold call to a potential sponsor, what do you even say? Well buddy, I’ve got you covered with this handy-dandy hackathon sponsor email template.</p><blockquote><em>Greetings [Company you are asking for a sponsor],</em></blockquote><blockquote><em>I’m am [Who you are &lt;student, engineer, space whale&gt; ], and we’re putting together a [Name of your hackathon] on [Start date of your hackathon]. I was thinking that [Company Name] might make a great sponsor for our hackathon. [List out reasons why you think the company is good fit.]</em></blockquote><blockquote><em>Let me know if this is something you may be interested in and I’d be happy to send your more details or set up a phone call.</em></blockquote><blockquote><em>Kind regards,<br>[Your name]</em></blockquote><h3>How To Run The Kickoff</h3><p>At the kickoff for your hackathon is the time when you set the rules, and expectations for the event. In terms of planning your day, I would argue that this is one of the most important parts of your execution of the event. So, when you are planning an outline for your kickoff, be sure to consider and include the following:</p><h3>Bring Positive Vibes</h3><p>You may have heard that the technology industry has a pretty terrible track record of running events that that make woman and minorities feel comfortable. By making a more positive and inclusive experience, you are more likely to attract women and minorities to your event. As a technology event organizer, you have a tremendous opportunity to make a small difference and to make everyone feel comfortable and welcome.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl41YckuRnJ8HQk09i%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2Fgood-vibes-pma-positive-mental-attitude-l41YckuRnJ8HQk09i&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl41YckuRnJ8HQk09i%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="230" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6eb9c1e547e40effb17c6a749a1c5c5/href">https://medium.com/media/b6eb9c1e547e40effb17c6a749a1c5c5/href</a></iframe><p>My personal favorite hackathons are the hackathons that are positive, supportive, collaborative and welcoming to newcomers to the community and to the old pros. I have been to so many hackathons that feel competitive (in a bad way), support unhealthy eating and sleeping schedules, or foster secrecy. All of these things create an ugly dark event that leaves your attendees with a bad taste in their mouth.</p><h3>Explain The History and Purpose Of The Event</h3><p>Reiterate to everyone what the purpose of the hackathon is. You would be surprised how many people come to your event without having a good idea of what they are about to do. It’s also a great idea to talk about any previous events you have run or to get people excited about starting something new. Tell everyone about how awesome your event it!</p><h3>Introduce The Organizers</h3><p>Tell everyone who you are, and why you are putting it on the event. This is also a good time to give out your contact information incase anyone wants to get a hold of you during the event.</p><h3>Encourage New Hackers</h3><p>I think that a great way to start out the event is to thank the new comers to the event for taking a big risk and being brave. I like reminding everybody how hard it is to do what they are doing, and to remind the group to be patient and encouraging to new hackathon participants. I like to have everyone give a round of applause to the newcomers at the kick off. As an organizer, keep a list of projects and more senior mentors that you can pair your new comers with. You want to make sure that everyone at the hackathon feels like they have an important job to perform or else you will lose the new comers and likely, you will never see them ever again. It is in your power to make sure that they have a great time at their first hackathon.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F26uf2jP7j8WVZVGwM%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2Fhulu-the-mary-tyler-moore-show-26uf2jP7j8WVZVGwM&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F26uf2jP7j8WVZVGwM%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="299" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc675bde945198aaa2feef3a8a93b906/href">https://medium.com/media/cc675bde945198aaa2feef3a8a93b906/href</a></iframe><h3>Be Clear About The Rules</h3><p>At the day of the hackathon, we weren’t exactly sure what types of projects people would be submitting, so we wanted to leave the prize categories fluid till up till submission. This was challenging for some people at our hackathon. They wanted to have a clear understanding of the rules and how it was going to be judged. We also changed the submission time twice during the hackathon based on information about how people were submitting their projects. If I were to run this hackathon again, I would have been more clear up front about the rules and have a clear time table of events established up front.If I were to take this another step further, I would have a handout to give everyone with the rules, categories, and a timeline of events through out the day.</p><h3>Thank Your Sponsors</h3><p>Your sponsors are funding your event, they expect to get something in return. Usually this is recognition for their time, money and efforts in front of their techie audience.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F11htLOXJ6cC6KQ%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2Flove-11htLOXJ6cC6KQ&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F11htLOXJ6cC6KQ%2Fgiphy-downsized-large.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="270" frameborder="0" scrolling="no"><a href="https://medium.com/media/5704bd912674313fb3d94ce29b4b0015/href">https://medium.com/media/5704bd912674313fb3d94ce29b4b0015/href</a></iframe><h3>Code Of Conduct</h3><p>We wanted everyone to have fun at our hackathon, and we wanted to be serious about making sure that we ran an inclusive and diverse event. That’s why we put together a Code of Conduct for our hackathon. This code of Conduct was a conglomeration of lots of other anti-harassment policies put together by much smarter and much more diverse tech people than myself. I don’t want to pretend to be an expert on diversity in tech, but I do want to try my hardest to make sure everyone feels comfortable at my events. As with everything in this article, I am open to feedback.</p><p>Your Code of Conduct is more than a set of rules it is your way of setting the community norms at your event. Use your Code of Conduct as a means of creating a positive environment that fosters collaboration.</p><p>The <a href="http://www.hackbrightacademy.com/code_of_conduct_for_hackathons">Hackbright Academy’s</a> code chimes in with four simple main guidelines:</p><ol><li>Be respectful.</li><li>Be thoughtful.</li><li>Be open.</li><li>Be awesome.</li></ol><p>Simple.</p><p>When writing your own Code of Conduct, I would check out these awesome examples and take the parts that work best for you and your event. Here are some great examples:</p><ul><li><a href="http://leanstartup.co/code-of-conduct">2014 Lean Startup Conference</a></li><li><a href="http://www.hackbrightacademy.com/code_of_conduct_for_hackathons">Hackbright Academy’s</a></li><li><a href="http://alliedmedia.org/#!/amp-network-principles">Allied Media Conference</a></li><li><a href="http://codefordc.org/resources/codeofconduct.html">Code For DC</a></li><li><a href="http://techladyhackathon.org/codeofconduct">Tech Lady Hackathon</a></li><li><a href="http://conference.hopper.org.nz/#coc">Hopper Conference Diversity Guide</a></li></ul><p>If you’re interested in more, the <a href="http://adainitiative.org/what-we-do/conference-policies/">Ada Initiative</a> has a thorough list of conferences with anti-harassment policies.</p><h3>Explain Logistics</h3><p>Go over the schedule of workshops, lunch, end time, etc. You can also use this time to encourage people to take and share session notes and to record progress on projects.</p><h3>Ice Breaker/Team Building Acitivity</h3><p>In my experience, people groan and grumble when they hear that there is going to be a ice breaker activity, but having one has consistently made the vibes at events with them more positive and inclusive. I would highly recommend having one at your hackathon. <a href="http://www.icebreakers.ws/extra-large-group">This site</a> has some great ideas for ice breakers for large groups.</p><p>I have also tried splitting into groups of anywhere from 5 to 10 people. Each person introduces themselves, and you can have a quick brainstorm of ideas for the hackathon as a group. This can be helpful if not many people have ideas prepared for your hackathon. It is also a good way for newcomers to meet other people and to possibly join a group.</p><h3>During The Hackathon</h3><p>This is going to be the shortest section, because it’s the easiest for the organizer. That’s because:</p><h3>Once The Hacking Has Started, Do Not Interrupt The Hacking</h3><p>I feel so strongly about this. The only reason you should break the participants flow is if you are letting them know that food is there or to check in and to make sure that hacking is going smoothly. I hate it when I go to a hackathon, and my flow is interrupted.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FHwOmxUKFFNEwU%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2Fhorrible-hilariously-HwOmxUKFFNEwU&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FHwOmxUKFFNEwU%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/f14c9a66f355bcd780acf22deb89727c/href">https://medium.com/media/f14c9a66f355bcd780acf22deb89727c/href</a></iframe><h3>How To Run Final Presentations and Award Ceremony</h3><p>You survived the whole hackathon, now we are at the end and we have just one last thing to do, presentations and awards!</p><h3>Collect Projects</h3><p>Collecting information about each team’s project is always a pain in the butt. We tried a couple of different methods for collecting submissions. We have tried using <a href="https://github.com/">GitHub</a> and <a href="https://post.devpost.com/">DevPost</a>.</p><p><strong>GitHub</strong></p><ul><li>Setup a GitHub organization and add your hackers as users. Encourage them to commit their code through-out the hackathon, and wrap up the weekend with a nice README file of their project.</li></ul><p><strong>DevPost</strong></p><ul><li>DevPost is a web application for running hackathons, it makes it easy to aggregate your submissions and to collect valuable team information.</li></ul><p>I personally have no strong preference for either one, but whichever method you choose, be sure that you have a system for collecting information about your participants. It will be useful for the judging process, marketing materials, and future events.</p><h3>Final Presentations</h3><p>Keep your final presentations short and stick to your time limit. For our hackathon, we had a very strict 1 minute time limit. This was perfect for event, it was enough time to quickly demo all of the projects and tell a couple of jokes. It keeps the ceremony from stalling, and from your presenters from rambling on and on. For your event, you might need to give your presenters more time, and that’s okay, just be sure to stick to your predetermined demo time. Your audience will respect you and you won’t eat up too much of everyone’s valuable time.You can check out our final presentations here, <a href="https://www.youtube.com/watch?v=dx6INFO8ACE">Stupid Shit Hackathon Honolulu: Presentations and Awards</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fdx6INFO8ACE%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Ddx6INFO8ACE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fdx6INFO8ACE%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/459da527e3e3eb1e0c6da365806bbcfc/href">https://medium.com/media/459da527e3e3eb1e0c6da365806bbcfc/href</a></iframe><h3>Hackathon Follow Up Guide</h3><h3>Debrief With Your Team</h3><p>After your hackathon is over, be sure to meet up with your organizing team to debrief. Talk about all the things that went well, and write them down, you will be thankful to have these notes the next time you run a hackathon.</p><h3>Write Down Everything That Went Horribly Wrong At Your Event</h3><p>It’ll help you avoid your terrible mistakes again the next year.</p><h3>Do The Math</h3><p>Compute how much the event cost in total and per participant, just to know for next year.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FAXorq76Tg3Vte%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fclassic-film-leslie-caron-AXorq76Tg3Vte&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FAXorq76Tg3Vte%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/298536c1ce08ba2f1a97c0a7eec8d092/href">https://medium.com/media/298536c1ce08ba2f1a97c0a7eec8d092/href</a></iframe><h3>Survey the Attendees</h3><p>Ask the attendees about what they liked and didn’t like. It’ll help you improve your event for next time.</p><h3>Blog About The Event</h3><p>Don’t know how to write up a wrap-up report? <a href="https://hawthornlandings.org/2013/02/15/how-to-writing-an-excellent-post-event-wrap-up-report/">Check out this great guide to writing a report about your tech event</a>. It helped me write my blog post about my Stupid Shit Hackathon.</p><h3>Add Your Submissions To Your Website</h3><p>Something that was important for me at my hackathon, was to put all of the submissions on our website. All to often, I find that hackathon submissions disappear and die the Monday morning following a hackathon. No one ever looks at that project or the code ever again. Something I appreciated about the Stupid Hackathon in New York is that they posted all of the projects with photos, videos, descriptions, links, and authors for all of their projects. It helps promote the event, and helps share the work that people worked so hard on at your event. I know that I have personally loved looking at the amazing projects created at the original Stupid Hack, and is something I wanted to bring to my hackathon. This is also something that I would like to continue doing at all of my future hackathons.</p><p>Do you have more ideas for how to run a hackathon — let me know. This was only my first event, and I know I have lots to learn. Or do you want to brainstorm strategies for how to run your next hackathon? Shoot me a message at joe@callmejoe.net</p><h3>Additional Resources:</h3><ul><li>http://alexeymk.com/hosting-hackathons/</li><li><a href="https://hackathon.guide/">https://hackathon.guide/</a></li><li><a href="http://news.mlh.io/are-hackathon-prizes-the-worst-thing-since-moldy-sliced-bread-04-18-2014">http://news.mlh.io/are-hackathon-prizes-the-worst-thing-since-moldy-sliced-bread-04-18-2014</a></li></ul><h3>Special Thanks</h3><p>Special thanks to all of the people and organizations that helped me with planning the hackathon (In no particular order):</p><ul><li>Ray Farias — Co-Organzier, This wouldn’t have happened without you</li><li><a href="http://alexeymk.com/hosting-hackathons/">J</a>on Borgonia — For helping with the logistics and support</li><li>Kelli Borgonia — For helping helping me stay organized</li><li>Sean Nakamura — For helping me with collecting submissions</li><li>Victor Lee — For helping with getting sponsorships</li><li>Jason Sewell — For his vast hackathon planning experience</li><li>Russell Cheng — For helping Ray and I get prepped for speaking on the radio</li><li>Spencer Toyama — For supporting the event and providing food</li><li>Jesse Thompson — For making trophies and prizes for the hackathon</li><li><a href="http://www.devleague.com/">DevLeague</a> — For hosting the event. You are amazing! (Full disclosure, I work for DevLeague)</li><li><a href="https://sudokrew.com/">Sudokrew</a> — For sponsoring the event. :D</li><li><a href="http://htdc.org/">HTDC</a> — For hosting the space for the hackers</li></ul><p>My name is Joe Karlsson, and I am a Honolulu based full-stack JavaScript instructor and engineer with a passion for exploring the creative potential of technology. You can follow me on:</p><ul><li><a href="https://twitter.com/JoeKarlsson1">Twitter</a></li><li><a href="https://github.com/JoeKarlsson">GitHub</a></li><li><a href="https://www.linkedin.com/in/joekarlsson/">LinkedIn</a></li><li><a href="https://www.instagram.com/joekarlsson/">Instagram</a></li><li><a href="https://www.callmejoe.net/">Website</a></li></ul><p><em>Originally published at </em><a href="https://www.callmejoe.net/i-ran-my-first-hackathon-and-so-can-you/"><em>www.callmejoe.net</em></a><em> on January 30, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77b60187a013" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Complete Guide To Node Client-Server Communication]]></title>
            <link>https://medium.com/@joekarlsson/complete-guide-to-node-client-server-communication-b156440c029?source=rss-de3cfcb5f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b156440c029</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[xhr]]></category>
            <category><![CDATA[servers]]></category>
            <dc:creator><![CDATA[Joe Karlsson]]></dc:creator>
            <pubDate>Mon, 01 Aug 2016 17:14:17 GMT</pubDate>
            <atom:updated>2016-08-01T17:14:17.671Z</atom:updated>
            <content:encoded><![CDATA[<p>After reading <a href="http://chimera.labs.oreilly.com/books/1230000000545/index.html">High-Performance Browser Networking</a> by Ilya Grigorik, I was inspired to implement all of the client-server communication techniques outlined in his book in Node and JavaScript. This post covers the following forms of client-server connection:</p><ul><li>XMLHttpRequest</li><li>Server-Sent Events</li><li>WebSocket</li><li>HTTP/2</li><li>Server to server</li></ul><p>You can check out the complete source code for each implementation <a href="https://github.com/JoeKarlsson1/Complete_Guide_To_Client_Server_Communication">here</a>.</p><p>Before we begin, I should note that there is no one best protocol or API for client/server communication. Every non-trivial application will require a mix of different transports based on a variety of requirements: interaction with the browser cache, protocol overhead, message latency, reliability, type of data transfer, and more. Some protocols may offer low-latency delivery (e.g., Server-Sent Events, WebSocket), but may not meet other critical criteria, such as the ability to leverage the browser cache or support efficient binary transfers in all cases. Here is visualization to help illustrate how XHR, SSE, and WebSockets differ in their implementations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1LzuWqDF3n107sFm.png" /></figure><p>CLIENT SERVER RELATIONSHIP</p><ul><li><strong>XHR</strong> is optimized for “transactional” request-response communication: the client sends the full, well-formed HTTP request to the server, and the server responds with a full response. There is no support for request streaming, and until the Streams API is available, no reliable cross-browser response streaming API.</li><li><strong>SSE</strong> enables efficient, low-latency server-to-client streaming of text-based data: the client initiates the SSE connection, and the server uses the event source protocol to stream updates to the client. The client can’t send any data to the server after the initial handshake.</li><li><strong>WebSocket</strong> is the only transport that allows bidirectional communication over the same TCP connection (Figure 17–2): the client and server can exchange messages at will. As a result, WebSocket provides low latency delivery of text and binary application data in both directions.</li></ul><h3><a href="https://github.com/JoeKarlsson1/Complete_Guide_To_Client_Server_Communication/tree/master/client-server-sockets">WebSocket Client-Server Demo</a></h3><p>WebSockets is a technology, based on the <em>ws</em> protocol, that makes it possible to establish a continuous full-duplex connection stream between a client and a server. A typical websocket client would be a user’s browser, but the protocol is platform independent. It is the closest API to a raw network socket in the browser. Except a WebSocket connection is also much more than a network socket, as the browser abstracts all the complexity behind a simple API and provides a number of additional services:</p><ul><li>Connection negotiation and same-origin policy enforcement</li><li>Interoperability with existing HTTP infrastructure</li><li>Message-oriented communication and efficient message framing</li><li>Subprotocol negotiation and extensibility</li></ul><p>This is a demo shows a demo of a client connecting to a websocket server and sharing data. Here is the server.js of a websocket.</p><pre>&#39;use strict&#39;;</pre><pre>const WebSocketServer = require(&#39;ws&#39;).Server<br>const wss = new WebSocketServer({ port: 8081 });</pre><pre>wss.on(&#39;connection&#39;, ((ws) =&amp;gt; {<br>ws.on(&#39;message&#39;, (message) =&amp;gt; {<br>console.log(`received: ${message}`);<br>});</pre><pre>ws.on(&#39;end&#39;, () =&amp;gt; {<br>console.log(&#39;Connection ended...&#39;);<br>});</pre><pre>ws.send(&#39;Hello Client&#39;);<br>}));</pre><p>Here is the client.js of a websocket.</p><pre>console.log(&#39;open: &#39;);<br>var ws = new WebSocket(&quot;ws://127.0.0.1:8081&quot;);</pre><pre>ws.onopen = function (event) {<br>console.log(&#39;Connection is open ...&#39;);<br>ws.send(&quot;Hello Server&quot;);<br>};</pre><pre>ws.onerror = function (err) {<br>console.log(&#39;err: &#39;, err);<br>}</pre><pre>ws.onmessage = function (event) {<br>console.log(event.data);<br>document.body.innerHTML += event.data + &#39;&amp;lt;br&amp;gt;&#39;;<br>};</pre><pre>ws.onclose = function() {<br>console.log(&quot;Connection is closed...&quot;);<br>}</pre><h3><a href="https://github.com/JoeKarlsson1/Complete_Guide_To_Client_Server_Communication/tree/master/server-side-events">Stream Updates with Server-Sent Events (SSE)</a></h3><p>SSEs are sent over traditional HTTP. That means they do not require a special protocol or server implementation to get working. WebSockets on the other hand, require full-duplex connections and new Web Socket servers to handle the protocol. In addition, Server-Sent Events have a variety of features that WebSockets lack by design such as automatic reconnection, event IDs, and the ability to send arbitrary events.</p><h3>Server-Sent Events vs. WebSockets</h3><p>Why would you choose Server-Sent Events over WebSockets? Good question. One reason SSEs have been kept in the shadow is because later APIs like WebSockets provide a richer protocol to perform bi-directional, full-duplex communication. Having a two-way channel is more attractive for things like games, messaging apps, and for cases where you need near real-time updates in both directions. However, in some scenarios data doesn’t need to be sent from the client. You simply need updates from some server action. A few examples would be friends’ status updates, stock tickers, news feeds, or other automated data push mechanisms (e.g. updating a client-side Web SQL Database or IndexedDB object store). If you’ll need to send data to a server, XMLHttpRequest is always a friend.</p><p>Here is the server.js of our Server Sent Event, we will be sending out data to the client every 5 seconds with an updated timestamp via SSE.</p><pre>&#39;use strict&#39;;</pre><pre>const http = require(&#39;http&#39;);<br>const util = require(&#39;util&#39;);<br>const fs = require(&#39;fs&#39;);</pre><pre>http.createServer((req, res) =&amp;gt; {<br>debugHeaders(req);</pre><pre>if (req.headers.accept &amp;amp;&amp;amp; req.headers.accept == &#39;text/event-stream&#39;) {<br>if (req.url == &#39;/events&#39;) {<br>sendSSE(req, res);<br>} else {<br>res.writeHead(404);<br>res.end();<br>}<br>} else {<br>res.writeHead(200, {&#39;Content-Type&#39;: &#39;text/html&#39;});<br>res.write(fs.readFileSync(__dirname + &#39;/index.html&#39;));<br>res.end();<br>}<br>}).listen(8000);</pre><pre>const sendSSE = (req, res) =&amp;gt; {<br>res.writeHead(200, {<br>&#39;Content-Type&#39;: &#39;text/event-stream&#39;,<br>&#39;Cache-Control&#39;: &#39;no-cache&#39;,<br>&#39;Connection&#39;: &#39;keep-alive&#39;<br>});</pre><pre>const id = (new Date()).toLocaleTimeString();</pre><pre>setInterval(() =&amp;gt; {<br>constructSSE(res, id, (new Date()).toLocaleTimeString());<br>}, 5000);</pre><pre>constructSSE(res, id, (new Date()).toLocaleTimeString());<br>//res.end();<br>}</pre><pre>const constructSSE = (res, id, data) =&amp;gt; {<br>res.write(&#39;id: &#39; + id + &#39;\n&#39;);<br>res.write(&quot;data: &quot; + data + &#39;\n\n&#39;);<br>}</pre><pre>const debugHeaders = (req) =&amp;gt; {<br>util.puts(&#39;URL: &#39; + req.url);<br>for (let key in req.headers) {<br>util.puts(key + &#39;: &#39; + req.headers[key]);<br>}<br>util.puts(&#39;\n\n&#39;);<br>}</pre><p>And here is the client.js which is reference by the index.html on the client side. Notice how the client never sends out a formal request for data with SSE’s. Once the intial connection has been made with the server then the plain text data can be sent to the client as needed!</p><pre>var source = new EventSource(&#39;/events&#39;);<br>source.onmessage = function(e) {<br>document.body.innerHTML += e.data + &#39;&#39;;<br>};</pre><h3><a href="https://github.com/JoeKarlsson1/Complete_Guide_To_Client_Server_Communication/tree/master/xhr">XMLHttpRequest (XHR)</a></h3><p>XMLHttpRequest (XHR) is a browser-level API that enables the client to script data transfers via JavaScript. XHR made its first debut in Internet Explorer 5, became one of the key technologies behind the Asynchronous JavaScript and XML (AJAX) revolution, and is now a fundamental building block of nearly every modern web application.</p><blockquote><em>XMLHTTP changed everything. It put the “D” in DHTML. It allowed us to asynchronously get data from the server and preserve document state on the client… The Outlook Web Access (OWA) team’s desire to build a rich Win32 like application in a browser pushed the technology into IE that allowed AJAX to become a reality. — Jim Van Eaton Outlook Web Access: A catalyst for web evolution</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z7iLEDVToDLrzN-o.png" /></figure><p>Here I am running a simple Express server with a simple route to send requested data to the Client.</p><pre>&#39;use strict&#39;;</pre><pre>var express = require(&#39;express&#39;);<br>var app = express();</pre><pre>app.use(express.static(`${__dirname}/public`));</pre><pre>app.get(&#39;/api&#39;, function(req, res){<br>res.send((new Date()).toLocaleTimeString());<br>});</pre><pre>app.listen(3000);</pre><p>Here is the javascript file linked to my index.html on the client side. I am using the baked in XHR methods as opposed to jQuery since I love to use vanilla JavaScript whenever possible.</p><pre>&#39;use strict&#39;</pre><pre>function reqListener (data) {<br>document.body.innerHTML += this.responseText + &#39;&amp;lt;br&amp;gt;&#39;;<br>}</pre><pre>setInterval(function () {<br>var oReq = new XMLHttpRequest();<br>oReq.addEventListener(&quot;load&quot;, reqListener);<br>oReq.open(&quot;GET&quot;, &quot;/api&quot;);<br>oReq.send();<br>}, 3000);</pre><p>In my Github repo, I cover two more use cases not referenced here, server to server communications and HTTP/2. If you are curious about those forms of communication check it out. One word about HTTP/2 before wrapping up. HTTP/2 is the future of Client-Server communication, but it is a protocol built on top of HTTP/1.1 which means that all of these forms of communicating will be still be relevant in the future, just the means that they are transmitted will be updated.</p><p>As you can see there are a ton of different ways you can send data between a client and server. Before working on this project, I had no idea how many different ways were available in vanilla JavaScript for moving data around. Did I miss anything or you see something that needs to be fixed? Let me know in the comments below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b156440c029" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Relationship With The Internet]]></title>
            <link>https://medium.com/@joekarlsson/my-relationship-with-the-internet-55adad56c281?source=rss-de3cfcb5f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/55adad56c281</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[facebook]]></category>
            <dc:creator><![CDATA[Joe Karlsson]]></dc:creator>
            <pubDate>Fri, 22 Apr 2016 22:15:35 GMT</pubDate>
            <atom:updated>2016-04-22T22:15:35.819Z</atom:updated>
            <content:encoded><![CDATA[<p>My Relationship With The Internet</p><p>There have been a lot of articles recently published about how the internet, social media, and smart phones are killing ‘real human connections.’ I however believe that this a reactionary knee jerk to a changing social landscape.</p><p>Virtual connections are not a replacement for real vulnerable and intimate relationships, and no has claimed that they are. Virtual relationships or relationships supported by the internet are just a new form of relationship that we haven’t seen before. This does not make them bad, it just makes it new and different, and that’s okay. Trying to make a virtual relationship fit into the traditional relationship model is like fitting a iPhone charger into an old rotary phone, it just doesn’t fit and you need to get a new model.</p><p>Now, don’t get me wrong, I do believe that the internet can be abused, and can become a replacement for human interaction. But, to let these cases distract us from the good that can come from the internet would be a disservice to humanity. It’s important to keep in mind that we still live in an age where the internet is still in it’s infancy. We have no idea what might come in the future if we let allow the internet to grow and breathe.</p><p>So, what do you think? Is the internet killing our relationships? Has the internet brought you closer to your friends and family, or is it splitting you apart?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55adad56c281" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bechdel Test Script Parser — How It Works]]></title>
            <link>https://medium.com/@joekarlsson/bechdel-test-script-parser-how-it-works-90c076f127b0?source=rss-de3cfcb5f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/90c076f127b0</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[bechdel-test]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Joe Karlsson]]></dc:creator>
            <pubDate>Sat, 19 Dec 2015 07:15:54 GMT</pubDate>
            <atom:updated>2016-04-22T22:33:52.597Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://bechdel-test.herokuapp.com/">The Bechdel Test Script Parser</a> was a collaborative digital humanities project between myself and my sister, Laurel Karlsson. It is the product of a shared passion for film, feminism, and the creative potential of technology. By combining the talents and interests of myself, a software engineer, and my sister, a English Scholar, we’ve been able to create an innovative data mining tool for film analysis that we hope to continue to work on and improve. You can check out the project on our <a href="https://bechdel-test.herokuapp.com/">website</a>, and the open source code can be viewed <a href="https://github.com/JoeKarlsson1/bechdel-test">here</a>.</p><p>This project was born when my sister reached out to me for advice on a few ideas she had been mulling over for a digital humanities project. Hoping to do something related to feminist film analysis, she was feeling very limited by her lack of coding experience and hadn’t been able to find an existing data mining tool to accomplish what she was looking to do. I immediately offered up my coding expertise, looking to gain experience by building a tool from scratch which would accomplish the specific needs of the project. After brainstorming several different project ideas, we settled on the one you see here.</p><h3>How It Works</h3><p>Of all narrative textual forms, the motion picture screenplay may be the most perfectly pre-disposed for computational analysis <a href="http://www.digitalhumanities.org/dhq/vol/8/4/000190/000190.html">[Murtagh, Ganz, and Reddington 2011]</a>. Screenplays contain capitalized character names, indented dialogue, and other formatting conventions that enable an algorithmic approach to analyzing and visualizing film narratives <a href="http://www.digitalhumanities.org/dhq/vol/8/4/000190/000190.html">[Hoyt, Ponto, Roy]</a>. Coupled with massive online movie databases, we can parse through movie scripts and collect insights on a level not yet seen before. In this blog post, I introduce our new web app, Bechdel Test Visualizer, which parses screenplays, outputs statistical gender values which can be analyzed, and offers four different types of visualization, each with its own utility. In this analysis, my sister and I use the Bechdel Test Visualizer to analyze the 2014 Oscar Best Picture Nominees.</p><p>In the process of building this tool’s prototype, I have come to appreciate the many ways that a computer reads a screenplay differently from you or me. Humans gather insight from watching and experiencing the emotion, tension, and dynamics of a movie or screenplay. Rather than attempting to train a computer to understand a film in the exact same way I do, I would prefer to ask a computer to do tasks that it is designed to do well and that we humans struggle with. Humans have memory limitations when it comes to matters of sequential timing and the entrances and exits of dozens of characters. In contrast, computers are excellent at gathering and recording these sorts of details from structured texts<a href="http://www.digitalhumanities.org/dhq/vol/8/4/000190/000190.html">[Murtagh, Ganz, and Reddington 2011]</a>. Lev Manovich has suggested that one of the most valuable things that comes from combining computational analysis and the visualization of vast amounts of information in a single image is that it defamiliarizes our understanding of the works that we study in the Humanities <a href="https://sc.edu/about/centers/digital_humanities/future_knowledge_archive/manovich_videopage.php">[Manovich 2012]</a>. As I hope to demonstrate, the Bechdel Test Visualizer is a powerful tool for defamiliarization, provoking new questions and gender and film, and producing new answers through the combined strengths of the human analyst and the computer.</p><h3>Parsing Method</h3><p>The Bechdel Test Visualizer is web application built entirely using JavaScript and Node.js. This tool uses a combination of online databases manual script parsing in order to collect insights about a film.</p><p>First, the script finds the title of the film, this is generally on the first page, and for the prototype, it is required to be the first line of text in the txt file. Once the title of the film has been identified, I make an API call out to <a href="http://api.myapifilms.com/imdb.do">myapifilms.com</a>. From here, I can collect general information about the film, such as genre, release year, runtime, etc. But the most important information comes from collecting information about the actors and actresses in the film. Using this API, I can collect a list of all of the actors and actresses, their character’s name in the film, and what gender they are. The character’s gender is the most important bit of information I can collect, since it is essential when trying to determine if a scene passes the bechdel test or not.</p><p>Once all of the gender and film data has been collected via the API — I can begin analyzing the script. The first step is to break the script down into scenes in order to tell if two females shared a scene together. Scenes were determined by looking for a user defined set of keywords, such as “int.” or “ext.”. In practice, it was determined that a list of 10–12 keywords well captured scene changes.</p><p>In the scene, I collected dialogue by character by using simple parsing techniques. I was then able to test if two female character’s shared a scene. If two or more females shared a scene together, I tested their dialogue by checking if their dialogue contained keywords that indicated that they were speaking about a men or men. This list included words like ‘He’, ‘Him’, ‘Father’, ‘King’, etc. This list is very basic, and after initial tests, I can see that this list needs additional work, as patriarchal words are very ingrained in the English Language, and judging context is very difficult for a computer to do. However, for the context of my experiments, this list has sufficed. This tool, however is very good at generating data on gender participation in films.</p><p><em>Originally published at </em><a href="https://www.callmejoe.net/bechdel-test-script-parser-works/"><em>www.callmejoe.net</em></a><em> on December 19, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90c076f127b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Find a Technical Co-founder]]></title>
            <link>https://medium.com/@joekarlsson/how-to-find-a-technical-co-founder-e45b0f091e0a?source=rss-de3cfcb5f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e45b0f091e0a</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[technical-cofounder]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <dc:creator><![CDATA[Joe Karlsson]]></dc:creator>
            <pubDate>Fri, 10 Jul 2015 05:18:44 GMT</pubDate>
            <atom:updated>2016-04-22T22:32:19.701Z</atom:updated>
            <content:encoded><![CDATA[<p>Okay, so you have an idea for a new company, and you just know that Facebook for cats is the next billion dollar idea. The only issue is that you have no idea how to code. You heard from your aunt that you have a cousin that lives in Mississippi who works for some tech company, but besides that you have no idea who to turn to. So how do you find the elusive technical cofounder you need to help you launch your business?</p><p>I get approached all the time by “idea people” who have a billion dollar idea they would like to work with me on. They tell me that they have the hardest part (the idea) all figured out, now all they need is a code monkey to slam out their platform for them in a couple of hours for them. This is also the part where they casually mention that they also do not have money right now, but they would love to buy me a case of beer or give me 2% equity. “How generous this smart entrepreneur is to cut me into their obviously well thought out idea!” I think to myself, before accepting their unbeatable offer, pressing three buttons on my laptop and launching their platform on to the world wide web, where I go on to make millions of dollars and retire in Hawaii.</p><p>Now, of course this never happens, and it’s crazy that I get approached by people on such a regular basis who appear to think this is how launching a tech company actually works. No joke, these are real CraigsList ads I have run into in the wild.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*R6ppkSB8xEOPYWPmbqdSng.jpeg" /></figure><p>Now, do not get me wrong, I love hearing people’s ideas for businesses, and I want to be approached by people considering starting a business. But, if you want me to help you launch your business you should know somethings first. Here are my tips on how to find a technical co-founder.</p><h3>Get Out And Start Meeting People</h3><p>First things first, how the heck to find these nerds? I would suggest networking. Most of my successful partnerships have grown from meeting people IRL. And there are some great places that you can go to start rubbing elbows with potential technical co-founders. One of the best events I have been too for meeting co-founders is at Startup Weekend. They run in most major cities at least once a year and it attracts some really intelligent entrepreneurs, including technical co-founders. If you want to know more about Startup Weekend, check out my blog post <a href="http://www.callmejoe.net/10-things-i-learned-at-startup-weekend/">here</a>.</p><p>I would also recommend checking out local <a href="http://www.meetup.com/">Meetups</a>. Look for a Meetup around you about Entrepreneurialism or learning how to code. These are a gold mine for finding like mind people. Lastly, you cold check out other organizations like <a href="http://www.codeforamerica.org/">Code For America</a>, they regularly host civic hackathons that need both technical and non technical types. The point is, you have to get out and starting looking for people.</p><p>Okay, so now you’ve met someone who you think might be a good fit for your business, how do you convince them to join you and help you launch your business?</p><h3>Sell Your Value</h3><p>What makes you different from the other entrepreneurs? What are you bringing to the table, besides you idea, that will help us launch the business? Do you have a sales background and have a ton of contacts? Do you work in marketing and you already have a plan for our product to get huge market reach? Have you launched a business before and have already learned some hard lessons about starting a business? Basically, I want to know what you will be doing, while I sit at home every weekend for the next couple of weeks working on your business platform. I want to work with someone who is willing and able to fully invest themselves into helping launch their business. If you seem washy about your commitment and value, I’m probably going to pass and work with someone else.</p><h3>Prove Your Idea</h3><p><a href="http://joel.is/">Joel Gascoigne</a>, CEO of <a href="https://buffer.com/app">Buffer</a>, did something awesome before he built out the Buffer platform. First, he built a simple, non-working, landing page for Buffer. He blasted his network announcing his new product and collected email address of people who would be interested in signing up for his service. When people went to the site to sign up, they got a message that said, “Sorry, our platform isn’t quite finished yet. If you want to know when Buffer will be launched, enter your email address below.” He collected hundreds of email addresses from interested potential users and he used this information to market test his ideas, and to show interest in his idea with potential business partners and investors. After he had a team, and could show interest in his product, he started building out the platform, and the rest is history.</p><h3>Show Me The Money</h3><p>Equity in a future company is great, but I think offering equity without an immediate monetary payment for services is really disrespectful to a developer. Equity only transactions may work in some cases, but to get my attention, it helps to have some money available. Also, if an entrepreneur comes to me ready to put his money where his mouth is, it really shows me that they sincerely believe in their idea and are willing to put in the time, sweat, and of course money, to launch a startup.</p><h3>Some Miscellaneous Tips:</h3><p><strong>Don’t Hire a kid straight out of college to build your site for you</strong>, if you want to bring something valuable to the marketplace, you are going to need more than a $50 static HTML page that some kid from State College, that you found on Craigslist. Software and Web Development is a trade that takes years to learn and if you want to produce a product of value, find someone that is capable of producing something great.</p><p>Relatedly, while I think everyone should learn a little bit about how software works (especially founders of tech companies), <strong>I think it’s generally a bad idea to learn how to code in order to build out your first company</strong>. Attempting to build out a platform with no prior experience is probably a bad idea. I look back on my early tech projects and I would be terrified if I had to scale a business based those platforms. It would be a serious mess.</p><p>One last thing, I have noticed that many people believe that finding a technical cofounder will solve all of their company’s issues. Let me tell you that <strong>a technical cofounder will not fix all your problems</strong>. In my personal experience, if a company is struggling the issue most likely runs deeper than their website. Also, a technical cofounder is likely to bring up a thousand new issues that will need to be addressed.</p><p>If you have some tips for entrepreneurs trying to find a technical cofounder, let me know in the comments below. Thanks for reading!</p><p><em>Originally published at </em><a href="https://www.callmejoe.net/how-to-find-a-technical-co-founder/"><em>www.callmejoe.net</em></a><em> on July 10, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e45b0f091e0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>