<?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 Heshie Brody on Medium]]></title>
        <description><![CDATA[Stories by Heshie Brody on Medium]]></description>
        <link>https://medium.com/@4hbrody?source=rss-7c12e03576d8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kv5orsirhx1q6ZBu</url>
            <title>Stories by Heshie Brody on Medium</title>
            <link>https://medium.com/@4hbrody?source=rss-7c12e03576d8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 17:40:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@4hbrody/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[Blank Sheet Syndrome.]]></title>
            <link>https://medium.com/@4hbrody/blank-sheet-syndrome-fc4c9aa4ba19?source=rss-7c12e03576d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc4c9aa4ba19</guid>
            <category><![CDATA[procrastination]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[writing]]></category>
            <dc:creator><![CDATA[Heshie Brody]]></dc:creator>
            <pubDate>Wed, 14 Nov 2018 21:24:40 GMT</pubDate>
            <atom:updated>2018-11-14T21:24:40.779Z</atom:updated>
            <content:encoded><![CDATA[<h3>Writing code and Blogging Have More In Common Then You And Your Great Aunt’s Cat.</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F1iu8uG2cjYFZS6wTxv%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fkitty-smart-1iu8uG2cjYFZS6wTxv&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2F1iu8uG2cjYFZS6wTxv%2Fgiphy-downsized-large.gif%3Fcid%3D790b7611eb57c49a02745b0dd9a5358510759748bcef1af5%26rid%3Dgiphy-downsized-large.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="543" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2aa50a328b97cc81dc673171eab024f/href">https://medium.com/media/a2aa50a328b97cc81dc673171eab024f/href</a></iframe><h3>Blank Sheet Syndrome</h3><p>The following all happens to all of us:</p><p>You just started this new project or your blog post that was due 10 days ago but somehow you find yourself staring at your screen while subconsciously refreshing your Twitter stream waiting for that perfect moment where the angels of inspiration will somehow make heavenly ink flow through your fingers onto your computer screen.</p><p>Now imagine an unsectioned book. One with no chapters, paragraphs or sentences. Most human beings would never start that book for one very simple reason, they don’t see an end without reading the whole entire book, there’s nothing to give them a sense of progress or achievement.</p><p>You see, the problem is a simple one. Since we as human beings think ahead and calculate risk we somehow create this mental blockage of fear in our brain that stops us from creating with the notion of impossible or no end in site.</p><h3>Templates and Blueprints, designing for progress</h3><p>Construction builders use blueprints, you should too. Outlining what we want to build before we know how to build it achieves the following:</p><ol><li>You have now started creating(Yay..!)</li><li>Makes you think in logical steps of creation.</li><li>It gives you clarity and a direct path to completion</li><li>It makes you feel acomplished</li></ol><p>The above is true for coding as well. Avi Flombaum who is the dean and co-founder of the Flatiron school said the following:</p><blockquote>“At first write with the code you wish you had.”</blockquote><p>Write your titles, chapter names or outcomes before you write the content.</p><p>For instance, before I started this very late due 2 weeks ago blog post I did the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UZ4ColrVPeYaAjQM.png" /></figure><h3>The Point Of No Return</h3><p>Once you get started and at least completed one single tiny step, you won’t be able to go back. The angels of completion will nag you to no end given the progress you just made. At least for a while.</p><p><em>Try it. I promise it works.</em></p><h3>Everything Seems Impossible Until It’s Completed</h3><p>To prove my point look back at all of those seemingly huge impossible projects/goals you’ve completed in your lifetime. I bet you’ve got at least one.</p><p><em>The above helped me. I hope it helps you as well.</em></p><p>Until Next Time,</p><p>Heshie</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc4c9aa4ba19" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forced Creativity. Writing Code For Limited Hardware]]></title>
            <link>https://medium.com/@4hbrody/forced-creativity-writing-code-for-limited-hardware-8d5e9c596db3?source=rss-7c12e03576d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d5e9c596db3</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[slider]]></category>
            <category><![CDATA[lazy-loading]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Heshie Brody]]></dc:creator>
            <pubDate>Wed, 15 Aug 2018 17:44:08 GMT</pubDate>
            <atom:updated>2018-08-15T17:48:47.320Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently completed a <em>‘2 day’</em> project for a summer camp in just <em>‘3 weeks’</em>…. As with any code project, the anticipated time of project completion and the actual time it takes to complete can be quite far apart.</p><p>The client was a friend of my wife who runs a summer day camp in Brooklyn and wanted an exciting way for kids to win prizes and get rewarded via cards that were dealt for good behavior and class participation.</p><p>She wanted a big screen that’ll play camp pictures and events and it should have a barcode scanner attached so the kids can scan their cards to see if they won a prize.</p><h3>How It All Started</h3><p>It was a typical Sunday afternoon while I was out shopping with my wife and I overheard her speaking to her friend about this fancy screen with a barcode scanner that she wanted to put up for this summer contest and I was like sure, I’ll have it done in 2 hours…</p><p><strong>LESSON LEARNED:</strong> <em>Never listen in on your wife’s phone conversations.</em></p><h3>What I used to build this project</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*DMDB1RKqCMaRTKJM.gif" /><figcaption>The project in action</figcaption></figure><p><strong>Technologies</strong></p><ul><li>HTML</li><li>CSS</li><li>JS</li><li>Jquery</li></ul><p><strong>Hardware</strong></p><ul><li>Liva Mini PC (<a href="https://www.ebay.com/itm/ECS-LIVA-Mini-PC-WIndows-8-1-Pro-2GB/253752439492">picked it up on ebay for $45</a>)</li><li>Standard PC Monitor</li><li>USB Barcode Scanner (<a href="https://www.amazon.com/gp/product/B00406YZGK/">$16 on amazon</a>)</li></ul><h3>How I built it</h3><p>Like anyone else would, I started to build this project feeling all smug thinking that I’ll just hack together a CSS slider with some code that accepts barcode inputs since barcodes are essentially keyboards with a laser reader and I’ll be the coolest dude in town. But, [as expected], issues arose.</p><p>I chose HTML, CSS, and JS because those were the only technologies I knew at the time well enough to actually build something. The code is a <em>Mish-Mosh</em> of JS and Jquery. I can’t look at that code today… : )</p><p><strong>LESSON LEARNED:</strong> <em>Being smug will make you overlook the obvious. Approach every project as your first</em></p><h3>The road bumps</h3><p>All Code is on my <a href="https://github.com/anihakutin/LazySliderWithBarcodeScanner">github</a>, feel free to use it as you please.</p><ol><li>As kids will always be kids and they love to click on things many times… I needed to implement a method that’ll cancel out previous inputs every time a barcode is scanned.</li></ol><p><strong>The Solution:</strong> Barcode scanners can be programmed to input any end of scan character to be used as a trigger to process the data inputted.</p><ol><li>Since HTML and CSS are run in a sandbox on the browser without access to the local file system and I did not have the know how to set up a local server, I had to figure out a way to dynamically load images from a folder without previously knowing the names or the number of images.</li></ol><p><strong>The Solution:</strong> I hardcoded the image sources to the images folder in my root directory and I prompted the user on page load to input how many images they wanted to load and I instructed my friend to name the images by number sequentially and just paste them into the images folder so I can then run a loop and build the image links, <em>Voila!</em></p><p><strong>Image link builder code:</strong></p><pre>//firstRun<br>var firstRun = true;</pre><pre>// Get number of images<br>var numOfSlides = prompt(&quot;Please enter how many slide images are in the folder&quot;, &quot;Example: 10...&quot;);</pre><pre>//Get slides<br>var slides = [];<br>var imgLinks = [];<br>var slideNumber = 1;</pre><pre>while(slideNumber &lt;= numOfSlides){<br>slides.push(&#39;&lt;img src=&quot;&#39; + &#39;slides/&#39; + slideNumber + &#39;.jpg&#39; +&#39;&quot; /&gt;&#39;);<br>imgLinks.push(&#39;slides/&#39; + slideNumber + &#39;.jpg&#39;);<br>slideNumber++;<br>}</pre><p>3 . Now that I had the major parts out of the way I just copied a CSS Image slider from <a href="https://codepen.io/">Codepen</a> and proceeded to integrate into my project. <em>And then it happened…</em></p><h3>The crash</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*3nB_QuIVnTka2FjS.gif" /></figure><p>Once all of it was done I proceeded to load it onto the liva mini pc and pat myself on the back for the quick turnaround but to my dismay, all that displayed was the first image and then it would hang and freeze up the entire computer.</p><p>Upon checking the task manager I realized that since I was preloading almost a 100 images for the slideshow it basically was overloading the little ram that was left and freezing up the entire computer.</p><p><strong>LESSON LEARNED:</strong> <em>Write code that can run on nothing and that’ll allow it to run on everything</em></p><h3>The rebuild</h3><p>I did some research and found a concept called lazy loading which means that instead of loading all the images at once, build a method that loads just the images needed.</p><p><strong>So in my case that was the following:</strong></p><ol><li>Load the first image in the DOM</li><li>Load the upcoming slide image in the DOM</li><li>Transition from the current image to the next image with some fancy CSS</li><li>Remove the previous image</li></ol><p><strong>My lazy slider code:</strong></p><pre>//firstRun<br>var firstRun = true;</pre><pre>// Get number of images<br>var numOfSlides = prompt(&quot;Please enter how many slide images are in the folder&quot;, &quot;Example: 10...&quot;);</pre><pre>//Get slides<br>var slides = [];<br>var imgLinks = [];<br>var slideNumber = 1;</pre><pre>while(slideNumber &lt;= numOfSlides){<br>slides.push(&#39;&lt;img src=&quot;&#39; + &#39;slides/&#39; + slideNumber + &#39;.jpg&#39; +&#39;&quot; /&gt;&#39;);<br>imgLinks.push(&#39;slides/&#39; + slideNumber + &#39;.jpg&#39;);<br>slideNumber++;<br>}</pre><pre>//Append 2 slide element <br>var elem = document.getElementById(&quot;lazy&quot;);<br>elem.innerHTML += slides[0];<br>elem.innerHTML += slides[1];</pre><pre>//create timer/slider<br>var slider = setInterval(mySlider, 4000);<br>var slideP = 0;<br>function mySlider() {</pre><pre>if(slideP &lt; numOfSlides) {<br>//get fist, last and previous slide element<br>var firstSlide = elem.firstElementChild;<br>var lastSlide = elem.lastElementChild;</pre><pre>//Load first image and animate<br>firstSlide.className = &quot;fadeIn&quot;;<br>lastSlide.getAttributeNode(&quot;src&quot;).value = imgLinks[slideP];</pre><pre>//move to next slide<br>elem.insertBefore(lastSlide, firstSlide);</pre><pre>//remove image from previous slide, 2nd child<br>lastSlide.classList.remove(&quot;fadeIn&quot;);</pre><pre>slideP++;<br>} else{<br>    slideP = 0;<br>}<br>}</pre><p>And it worked like a charm…! Not to mention that I stayed up all night building the “lazy-loader”. The reason it took so long to build this tiny script was that I had never really learned to code from the ground up and I was missing a ton of fundamental concepts and just toyed with it until the console didn’t return any errors : ).</p><p>Also until the project wasn’t due to be delivered it never occurred to me to test it on the actual hardware. Until the night before…</p><p>Thanks for reading, please consider clapping and sharing!</p><p><em>Best Regards,</em></p><p><strong>Heshie</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d5e9c596db3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>