<?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 Just Chris on Medium]]></title>
        <description><![CDATA[Stories by Just Chris on Medium]]></description>
        <link>https://medium.com/@jsborked?source=rss-4a03b815672d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gFNa764NRxwdIuvC.jpg</url>
            <title>Stories by Just Chris on Medium</title>
            <link>https://medium.com/@jsborked?source=rss-4a03b815672d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 12 Nov 2026 08:27:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jsborked/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[Great Scrambled Eggs]]></title>
            <link>https://medium.com/@jsborked/great-scrambled-eggs-9eec59fb2c5d?source=rss-4a03b815672d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9eec59fb2c5d</guid>
            <category><![CDATA[recipe]]></category>
            <dc:creator><![CDATA[Just Chris]]></dc:creator>
            <pubDate>Sat, 09 Feb 2019 18:42:22 GMT</pubDate>
            <atom:updated>2019-02-09T18:42:22.860Z</atom:updated>
            <content:encoded><![CDATA[<h3>Scrambled Eggs</h3><p>3 Pasture raised eggs<br>3 tbs pasture or grass butter<br>3 tbs plain yogurt<br>3 tbs green onion<br>Salt, Pepper</p><p>Beat eggs, butter, yogurt with a mixer until fluffy<br>Pour into moderately hot skillet<br>Mix with wooden spoon while taking pan on and off heat<br>Just before cooked and fluffy, add onion, salt, pepper</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9eec59fb2c5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Its time to get real about YOUR private keys]]></title>
            <link>https://medium.com/hackernoon/its-time-to-get-real-about-your-private-keys-87c1460b8bd5?source=rss-4a03b815672d------2</link>
            <guid isPermaLink="false">https://medium.com/p/87c1460b8bd5</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Just Chris]]></dc:creator>
            <pubDate>Tue, 20 Mar 2018 21:54:39 GMT</pubDate>
            <atom:updated>2019-05-16T08:51:17.557Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kyC0RvJLKH5Hf29PEgnVVA.jpeg" /></figure><p>Governments everywhere in the world are demanding the right to <a href="https://hackernoon.com/tagged/de">decrypt</a> communications. Every service provider can be expected at some point, to comply.</p><p>As long as any centralized system keeps your secrets it has to be considered insecure.</p><p>Only a system where you alone maintain your key, is necessary for any reasonable assumption of safety.</p><p>Nevertheless, security measures in 2018 are still difficult to understand and operate for the non-technical person.</p><p><a href="https://github.com/digplan/simplesign">Simplesign </a>is an effort to simplify and leverage the very basic essentials of public/private key usage. It’s principles are:</p><p>Easy to use<br>Easy to embed<br>No shared secrets</p><p>In <a href="https://hackernoon.com/tagged/development">development</a> and any contributions consistent with the project goals are welcome.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87c1460b8bd5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/its-time-to-get-real-about-your-private-keys-87c1460b8bd5">Its time to get real about YOUR private keys</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[On the trail of the 2016 election troll-bots]]></title>
            <link>https://medium.com/@jsborked/on-the-trail-of-the-2016-election-troll-bots-9fffae7cf4d6?source=rss-4a03b815672d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fffae7cf4d6</guid>
            <category><![CDATA[2016-election]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[twitter]]></category>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[elections]]></category>
            <dc:creator><![CDATA[Just Chris]]></dc:creator>
            <pubDate>Fri, 16 Feb 2018 21:55:25 GMT</pubDate>
            <atom:updated>2018-02-16T21:55:25.818Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.cnbc.com/2018/02/16/russians-indicted-in-special-counsel-robert-muellers-probe.html">Russians indicted in special counsel&#39;s probe for operations allegedly supporting Donald Trump in election</a></p><p>The announcement of the indictments in trolling to influence the 2016 election is not only a big political story, but a big tech story. Now, there’s major legal action about something that’s been going on for a long time.</p><p>It brings to the forefront major new ethical and political matters which have been unleashed by the connecting of the world. Hopefully, this will encourage debate about some important issues facing us. We have had some discussions about privacy, and beginning to experience the backlash against the tech titans. But a knee-jerk reaction against the latest powers-that-be (big-tech) or a superficial debate on privacy or the influence of social media won’t cut it long-term.</p><p>We need to reaffirm, and if necessary re-evaluate, what our values really are. What kind of world we want to live in, and what changes are necessary. Everyone would agree we need <em>some </em>changes.</p><p>I was researching Twitter using their APIs during the election and the trolls were out in force.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*MK6F8ziFHXfuvCVr0cUs-w.png" /></figure><p>This is why nuance and thoughtful debate is good. Not tweets. Pouring gas on a fire is the easiest thing to do.</p><h3>Liz on Twitter</h3><p>Chelsea Manning deserves transition treatment, and your taxes should pay for it</p><p>Retweets we’re especially suspect in my experience, and there were many thousands every time Trump got going. But, proving “collusion”, in these matters is always a waste of effort, unless one makes a serious mistake — such as recording oval office conversations and letting those tapes get out!</p><p>The ability of sympathizers to act on their own gives the leader deniability. This cannot be overcome and the proof cannot be gotten. Without a serious error, collusion can’t be proven.</p><p>So, why hasn’t Twitter purged all the bots. Granted some are more obvious than others, but creating bots is much like hacking. As soon as you mount a solid defense, the hackers develop a new technique, and its a never ending game.</p><p>AI, of course will make it even easier to fake being human. But where’s the AI to detect bots?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fffae7cf4d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drop Your Hosting Provider With Cloudflare Warp]]></title>
            <link>https://medium.com/hackernoon/drop-your-hosting-provider-with-cloudflare-warp-ba704bbd8f09?source=rss-4a03b815672d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba704bbd8f09</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Just Chris]]></dc:creator>
            <pubDate>Sat, 03 Feb 2018 16:33:00 GMT</pubDate>
            <atom:updated>2019-05-16T08:51:18.363Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HlksjfjEkIdqpZYGTcaSGQ.jpeg" /></figure><p>Who needs AWS or hosting charges? With <strong>Cloudflare Warp</strong>, you can get a server up and running in your home in minutes. All without DNS or DMZ configuration or bulky frameworks.</p><p>Just run your web server of choice on your machine, and Warp handles serving it up through Cloudflare. Warp is a new feature which (at time of this writing) is currently in beta.</p><p>This frees us from having to get a host. In the past, just running on your home <a href="https://hackernoon.com/tagged/network">network</a> required opening ports on your firewall. An easy thing to screw up.</p><p>Also, by now (2018) everyone should be running <strong>ONLY HTTPS.</strong></p><p>Configuring HTTPS has gotten easier over the past few years, but the great thing with Warp, you just run your site as an HTTP server and Cloudflare handles the rest.</p><p>Let’s get started.</p><p>First, we’ll use <strong>httpsd</strong>, which has binaries for Linux, Win, and Mac.</p><p><a href="https://github.com/digplan/httpsd">digplan/httpsd</a></p><p><strong>httpsd </strong>is an instant-on web server, whose output is generated by a provided shell script.</p><p>Make the shell script, which will be called index.sh here:</p><pre>cat index.html</pre><p>and our index.html</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;h1&gt;Hello World&lt;/h1&gt;</pre><p>and start it up!</p><pre>./httpsd ./index.sh --insecure --port=8080</pre><p>Using the *— insecure* flag will start an http instead of an https server, which is ok, because Cloudflare is going to handle the https in a very easy way.</p><p>You can use any web server. For instance, there is Simple HTTP Server for Python:<br><a href="http://www.pythonforbeginners.com/modules-in-python/how-to-use-simplehttpserver/">http://www.pythonforbeginners.com/modules-in-python/how-to-use-simplehttpserver/</a></p><p><strong>Cloudflare Warp</strong><em>,</em> is just a simple binary, that tunnels to <a href="https://hackernoon.com/tagged/cloudflare">Cloudflare</a> servers, and serves up your site.</p><p><a href="https://www.cloudflare.com/products/cloudflare-warp/">Cloudflare Warp | Cloudflare</a></p><p>I’ve changed the name of the binary to just <em>warp</em>, which makes things even simpler. With our domain name servers hosted with Cloudflare, we just start it up.</p><pre>$ ./warp --hostname=www.mydomain.com --url http://localhost:8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*T5Bc1AgcE3bNTc-bxyD5ww.jpeg" /></figure><p>and that’s it, hosting made simple.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba704bbd8f09" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/drop-your-hosting-provider-with-cloudflare-warp-ba704bbd8f09">Drop Your Hosting Provider With Cloudflare Warp</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn CI: Automated Test and Publish in 10 min]]></title>
            <link>https://medium.com/hackernoon/learn-ci-automated-test-and-publish-in-10-min-3096717dc81e?source=rss-4a03b815672d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3096717dc81e</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Just Chris]]></dc:creator>
            <pubDate>Sun, 31 Dec 2017 19:33:08 GMT</pubDate>
            <atom:updated>2019-05-16T08:51:18.889Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMph3SZGT__5z5jAPMkHvw.png" /></figure><h4>Here’s a template to get up and running for automated testing and publishing of JS client or server code</h4><p>There are a lot of dependencies out there. Clearly, the world <em>needs </em>more automated tests. But, we need to get up and running quickly.</p><p>Goals:<br>Must be free, as in money<br>Must have tiny <a href="https://hackernoon.com/tagged/learning">learning</a> curve, few magic words to learn!<br>Must be UI free. Test client code using headless Chrome<br>Use Travis CI for automated testing, with pass/fail badge in github<br>Run tests on every commit<br>Easy publish to NPM and memorable URL for including scripts in web pages</p><p><em>So, on every commit to the github repo</em>:</p><ol><li>Travis CI will start up its testing instance</li><li>Install the latest Node version, and Chrome browser</li><li>Start Chrome for headless testing <br>(only needed for projects that are client JS)</li><li>Run two example test scripts. One for testing server apps, and one for browser JS<br>(One of these can be eliminated depending on whether yours is a node app, or client script)</li><li>Show result of testing</li><li>Publish to NPM if successful</li><li>Show pass/fail badges for the project in NPM and <a href="https://hackernoon.com/tagged/github">github</a>.</li></ol><p>You can add/remove to this as needed, depending on the needs of your project.</p><p><strong>Here’s all the files</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*N0-5i7eX1WfcvRI2qiU3Rw.jpeg" /></figure><p>For Travis CI, which will host the testing, just a <strong>.travis.yml</strong> file is needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*bHH_Kjl1oJGC07LvGOnIog.jpeg" /></figure><p>If the project is a Node app and not client JS, you don’t need the Chrome parts.</p><p>It will also publish to npm. For client scripts, we can use a short, easy to remember link using unpkg.com</p><p>No fancy testing frameworks to learn here. We simply write our test scripts, which throw errors on failure.</p><p>The testing framework is <em>as follows</em>, any native error constitutes a failed test.</p><p>For Node applications, <strong>test-server.js</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*AVQxUXKswWgK6Ef1aosqwA.jpeg" /></figure><p><strong>main.js</strong> is the main file in the app. What is being tested. <br>If we had called test_fail, the test would fail and Travis would tell us so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*1JNYaqvNAYBdEtVTQ5kK8Q.jpeg" /></figure><p><strong>test-browser.js </strong>for client scripts. <br>Since we really want to automate things, we can’t have a UI. No-one will be around to click things. So, headless chrome is used to run tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*sRz8J_5nrPROoHQSayvc9g.jpeg" /></figure><p><strong>testchrome</strong>, is just a simple wrapper on the chrome remote interface used for headless testing.</p><p>testchrome happens to use a simplified API, just <br>.evaluate (JS in the browser) <br>.get (JSON from a URL)</p><p>Alternately, you can use the other headless Chrome testing modules that are available, like puppeteer.</p><p>Getting this setup locally on a machine can be unpleasant. Travis CI really shines here!</p><p>Going to travisci.org (for public repos), and follow the instructions to set up your repo. Connect your Travis CI acct to github, and specify your repo for testing.</p><p>There is one configuration needed on Travis, your NPM token which will let Travis publish the app, in Settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*bXNKb-4Th6efipZ7qzz0ew.png" /></figure><p>Then just commit to the repo, or use the console, to start a test.</p><p>Monitor your test in the Travis console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VbB-z_-97TJ6HfXU-TsJow.png" /></figure><p>and view results</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*gSKvcBrNKaOutqGFcGj3FQ.jpeg" /></figure><p>One last thing, the badge. In the README.md of the repo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*1WOKUE-gfCWDTW69oZRP0Q.png" /></figure><p>which always shows our passing/failing badge in NPM and Github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*CptzB0xXlebdCT1fJmSp9g.png" /></figure><p>Finally, we need an easily remembered URL (for client scripts). Using unpkg.com with no additional config required, cause it will pull the latest from NPM.</p><pre>&lt;script src=//unpkg.com/reponame &gt;&lt;/script&gt;</pre><p>Of course, for server apps, simply</p><pre>npm install reponame</pre><p>That’s it, for our framework that provides automated testing and publish. Please comment with any thoughts or suggestions. The example repo is at <a href="https://github.com/digplan/learn-ci">https://github.com/digplan/learn-ci</a></p><p>Happy testing!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3096717dc81e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/learn-ci-automated-test-and-publish-in-10-min-3096717dc81e">Learn CI: Automated Test and Publish in 10 min</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Friday Night Manifesto for Better Web Development]]></title>
            <link>https://medium.com/hackernoon/friday-night-manifesto-for-better-web-development-11183cdd8b63?source=rss-4a03b815672d------2</link>
            <guid isPermaLink="false">https://medium.com/p/11183cdd8b63</guid>
            <category><![CDATA[web-development-manifesto]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[js]]></category>
            <dc:creator><![CDATA[Just Chris]]></dc:creator>
            <pubDate>Sat, 02 Dec 2017 02:55:29 GMT</pubDate>
            <atom:updated>2017-12-02T16:08:47.720Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Friday Night Manifesto for Better Web Development</strong></p><p>Over time, all software gets bigger and does not necessarily get better.</p><p>Current web development tools and processes have made a web that is too hard to build, debug, and support. A myriad of tools is suggested.</p><p>Web applications evolved out of static web pages. Not recently, but almost immediately in the 1990s. The need for dynamic web apps is nothing new.</p><p>But, as happened with other software, as computing resources and network speeds increased from the mid 1990s to the mid 2010s, they got bigger and more complex.</p><p>Security vulnerabilities are rampant, and given the importance of the web in global communication and commerce, is more dangerous than ever.</p><p>This is not acceptable.</p><p>Larger and more complex applications mean more security problems.<br>Larger and more complex applications cost more, in every way.</p><p>The world is now seeing the birth of the 2nd generation of Internet technicians and programmers, who need a dozen different unproven tools.</p><p>In many applications, you can’t simply just read HTML source and make any sense of it. Or you need a build step(s). Text into text. Into text.</p><p>Web components do not enjoy widespread use. You can’t easily reuse components like dropping them on a form without expensive and opinionated overhead.</p><p>New frameworks proliferate, because many are not satisfied with what’s available.</p><p>People will say, the needs have gotten more complex. But unnecessary complexity has outpaced requirements complexity for years.</p><p>Every new tool to learn is a barrier.</p><p>New technologies are promising, but HTML CSS and JS are fundamental to the web. Maybe they’ll be replaced but not soon.</p><p>This is not acceptable and needs to be reformed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11183cdd8b63" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/friday-night-manifesto-for-better-web-development-11183cdd8b63">Friday Night Manifesto for Better Web Development</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s make Reusable Web Components: Google Maps]]></title>
            <link>https://medium.com/hackernoon/lets-make-reusable-web-components-google-maps-8be7577d925?source=rss-4a03b815672d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8be7577d925</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[webdev]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[google-maps]]></category>
            <dc:creator><![CDATA[Just Chris]]></dc:creator>
            <pubDate>Thu, 16 Nov 2017 02:42:26 GMT</pubDate>
            <atom:updated>2019-05-16T08:51:19.395Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*z7CxR54DFNvEF1p-a1bv2w.jpeg" /></figure><p>A great struggle in moving web dev forward, is the lack of a complete consensus on web components.</p><p>This is evidenced by the fact there are frameworks all over, each with their overhead and own ideas, and some common <a href="https://hackernoon.com/tagged/ui">UI</a> components are still developed from scratch.</p><p>This is to be expected though, since Frameworks force you into their world, so while a React or Vue component is reusable, you must commit to that framework. Some of us have issues with commitment.</p><p>There’s shrinks for that, but they often don’t fix anything.</p><p>There is the <strong>Web Components</strong> standard, born out of the fact that jamming together HTML/JS/CSS is conceptually quite unpleasant.</p><p>For instance, we can put <a href="https://hackernoon.com/tagged/google">Google</a> Maps on our page, as their tutorial instructs.</p><pre>&lt;div id=”map”&gt;&lt;/div&gt;</pre><pre>&lt;script&gt;<br> function initMap() {<br>  // Create a map object and specify the DOM element for display.<br>  var map = new google.maps.Map(document.getElementById(‘map’), {<br>    center: {lat: -34.397, lng: 150.644}, zoom: 8<br>    });<br> }<br>&lt;/script&gt;<br>&lt;script src=”<a href="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&amp;callback=initMap">https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&amp;callback=initMap</a>&quot; async defer&gt;&lt;/script&gt;</pre><p>But, is exactly the point. It’s <em>on our page</em>, <strong>not</strong><em> in our app</em>.</p><p>Of course its a problem of needing the script to load before we use the <em>google.maps</em> object. The script tag should be after the HTML. It’s not nice.</p><p>In a world where we probably need many components on the page, we’re stuck with initMap as our entry point. We’re probably loading other scripts, etc.. Gets messy.</p><p>So, let’s try a different approach. We have to load JS dynamically.</p><pre>var e = document.createElement(‘script’)<br>e.src = s; <br>document.body.appendChild(e)</pre><p>For simplicity, we’ll go ahead and call this function load.</p><pre>const load = async (s) =&gt; {<br>  return new Promise(async r=&gt;{<br>   for(i=0;i&lt;document.scripts.length;i++)<br>     if(document.scripts[i].src == s) return r()<br>   let e = document.createElement(&#39;script&#39;)<br>   e.src = s <br>   document.body.appendChild(e)<br>   e.onload = r<br>  })<br>}</pre><p>This promise gets fulfilled when the script has loaded. It also checks first, to see if the script has already been loaded.</p><p>So, now we may make our reusable component, a gmap function:</p><pre>const gmap = async (e) =&gt; {<br>  return new Promise(async r=&gt;{<br>     e.style.height = e.style.width = e.getAttribute(&#39;size&#39;)<br>     let latlng = e.getAttribute(&#39;latlng&#39;).split(&#39;,&#39;)<br>     await load(&#39;<a href="http://maps.googleapis.com/maps/api/js?v=3&#39;">http://maps.googleapis.com/maps/api/js?v=3&#39;</a>)<br>     let map = new google.maps.Map(e, {<br>      center: new self.google.maps.LatLng(latlng[0], latlng[1]),<br>      zoom: 14,<br>      mapTypeId: google.maps.MapTypeId.ROADMAP<br>     });<br>     r(map)<br>  })<br>}</pre><p>This is an async function, which will await the load script to complete. This will ensure everything gets done in order. We may want to have multiple maps on a page.</p><pre>&lt;div control=gmap size=200px latlng=33.808678,-117.918921&gt;&lt;/div&gt;<br>&lt;div control=gmap size=200px latlng=28.3852377,-81.5660627&gt;&lt;/div&gt;</pre><p>and feed the Divs to the gmap “component” to create the controls</p><pre>(async () =&gt; {<br>  let controls = document.querySelectorAll(‘div[control=gmap]’)<br>  for (var i = 0; i &lt; controls.length; i++)<br>    await gmap(controls[i])<br>})()</pre><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fjsfiddle.net%2F08h0yzxL%2F&amp;src=https%3A%2F%2Fjsfiddle.net%2F08h0yzxL%2Fembedded%2F&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=jsfiddle" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3ba70a491e62a7d79da0352a777360a/href">https://medium.com/media/a3ba70a491e62a7d79da0352a777360a/href</a></iframe><p>All dependency-free and in vanilla JS.</p><p>The important thing here, there’s very little to remember. <br>Div, Function, and language features.</p><p>Not sure which model will win out, but it is possible to just use the language without the extras, and fun too.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8be7577d925" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/lets-make-reusable-web-components-google-maps-8be7577d925">Let’s make Reusable Web Components: Google Maps</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s make a JavaScript Wait function]]></title>
            <link>https://medium.com/hackernoon/lets-make-a-javascript-wait-function-fa3a2eb88f11?source=rss-4a03b815672d------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa3a2eb88f11</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es7]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Just Chris]]></dc:creator>
            <pubDate>Sat, 11 Nov 2017 14:48:05 GMT</pubDate>
            <atom:updated>2019-05-16T08:51:20.510Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QtrfvQ_JAJO7RoQys0jjtg.jpeg" /></figure><p>Async/await and its underlying use of promises are taking the JS world by storm. Now supported by a majority of client and server <a href="https://hackernoon.com/tagged/js-platforms">JS platforms</a>, callback <a href="https://hackernoon.com/tagged/programming">programming</a> is becoming a thing of the past.</p><p>Surely, callback based programming is ugly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*RcuvxRaseJDfG-fRlDbSIA.jpeg" /></figure><p>If you haven’t already, it’s worth getting your mind around async/await and promises. I personally haven’t been a huge fan of promises, before async/await, as you can get code like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*aZ35C3n3Tot22E6Phcq4AA.png" /></figure><p>Better than callback hell, but not <strong>aesthetically pleasing.</strong></p><p>There are many good intros to async/await available, so I won’t go into a full discussion here, but the 15 sec. tutorial is, you have your function return a <em>promise</em>, and then use await (inside an async function) to call the promise.</p><p>These examples will also make use of a new-ish JS feature, arrow functions. <br>If you’re unfamiliar with writing in this style, basically this:</p><p><strong>function(a) { return console.log(a) }</strong></p><p>now use this,</p><p><strong>(a) =&gt; console.log(a)</strong></p><p>With that, we are ready to make our Wait function.</p><p>Using a Wait function, also called <em>Sleep </em>in some environments, is very easy to understand, read, and write. It’s easy to make sense of it. We want execution to wait for a period of time.</p><p>Just set a timeout for resolving the promise. We can provide ms for how long to wait.</p><pre>var wait = ms =&gt; new Promise((r, j)=&gt;setTimeout(r, ms))</pre><p>wait(2000) returns a promise, that will be resolved in 2000ms (2 sec.)</p><pre>// Promise syntax<br>var prom = wait(2000)  // prom, is a promise<br>var showdone = ()=&gt;console.warn(&#39;done&#39;)<br>prom.then(showdone)</pre><pre>// same thing, using await syntax<br>await wait(2000)<br>console.warn(&#39;done&#39;)</pre><p>Using async/await syntax, which is nicer than promise’s .then() syntax. Let’s wrap it in an Immediately Invoked function for brevity.</p><pre>(async () =&gt; { await wait(2000); console.warn(&#39;done&#39;) })()</pre><p>Or amidst regular code</p><pre>var x = 1<br>var y = 2<br>await wait(2000)<br>console.warn(x)</pre><p>What if we want to wait on an event, instead of just waiting x ms of time? <br>Just control when the promise is resolved.</p><p>We may even <em>timeout </em>the call, if the event never occurs, so the code doesn’t wait forever.</p><p>Let’s say we want to wait on a DOM element to be set to “Hello World” in a web page. We’ll check every 100ms and timeout after 2 seconds.</p><pre>&lt;div id=a&gt;s&lt;/div&gt;<br>&lt;script&gt;</pre><pre>var e = document.querySelector(&#39;#a&#39;)<br>  <br>  var waitForHello = timeoutms =&gt; new Promise((r, j)=&gt;{<br>    var check = () =&gt; {<br>      console.warn(&#39;checking&#39;)<br>      if(e.innerHTML == &#39;Hello world&#39;) <br>        r()<br>      else if((timeoutms -= 100) &lt; 0)<br>        j(&#39;timed out!&#39;)<br>      else<br>        setTimeout(check, 100)<br>    }<br>    setTimeout(check, 100)<br>  })</pre><pre>//setTimeout(()=&gt;{e.innerHTML=&#39;Hello world&#39;}, 1000)</pre><pre>  (async ()=&gt;{<br>    a.innerHTML = &#39;waiting..&#39;<br>    waitForHello(2000)<br>  })()<br>  <br>&lt;/script&gt;</pre><p>Un-commenting the setTimeout line will set the DIV after 1 second, otherwise will time out.</p><p>As you can see, async/await opens up great new possibilities in your code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fdde502%2F&amp;image=https%3A%2F%2Fucarecdn.com%2F57662ddc-da7c-407b-afcb-cb45184b2705%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/d25dd15e8727342107fbe0b6d67b030e/href">https://medium.com/media/d25dd15e8727342107fbe0b6d67b030e/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa3a2eb88f11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/lets-make-a-javascript-wait-function-fa3a2eb88f11">Let’s make a JavaScript Wait function</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What You Should Know About Assignment Destructuring in ES6]]></title>
            <link>https://medium.com/hackernoon/what-you-should-know-about-assignment-destructuring-in-es6-d049c84ad95a?source=rss-4a03b815672d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d049c84ad95a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[destructuring-in-es6]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[ecmascript-6]]></category>
            <category><![CDATA[js]]></category>
            <dc:creator><![CDATA[Just Chris]]></dc:creator>
            <pubDate>Fri, 20 Oct 2017 21:52:20 GMT</pubDate>
            <atom:updated>2019-05-16T08:51:21.751Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*cn9V5KOAIEjrbqZy1wlkWg.png" /></figure><p>JavaScript ES6 has a variety of new features when compared to its predecessor <a href="https://hackernoon.com/tagged/javascript">JavaScript</a> ES5. Let’s take a look at Assignment Destructuring and how it helps programmers simplify their code.</p><pre>[a,b] = [1, 2]<br>// a == 1<br>// b == 2</pre><pre>{a,b} = {a:3, b:4}<br>// a == 3<br>// b == 4</pre><p><a href="https://hackernoon.com/tagged/assignment-destructuring">Assignment Destructuring</a> allows for easy binding of the same properties to as many variables as desired. It also works in both arrays and objects, further expanding its scope. It makes pulling out specific properties from different objects an easy task and also allows for aliasing of properties too.</p><p>Objects default to <em>undefined </em>if no data is provided for that object.</p><pre>[a, b, c] = [5, 6];<br>// c === undefined</pre><p>We can ignore certain values if necessary.</p><pre>var [a, , b] = [1, 2, 3];<br>console.log(a, b); // 1 3</pre><p>We can combine values.</p><pre>[a, ...b] = [1, 2, 3];<br>// b == [2, 3]</pre><p>Assignment destructuring enables operations on objects, such as pulling values out of an object, using this short-hand syntax.</p><pre>o = {p1: &#39;foo&#39;, p2: &#39;bar&#39;};<br>var {p1, p2} = o;<br>// p1 == &#39;foo&#39;<br>// p2 == &#39;bar&#39;</pre><p>Assignment Destructuring also allows for swapping of variables in a single function, but unlike others, it allows the same without the use of a<em> temp </em>variable.</p><pre>var a = 1, b = 2;<br>[b, a] = [a, b];</pre><pre>// a == 2<br>// b == 1</pre><p>Clear and smaller code is its own reward. Assignment Destructuring is a boon for programmers as it helps them to prevent writing extra code, thereby saving time and effort.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d049c84ad95a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/what-you-should-know-about-assignment-destructuring-in-es6-d049c84ad95a">What You Should Know About Assignment Destructuring in ES6</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Sheets As Your Database]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/hackernoon/google-sheets-as-your-database-9016b9797169?source=rss-4a03b815672d------2"><img src="https://cdn-images-1.medium.com/max/600/1*bHbux0HHEJEN0lh6N-TDKg.png" width="600"></a></p><p class="medium-feed-snippet">Very rapid prototyping is helpful for trying out your brainstormed ideas while they are still fresh in your mind, without the need for a&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/hackernoon/google-sheets-as-your-database-9016b9797169?source=rss-4a03b815672d------2">Continue reading on HackerNoon.com »</a></p></div>]]></description>
            <link>https://medium.com/hackernoon/google-sheets-as-your-database-9016b9797169?source=rss-4a03b815672d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9016b9797169</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Just Chris]]></dc:creator>
            <pubDate>Fri, 03 Mar 2017 18:07:07 GMT</pubDate>
            <atom:updated>2019-05-16T08:51:22.862Z</atom:updated>
        </item>
    </channel>
</rss>