<?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 Robert Han on Medium]]></title>
        <description><![CDATA[Stories by Robert Han on Medium]]></description>
        <link>https://medium.com/@robmj.han?source=rss-e0397903fd75------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ux_9ymtt5Xa2d-8SYcaQvA.jpeg</url>
            <title>Stories by Robert Han on Medium</title>
            <link>https://medium.com/@robmj.han?source=rss-e0397903fd75------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:53:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@robmj.han/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[The one thing I wished someone told me before starting coding bootcamp]]></title>
            <link>https://medium.com/@robmj.han/the-one-thing-i-wished-someone-told-me-before-starting-coding-bootcamp-133fdffe7399?source=rss-e0397903fd75------2</link>
            <guid isPermaLink="false">https://medium.com/p/133fdffe7399</guid>
            <category><![CDATA[codingbootcamp]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Robert Han]]></dc:creator>
            <pubDate>Mon, 25 Nov 2019 03:35:03 GMT</pubDate>
            <atom:updated>2019-11-25T05:21:02.137Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The magic sauce for having a successful bootcamp</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*lHDcj1dWlv-OJrlBf4k7EA.jpeg" /></figure><p>Tenacity.</p><p>Collaboration.</p><p>Grit.</p><p>A laptop.</p><p>Coffee.</p><p>Tuition.</p><p>Cool headphones.</p><p>Magic Sauce?</p><p><strong>These are some words that come to mind prior to and during one’s coding bootcamp journey. However, there is still something I wish I knew before starting my coding bootcamp journey,</strong></p><blockquote>“Be Business Minded.”</blockquote><h3>Integrate business into all your projects</h3><p>What are you left with to show for the several months of nonstop programming after a bootcamp? Your projects. I didn’t realize until after graduating bootcamp how important it was to really make sure you made projects that could be marketable and had the possibility of being a business. There were many companies during my job search process where the interviewer told me they really liked the fact that many of my projects were created with specific ideas of how they would be used in the real world and what companies might actually use them. Oh yeah did I mention your projects section will be the first thing recruiters and HR managers will see on your resume? So this is such an important piece that is not emphasized enough by bootcamp staff and students.</p><p>Fortunately I came from a retail business background so I tended to naturally gravitate towards building apps that had some sort of potential to solve a problem. However, if I had known the importance prior to my bootcamp I would have researched more project ideas and made a more comprehensive list of possible projects to build during my bootcamp.</p><p>In my particular bootcamp, we had 5 modules where at the end of each one we would work on a final project. Some were built with a partner and others like the MOD5 final project were done solo. Usually you are given at most a day to brainstorm a possible project idea so trust me, coming up with an unique idea is quite difficult! So what ends up happening is you and your partner end up deciding on making the millionth Spotify clone app or Instagram clone instead of coming up with somewhat of an original idea. Sure, you could argue you are still learning the skill but why not maximize your time and effort by learning the skills and building a unique app that has business potential?</p><h3>Give me some examples</h3><p>I will give you some personal examples of projects I made during my bootcamp experience to give you an idea of what I mean as well as how to find inspiration for great app ideas.</p><ol><li>My first project was a CLI app using ruby called Java Bot. Using the Yelp API the app aimed to find the 5 closest coffee shops based on zipcode and you could have a favorites list or update and delete a coffeeshop as well.</li><li>My 2nd project was using Ruby on Rails and was called Food Angel. An interactive web app designed for users to input their leftover ingredients and receive 10 customized recipes even with non-complementary ingredients.</li><li>My 3rd project was in Javascript and named Sushi Lovers. A sushi sharing web app for users to keep track of all the sushi they have tasted and input the experience level of someone who would enjoy eating that particular sushi.</li><li>My 4th project was a hybrid between Ebay and Craig’s List. A peer to peer e-commerce website for sellers to list their items for sale and for buyers to have the opportunity to see the seller location and immediately pick up the item they purchased.</li><li>My bootcamp final project was a culmination of everything I had learned thus far and was named Wunder. An innovative retail platform designed for a free standing kiosk or mobile app that allows users to browse a retailers products and interact with a live masterchef.</li></ol><p>Similar to my 4th project one good suggestion for app ideas is to combine different features of two apps. Taking the Ebay idea of being to sell one’s personal goods in an online marketplace while combining that with the immediate gratification aspect of possibly picking up the item if it is close to where you live was the concept.</p><p>Googling good app ideas will yield you good results but just to get one started here are 101 app ideas:</p><p><a href="https://medium.com/@rahul.goyl/101-mobile-app-ideas-2018-that-havent-been-made-yet-deb8415a9393">https://medium.com/@rahul.goyl/101-mobile-app-ideas-2018-that-havent-been-made-yet-deb8415a9393</a></p><h3>How this will payoff after graduation</h3><p>After you graduate all you have is your resume and your projects. Tech company HR depts are flooded with hundreds of applications and just put yourself in their shoes when you have many applicants with similar core skill sets the only thing that will pique their interest is probably a unique summary then an interesting app name which will then interest them into reading the app description. If the description is interesting and something they either</p><p>a) would personally use or</p><p>b) just makes them curious</p><p>which will in turn make them read about your other apps and click the links to your live demos or github site. See how everything should lead to one another?</p><p>So study up and make a list of possible app ideas you would be interested working on during your bootcamp and that way instead of wasting time thinking of ideas from scratch you can choose one from your pre-vetted list and then take the brainstorm time to dig deeper into better features or a better business concept.</p><h3>Conclusion</h3><p>At the end of the day, companies are thinking about their bottom line. Boot camp grads are a plenty but a bootcamp grad with a business mindset and applies that to his coding and projects are a much rarer breed of programmer.</p><p>Good luck to those who are thinking about starting a coding bootcamp.</p><p>Feel free to message me here or LinkedIn with any questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=133fdffe7399" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning v.0.1]]></title>
            <link>https://medium.com/@robmj.han/machine-learning-v-0-1-dd156b5f29f4?source=rss-e0397903fd75------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd156b5f29f4</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Robert Han]]></dc:creator>
            <pubDate>Mon, 22 Jul 2019 02:26:25 GMT</pubDate>
            <atom:updated>2019-07-22T02:26:25.420Z</atom:updated>
            <content:encoded><![CDATA[<p>Try it today!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-KXd_qVN-In374k9.jpg" /></figure><h3><strong>Webcam + many impressions = AI</strong></h3><p>I have been very interested in machine learning/AI recently and came across some great articles as well as a google website that is great for those who want to see what all the fuss is about and have fun at the same time.</p><p>Its called “Teachable Machine” and its made by some great devs over at Google.</p><p><a href="https://teachablemachine.withgoogle.com/?source=post_page---------------------------">Teachable Machine</a></p><p>Essentially using your laptop webcam you can teach it to choose the green, purple, or orange categories based on taking 30+ pictures per each category doing different gestures. Then depending on which category the computer thinks is correct, a gif will be played.</p><p>I tried doing what the quick tutorial showed me by raising my hand for the green category and then staying still while left clicking and holding the green category button which takes snapshots. I taught my machine to show a Simpsons Ralph waving hi gif whenever I would hold up the peace sign.</p><p>** It is recommended taking over 30 impressions for your computer to become more accurate.**</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FvOUT-mn-YJ8YOUPQIE_QQ.png" /><figcaption>Raise my hand with a peace sign for a Simpsons Ralph waving hi gif</figcaption></figure><p>Next I trained the purple category by taking snapshots of me just sitting still doing nothing. **Noticed though how before you train the purple category because the machine only has the first 30+ shots of your hand up and nothing else there is nothing for it to compare it with and thus whether you hold your hand up or just sit still it chooses the green category.**</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hsqE-gVqLzIukbhErSqLTg.png" /><figcaption>Sitting still for the purple category produces an Ice cool Gif</figcaption></figure><p>Last but not least the orange category I trained my laptop to choose it by 30+ snapshots of me ducking out of the way and just leaving my blinds. This produces a shocked Chris Pratt gif.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BQ7xvxdBk40CE6iw5LBCVw.png" /><figcaption>No Robert = Shocked Chris Pratt</figcaption></figure><p>Try it yourself! Its loads of fun and the best part is when you try to trick the computer by doing something in between any of your two categories. Like, for example, raising your hand slightly or ducking out of the way partially. It is eerily accurate in terms of that % confidence bar you see displayed in real time.</p><p>If you also look at the output section there is a sound and speech section too where you can choose to have an mp3 file or a Steven Hawking type of machine speaking with any word you input to represent the three categories.</p><h3><strong>Whats next?</strong></h3><p>Next time I’m going to try and slowly begin to write simple code to emulate the demo above or another test on a much much smaller scale.</p><p>Stay Tuned…..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd156b5f29f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hackathon 1st Edition]]></title>
            <link>https://medium.com/@robmj.han/hackathon-1st-edition-a1c5cdf4a77d?source=rss-e0397903fd75------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1c5cdf4a77d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[developerweek]]></category>
            <category><![CDATA[teamwork]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[hackathons]]></category>
            <dc:creator><![CDATA[Robert Han]]></dc:creator>
            <pubDate>Mon, 01 Jul 2019 00:06:52 GMT</pubDate>
            <atom:updated>2019-11-15T17:25:55.091Z</atom:updated>
            <content:encoded><![CDATA[<p>An inside look at winning my first hackathon</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5FNeQJzZ7YbXgH7YL-i3g.jpeg" /><figcaption>2019 Developer Week New York June 19–20 Hackathon 1st Place Overall and Canon Challenge</figcaption></figure><p>There is something quite surreal whenever you are recognized in an event/contest. But this one was extra special. It was special because it validated all the hard work I had put in the past few months while attending the Flatiron School coding bootcamp. I was reminded of that common phrase “You can do anything you set your mind to” or one of the many other variations of this phrase. In addition, this was my first hackathon ever and to win both the overall and the sponsor challenge was a sweet bonus.</p><p>Before going any further I would like to thank my two partners Ethan Nam &amp; David Ren for a great job in creating the Canon Genius platform together and treating me to an experience I will never forget.</p><h3>What is a hackathon?</h3><p>Contrary to belief, it is not a room filled with geeks with super thick bifocals furiously smashing their keyboards trying to hack some government website. Though I believe there are competitions closer to the scenario above, I found out that it is very similar to a business plan/case competition where you either come up with a great new business idea from scratch or tackle a business problem and find a creative solution. In the case of a hackathon, the idea or challenge would be much more technical in nature but the overall format I feel is very similar. Fortunately for me, I have participated in similar competitions since my college days in business school and I felt very confident creating a great story and presenting in front of the judges.</p><h3><strong>Who can join a hackathon?</strong></h3><p>To my surprise, hackathons are literally open to everyone(a developer, designer, biz dev person, idea person, project management person, and anything in between), and looking back I understand why it would be. Just like you wouldn’t have just one type of employee at a company, a hackathon I found is no different in order to get the best possible result. I would say ideally you need 1–2 developers, 1 project manager, 1 UX/UI Designer, 1 Graphic Designer to have an optimal blend. The reason I argue for this diverse portfolio of team members is the hackathon is as much technical skills as it is presentation skills in front of judges.</p><p>You could have the coolest idea in the world but if you don’t find a way to concisely tell your story, then your hopes to impress judges will diminish rapidly. Yes, I forgot to mention our format was 2 mini judging rounds of 3 minutes each and if you were chosen as one of the top 5 teams overall you would present on stage in front of a large audience, but sadly this was also only a mere 3 minutes. 3 minutes is like 1 second when presenting a technical presentation so you can see why I stressed the importance of conveying your project in a concise format.</p><p>In between the mini judging and the final stage any team that decided to create an app for one of the sponsor challenges had 5 minutes to present to their respective sponsor. I felt this was a much more reasonable amount of time to really let our project shine and show all the aspects of our idea and platform.</p><h3><strong>So what do teams build/create at a hackathon?</strong></h3><p>There are usually a couple of sponsor company challenges that are made public weeks before the competition and teams are allowed to choose to tackle one of the sponsor challenges or make any app they wish. I believe most of the ideas created at a typical hackathon end up either as a web app or a mobile app but you are not limited to these two. It can range from a mockup/data visualization to a full blown video/demo/slideshow presentation.</p><p>You could register your own team up to 5 members for our particular event. If you did not register as a team prior to the event, you are essentially a free agent and other teams are able to fill in any gaps they might have in their team or you are paired up into a random team on the first day of the hackathon.</p><h3><strong>So what was the Canon Genius Platform?</strong></h3><p>An e-learning platform where Canon specialists, called “Geniuses”, can teach customers how to take better photos by remotely controlling customers’ cameras through Canon’s Camera Control API.</p><p>The idea was to reduce instances of new customers who return their cameras due to unfamiliarity with DSLR cameras. The initial lesson, included when you purchase a new camera, would be free, and any subsequent lessons would be paid, providing a new revenue stream for Canon.</p><p>In addition to up-selling paid lessons after the initial lesson, one could imagine other great use cases for Canon to add more revenue stream channels as well as create life long customers and be able to re-engage their customers. Less tech-savvy users could find great benefit through the platform as the Canon Genius could literally guide them step by step from the minute settings such as Time and Date settings to the more advanced settings. Another would be tech support where lets assume the dial is non-responsive and rather than having to physically go to a store and have it checked out, a Canon Genius can remotely test to see if all the features the dial controls still work thus being to conclude that the dial just needs to be replaced as opposed to something internal.</p><p>Finally, Canon could host special events such as a class with a world renown photographer and users would be able to join a live stream and watch and comment as the world class photographer could be hanging off a cliff somewhere taking beautiful pictures and showing how to do it at the same time.</p><h3><strong>Here are some screenshots to give an idea of how our platform would function:</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vAF3At1seCmJN4JwF8wsCg.png" /><figcaption>Process Flow</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5dK5_bm_Zsc157nYUniFg.png" /><figcaption>Home Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ZrgjQaZiXX2hEXBENRw3A.png" /><figcaption>User login dashboard</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dcprp-ZMkP4035mflwcwDw.png" /><figcaption>Canon Genius login dashboard</figcaption></figure><p>Finally the Canon Genius would have access to a GUI to be able to see the picture that was just taken through the GUI and adjust any of the cameras settings remotely through this interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*doHhz_2p8mT9vuQTMUfLeA.png" /></figure><p>Canon then could upsell the customer after the free lesson by offering to schedule a full paid lesson. In addition, some other great use cases we had suggested to Canon was remote technical support where a Canon genius could troubleshoot a customers broken dial for instance and figure out remotely whether the physical dial is broken or if there is an internal software issue causing the problem. A final use case suggestion was being able to remotely help do the initial setup for the camera such as setting the date &amp; time or possibly the default settings.</p><h3><strong>Spoiled?</strong></h3><p>My teammates and I joked we were kind of spoiled to have won our first hackathon and we should consider retiring from hackathons…</p><p>I have a feeling we will be returning to defend our title next year.</p><p>Until next time, happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1c5cdf4a77d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My.props.Hand-Picked => REACT Components & Libraries]]></title>
            <link>https://medium.com/@robmj.han/my-props-hand-picked-react-components-libraries-53fea94898eb?source=rss-e0397903fd75------2</link>
            <guid isPermaLink="false">https://medium.com/p/53fea94898eb</guid>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Robert Han]]></dc:creator>
            <pubDate>Fri, 12 Apr 2019 04:43:03 GMT</pubDate>
            <atom:updated>2019-04-12T17:23:21.443Z</atom:updated>
            <content:encoded><![CDATA[<p>My TOP Picks for great tools to help you with your React apps &amp; projects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*-b1zqnmZJrIFoaUPKlKVtQ.png" /></figure><p>I wanted to take a moment to help my fellow bootcamp classmates and other jr. devs to help with what many feel is the daunting task of making my site,app, or project look “good”!</p><p>Many of us may feel overwhelmed with CSS, HTML, and just overall good design when developing our projects. But I have come to grips with the reality that, although the core of being a good developer is not UX/UI, this day and age there is a certain level of expectation that goes along with the aesthetic portion of your app/project. I wanted to help alleviate some of this dread by going through a huge repository of great components/libraries and filtered out the ones I felt had great UI/UX features, just outright cool, or was simple to use/implement but still gave the look/feel of a much more advanced library.</p><p><strong><em>**I will provide direct links to every resource as well as links to the DEMOs!(if available)**</em></strong></p><p>Lets BEGIN!</p><h3>1. Font Awesome</h3><p>I have personally used this site and it is “awesome” as the name says. It has so many different great looking icons for you to use. BTW its free! With pro there are just some other icons that are available but the standard free set is more than plenty.</p><p>Website: <a href="https://fontawesome.com/">https://fontawesome.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mOubwCdmBNyeDQlIN2o-tg.png" /></figure><h3>2. React-jsonschema-form</h3><p>Super Cool form tool that has so many advanced features</p><p>Website: <a href="https://github.com/mozilla-services/react-jsonschema-form">https://github.com/mozilla-services/react-jsonschema-form</a></p><p>Demo: There is a gif at the github page.</p><p>Live Trial: <a href="https://mozilla-services.github.io/react-jsonschema-form/">https://mozilla-services.github.io/react-jsonschema-form/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h1guG5q3OrLwESmguGbr2w.png" /></figure><h3>3. Belle — this is like the simple all-in-one tool for those that are beginners in design for React apps</h3><p>Configurable React Components with great UX. I highly recommend this for those that have trouble with design or just don’t have a lot of time to put into design. Pretty much has every base feature you could want from date pickers to loading animations.</p><p>Website: <a href="http://nikgraf.github.io/belle/#/?_k=9cqpvr">http://nikgraf.github.io/belle/#/?_k=9cqpvr</a></p><p>Demo: Go to the page and use the sidebar on left to explore each feature</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AwW-hMojVZT73ZYdYM-CDg.png" /></figure><h3>4. AnimakitRotator</h3><p>Rotate your components in three-dimensional space</p><p>Website: <a href="https://github.com/animakit/animakit-rotator">https://github.com/animakit/animakit-rotator</a></p><p>Demo: <a href="https://animakit.github.io/#/rotator">https://animakit.github.io/#/rotator</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*vT5Jc2qgpbDx1pObiuuzgA.gif" /></figure><h3>5. React-track</h3><p>Track the position of DOM elements. Create cool animations.</p><p>Website: <a href="https://github.com/gilbox/react-track">https://github.com/gilbox/react-track</a></p><p>Demo: <a href="http://gilbox.github.io/react-track/examples/demo/demo.html">http://gilbox.github.io/react-track/examples/demo/demo.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*lKuYY9eXVPnBn1X9xh77-Q.gif" /></figure><h3>6. React-track</h3><p>Track the position of DOM elements. Create cool animations.</p><p>Website: <a href="https://github.com/google-fabric/velocity-react">https://github.com/google-fabric/velocity-react</a></p><p>Demo: <a href="http://google-fabric.github.io/velocity-react/">http://google-fabric.github.io/velocity-react/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*blfaWYmdI5pW0eIoUIMB6g.gif" /></figure><h3>7. React-images-uploader</h3><p>React.js component for uploading images to the server. I heard it is somewhat difficult to upload local images to your app.</p><p>Website: <a href="https://github.com/aleksei0807/react-images-uploader">https://github.com/aleksei0807/react-images-uploader</a></p><p>* Also as an alternative I also found a great blog regarding this as well**</p><p>Blog: <a href="https://codeburst.io/react-image-upload-with-kittens-cc96430eaece">https://codeburst.io/react-image-upload-with-kittens-cc96430eaece</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*cWXl8RFN6FuaMDefIqKIjQ.gif" /><figcaption>React-images-uploader</figcaption></figure><h3>8. Dragula</h3><p>👌 Drag and drop so simple it hurts… need I say more</p><p>Website: <a href="https://github.com/bevacqua/react-dragula">https://github.com/bevacqua/react-dragula</a></p><p>Demo: <a href="http://bevacqua.github.io/react-dragula/">http://bevacqua.github.io/react-dragula/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*d998YTH1NfQMqwys4UEdiA.gif" /></figure><h3>9. Sortable JS</h3><p>JavaScript library for reorderable drag-and-drop lists. Has the A-To-Z for different drag and drop components. So many kinds.</p><p>Website: <a href="http://sortablejs.github.io/Sortable/#simple-list">http://sortablejs.github.io/Sortable/#simple-list</a></p><p>Demo: <a href="http://bevacqua.github.io/react-dragula/">http://bevacqua.github.io/react-dragula/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*bMHFZMybNWXQbSYZrwVM2Q.gif" /></figure><h3>10. React-date-range</h3><p>A date library agnostic React component for choosing dates and date ranges.</p><p><strong>Why should you use </strong><strong>react-date-range?</strong></p><ul><li>Stateless date operations</li><li>Highly configurable</li><li>Multiple range selection</li><li>Based on native js dates</li><li>Drag n Drop selection</li><li>Keyboard friendly</li></ul><p>Website: <a href="https://github.com/Adphorus/react-date-range">https://github.com/Adphorus/react-date-range</a></p><p>Demo: <a href="http://adphorus.github.io/react-date-range/">http://adphorus.github.io/react-date-range/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*d9f2jTxqsYNzPJpJDc1Nfw.gif" /></figure><h3>11. React-autosuggest</h3><p>Has simple to more advanced autosuggest features.</p><p>Website: <a href="https://github.com/moroshko/react-autosuggest">https://github.com/moroshko/react-autosuggest</a></p><p>Demo: <a href="http://react-autosuggest.js.org/">http://react-autosuggest.js.org/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*w6s0AtfUneO9tb6vaQxaCA.gif" /></figure><h3>12. React-router-transition</h3><p>painless transitions built for react-router, powered by react-motion</p><p>Website: <a href="https://github.com/maisano/react-router-transition">https://github.com/maisano/react-router-transition</a></p><p>Demo: <a href="http://maisano.github.io/react-router-transition/">http://maisano.github.io/react-router-transition/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*DP0P0FSjm81GmSfAmkDcpA.gif" /></figure><h3>13. React-avatar</h3><p>Universal avatar makes it possible to fetch/generate an avatar based on the information you have about that user. It uses a fallback system that if for example an invalid Facebook ID is used it will try Google, and so on. Pretty crazy...</p><p>Website: <a href="https://github.com/Sitebase/react-avatar">https://github.com/Sitebase/react-avatar</a></p><p>Demo: <a href="https://www.sitebase.be/react-avatar/?utm_source=github&amp;utm_medium=readme&amp;utm_campaign=react-avatar">https://www.sitebase.be/react-avatar/?utm_source=github&amp;utm_medium=readme&amp;utm_campaign=react-avatar</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*f-yGdNajTup00HCsIo9AaA.gif" /></figure><h3>14. React-tabs</h3><p>An accessible and easy tab component for ReactJS.</p><p>Website: <a href="https://github.com/reactjs/react-tabs">https://github.com/reactjs/react-tabs</a></p><p>Demo: <a href="https://reactcommunity.org/react-tabs/">https://reactcommunity.org/react-tabs/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*KuUvArg-6DW7tCI7mQfStw.gif" /></figure><h3>15. React-credit-cards</h3><p>A modern credit card input component for React. I thought was just a really fantastic UI/UX component for credit card inputs. Never seen it used before like this.</p><p>Website: <a href="https://github.com/amarofashion/react-credit-cards">https://github.com/amarofashion/react-credit-cards</a></p><p>Demo: <a href="https://amarofashion.github.io/react-credit-cards/">https://amarofashion.github.io/react-credit-cards/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*rj_wHAZNDitqICL-_0Ycyg.gif" /></figure><h3>Lastly..</h3><p>I wanted to also share this huge catalog where I got most of these great components and libraries from. There are a ton!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*u04kbzxSdG8pcZha_sb7_g.gif" /><figcaption><a href="http://kane52630.tumblr.com/post/78511836381/where-does-he-get-those-wonderful-toys-batman">Animus Vox — Tumblr</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*0CSUXf-Ga69tFIDYL1hTgg.gif" /><figcaption>GIPHY</figcaption></figure><h3>Awesome-React-Components</h3><p>Link: <a href="https://github.com/brillout/awesome-react-components#photo--image">https://github.com/brillout/awesome-react-components#photo--image</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53fea94898eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript(Async/Await) => Cartoons]]></title>
            <link>https://medium.com/@robmj.han/javascript-async-await-cartoons-17ec5b93c3f?source=rss-e0397903fd75------2</link>
            <guid isPermaLink="false">https://medium.com/p/17ec5b93c3f</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[async-functions]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Robert Han]]></dc:creator>
            <pubDate>Wed, 20 Mar 2019 06:08:51 GMT</pubDate>
            <atom:updated>2019-03-20T14:22:15.087Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Learn how async functions work through animation</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RI8rDx70GQrzl80uHRTiBw.png" /><figcaption>‘Oat the Goat’ an interactive online animated adventure</figcaption></figure><p>While recently learning Javascript, I came across one of Javascripts special abilities sort of speak, <strong>asynchronous functions. </strong>Wait. What? ‘It’s like something out of high school biology,’ was my first thought. Sounds frightening to both the average person and novice coder alike.</p><p>I have read several documents regarding these functions and I found many of them very difficult to understand so I will try my best to summarize it here but first, I will explain it the old fashioned way (via MDN docs). Then I will try to give you my interpretation of it, followed by what I think is a real fun way to visualize this through the above ‘Oat the Goat’ animated adventure.</p><h3>Definition and 3 simple examples</h3><p>“The <strong>async function</strong> declaration defines an <strong>asynchronous function</strong>, which returns an <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction">AsyncFunction</a> object. An asynchronous function is a function which operates asynchronously via the event loop, using an implicit <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a> to return its result. But the syntax and structure of your code using async functions is much more like using standard synchronous functions.”</p><ul><li>MDN Docs</li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function</a>\</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XiUwGL3Qib9WVHhANkJPCA.png" /><figcaption>Official MDN Docs Description</figcaption></figure><p>Ok so here are some good simple examples from MDN:</p><p>**As always I have provided code snippets for those who want to copy/paste into their fav textEditor followed by a color coded image for better readability in this post.**</p><pre>var resolveAfter2Seconds = function() {<br>  console.log(&quot;starting slow promise&quot;);<br>  return new Promise(resolve =&gt; {<br>    setTimeout(function() {<br>      resolve(&quot;slow&quot;);<br>      console.log(&quot;slow promise is done&quot;);<br>    }, 2000);<br>  });<br>};<br><br>var resolveAfter1Second = function() {<br>  console.log(&quot;starting fast promise&quot;);<br>  return new Promise(resolve =&gt; {<br>    setTimeout(function() {<br>      resolve(&quot;fast&quot;);<br>      console.log(&quot;fast promise is done&quot;);<br>    }, 1000);<br>  });<br>};</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*94qWQQBWEpyri1dXFfXYUQ.png" /></figure><h3>These two functions will be used by our 3 examples:</h3><h3>1. Async Back to Back/Sequential</h3><pre>var sequentialStart = async function() {<br>  console.log(&#39;==SEQUENTIAL START==&#39;);<br><br>  // 1. Execution gets here almost instantly<br>  const slow = await resolveAfter2Seconds();<br>  console.log(slow); // 2. this runs 2 seconds after 1.<br><br>  const fast = await resolveAfter1Second();<br>  console.log(fast); // 3. this runs 3 seconds after 1.<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hjn2ELMUWcfiVxdOvR6k5g.png" /></figure><p>In this case, what’s happening whensequentialStartis executed, on the first await, execution is suspended for 2 seconds and then another 1 second for the second await. The actual timer start for the ‘const fast’ has not started until the first has fired. The code takes 3 seconds to complete.</p><h3>2. Async Concurrent</h3><pre>var concurrentStart = async function() {<br>  console.log(&#39;==CONCURRENT START with await==&#39;);<br>  const slow = resolveAfter2Seconds(); // starts timer immediately<br>  const fast = resolveAfter1Second(); // starts timer immediately<br><br>  // 1. Execution gets here almost instantly<br>  console.log(await slow); // 2. this runs 2 seconds after 1.<br>  console.log(await fast); // 3. this runs 2 seconds after 1., immediately after 2., since fast is already resolved<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkKLX-B6SlziLE1WPx0Dyw.png" /><figcaption>Could Not screenshot all of the last comment. Ends by “..fast is already resolved.”</figcaption></figure><p>In this scenario, both timers are created and then awaited. This is interesting as both timers start concurrently which means the code will actually finish in 2 seconds rather than 3 seconds like in the first example. <br>However, the awaits are still running, meaning the const fast will still wait for const slow to finish before executing but this time it will show immediately after const slow is done as const fast will already be done because the timer did not start after const slow was complete.</p><h3>3. Async Parallel</h3><pre>var parallel = async function() {<br>  console.log(&#39;==PARALLEL with await Promise.all==&#39;);<br>  <br>  // Start 2 &quot;jobs&quot; in parallel and wait for both of them to complete<br>  await Promise.all([<br>      (async()=&gt;console.log(await resolveAfter2Seconds()))(),<br>      (async()=&gt;console.log(await resolveAfter1Second()))()<br>  ]);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XX8_-wl4v83y3b2NSoX48Q.png" /></figure><p>Finally we have parallel which is similar to concurrent in that both functions start simultaneously but the difference this time is that with ‘Promise.all’, both functions need to complete before moving on .</p><p>I visualize async functions like a action/reaction type of analogy as I picture millions of possible events all of which could happen simultaneously at some point but were in essence triggered by each other in an elaborate web of chain reactions.</p><p>I can imagine how this would play a huge role in making any type of videogame in Javascript where you need to have different events occur at different times, simultaneously, and reactively, i.e. a shooter game with projectiles hitting the environment at the same time lowering the players HP.</p><p>Now lets take a quick look at a small sliver of sample code that the developers of ‘Oat the Goat’ have made public to us.</p><p>“Oat the Goat” is an award-winning interactive online story telling app that teaches about kindness and bullying. If you want to see some fantastic animation using Javascript and 3D animation you have to check it out, especially if you have any children between 4–7 years old!</p><p><a href="http://www.oatthegoat.co.nz/">Oat the Goat</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*98byQWt0Rnt_9LP7XCjRpQ.png" /></figure><p>The small snippet the developers have made public seems to be used for the intro scene of the story. Since we don’t have all the code, I have to make a few assumptions regarding the code but following my screenshots and referencing this code should be sufficient enough to understand. This will be pretty self explanatory but nonetheless, I think a great visual tool to see how async functions work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UTWf4MX7HiSuoBRD_tx8GQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZsJTZZXaGouCjEVmd5pHw.png" /></figure><p>So the first part that has the “await Promise.all([vo, anim])” I believe is for both the title rendering, sound, music, animation all run concurrently and once all of these have finished, then show the “this.waitClick” signified by the bullseye, which is a callback function of “this.advanceTo”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AYHSb4H9Z-6Wyfcr99RLyA.png" /></figure><p>Then you can see that the async waitClick function has a await for a “this.getClick()” function which is another callback function that I assume is when the user clicks the bullseye and then “advance.To” the “this.outro.”</p><p>Then we can see that the async outro function has an await “this.playSegment(“outro”)” which I believe is for the outro animation, music fade, etc.. to all occur before finally blacking out and the scene officially ending.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Od-26-PygV7beJZpkJZGHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Qkk_7sIuzMAfgMdDh07iw.png" /></figure><h3>THE END</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17ec5b93c3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Come on Down~ Step Right up~ Start to Make your own Games!]]></title>
            <link>https://medium.com/@robmj.han/come-on-down-step-right-up-start-to-make-your-own-games-673f74d6d5ea?source=rss-e0397903fd75------2</link>
            <guid isPermaLink="false">https://medium.com/p/673f74d6d5ea</guid>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mobile-games]]></category>
            <category><![CDATA[videogames]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Robert Han]]></dc:creator>
            <pubDate>Wed, 27 Feb 2019 06:43:20 GMT</pubDate>
            <atom:updated>2019-03-20T02:11:25.727Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*8wsLAkX6_goGqqzfXGF4iA.jpeg" /></figure><h3><strong>Do you love video games? Of course you do!</strong></h3><p>We all have played some sort of video game in one shape or form. Maybe you played the latest FPS(first-person-shooter), or a classic 2D side scroller, or maybe a mobile app where you slingshot birds and hurl them towards cute green piggies. How many times have you said to yourself:</p><ol><li>“I have a great game idea!”</li><li>“I wish I could make a game…”</li></ol><p>I know I did.</p><p>I have fond memories of going to the now, sadly departed “Toys “R” Us” and racing over to the video game aisle to snag the latest Nintendo game starring two, Japanese-born Italian plumbers.</p><p>So now that I am learning to code, I decided to do some research on the topic and see if I could make a game myself even though I am only several weeks into my coding bootcamp here at The Flatiron School.</p><h3><strong>What!? My text editor had this many colors? :)</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bdfgEq1qmlwB8Cj116QiyA.png" /></figure><p>My research regarding games and even game tutorials mostly led me to just extremely large blocks of complex code as you can see above, crushing any motivation to even attempt learning this topic. There are many video tutorials I found on “YouTube” but just looking at the total time of the video made it just as daunting to approach with many being a minimum of 1:30:00 hours to some upwards of 3:00:00 hours! When confronted with a complex problem you want to be able to break it down into smaller, manageable pieces. So this post is meant to show the real early beginnings of a 2D side scrolling game so that you can get a taste for the possibilities and maybe an eye opener for those that were just too scared to take those first baby steps and see that when broken down, its a much more approachable topic.</p><p>After scouring a bunch of the video tutorials on “YouTube” I found one where I liked the final game, how the creator explained all his code and what each line represented step-by-step(especially probably one of the most difficult mechanics, which is collision detection), and it used my main programming language I am learning now, Ruby!</p><p>So the video name is “Making Fruity Bat (a Flappy Bird clone) in Ruby” by Tom Dalling</p><p>I will provide links to both the video and the finished code at the end.</p><h3>Lets Begin!</h3><p>First we need to setup our computer environment before we start coding. Ruby has a really powerful gem made especially for creating 2D games called Gosu. Here are some important instructions for a Mac OS X install before we move on. The official documentation link is here in case you need it:</p><p><a href="https://github.com/gosu/gosu/wiki/Getting-Started-on-OS-X">https://github.com/gosu/gosu/wiki/Getting-Started-on-OS-X</a></p><p>*******************************************************************</p><h3>OFFICIAL README</h3><h4>Prerequisites</h4><p>Gosu depends on the <a href="http://www.libsdl.org/">SDL 2 library</a>. Please install <a href="http://brew.sh/">Homebrew</a> and run</p><pre>brew install sdl2</pre><p>If you have not installed Ruby yet, I recommend also running brew install ruby. The problem with Apple&#39;s built-in Ruby is that it is often outdated and/or broken. The popular rvm tool is not compatible with Gosu. Ruby from Homebrew and rbenv are both good choices.</p><h4>Installing Ruby/Gosu</h4><p>Install the Gosu gem via gem install gosu.</p><p>To test whether everything works as expected, you can use this one-liner, which should open a window:</p><pre>ruby -rgosu -e &#39;w = Gosu::Window.new(200, 150); w.caption = &quot;It works!&quot;; w.show&#39;</pre><h3>End of OFFICIAL README</h3><p>*******************************************************************</p><p>Before even starting our project you can see some really simple and cool games that Gosu can help you make by</p><p>Installing and running the <a href="https://github.com/gosu/gosu-examples">gosu-examples gem</a>:</p><pre>gem install gosu-examples<br>gosu-examples</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5x3HHbTZwCtuIb0hUVbgPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hR6-xaVpD9MRVjX3EsoWxQ.png" /></figure><p>Go to your terminal and make a folder to put in your future game and then open it in your favorite text editor.</p><p>Then make a .rb file and a Gemfile requiring the ‘gosu’ gem and then run in your terminal:</p><pre>bundle or bundle install</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yw-y1AzOUm_F9wRJm8wErg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wImel_Y_Rr5cv_--Fsd8nw.png" /><figcaption>Great! Bundle complete!</figcaption></figure><p>Now click on game.rb and lets start gaming! As always I will provide code snippets so that you can code along easily.</p><p>As you can see Gosu provides us with a GameWindow class and it is inheriting from Gosu::Window.</p><p>The method you see here ‘<strong>button_down’ </strong>lets you just be able to press escape on the keyboard, hence ‘<strong>KbEscape’</strong> to easily close your game window. Also the GameWindow arguments are just the screen dimensions 800x600 and the false just determines whether its full screen =&gt; true, or not full screen =&gt; false.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ubQ6bIJD6sfePIOqsUhchw.png" /></figure><pre>require &#39;gosu&#39;</pre><pre>class GameWindow &lt; Gosu::Window<br>  def button_down(button)<br>    close if button == Gosu::KbEscape<br>  end<br>end</pre><pre>window = GameWindow.new(800, 600, false) # screen size + false is for NOT full screen<br>window.show</pre><h3><strong>Whats the #1 rule in programming? TEST, TEST, &amp; TEST again!</strong></h3><p><strong>So let’s Test.</strong></p><p>open your terminal (in this folder of course) and run</p><pre>bundle exec ruby game.rb</pre><p>Look! A popup window! Your a Game Developer!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BcWHZdRkZlUrxJyNmYR-wg.png" /></figure><p>Press your <strong>‘Esc’ </strong>button and like magic, it disappears!</p><p>Now go to the link at the end for the final code and git clone everything down to a separate folder. Using finder or terminal copy the entire “images” folder to our 2Dgame folder so that we can start doing some scrolling magic!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K4McLIQ0rxseORNtcD-CHw.png" /></figure><p>At this point we should get the Gosu docs which has all the different actions/methods we can use as a reference. Download it below.</p><p><a href="https://github.com/gosu/gosu/blob/master/rdoc/gosu.rb">gosu/gosu</a></p><p>We will be referring to the doc for the next part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4M_dY84kCNqw2sR1K-DdJQ.png" /><figcaption>initialize, draw, and window resize</figcaption></figure><pre>require &#39;gosu&#39;</pre><pre>class GameWindow &lt; Gosu::Window<br>  def initialize(*args)<br>    super<br>    <a href="http://twitter.com/background">@background</a> = Gosu::Image.new(self, &#39;images/background.png&#39;, false) #last false is for tielable argument and that is just how the edges get rendered, dont need now<br>    <br>  end</pre><pre>def button_down(button)<br>    close if button == Gosu::KbEscape<br>  end</pre><pre>def draw<br>    <a href="http://twitter.com/background">@background</a>.draw(0, 0 ,0)</pre><pre>end</pre><pre>end</pre><pre>window = GameWindow.new(320, 480, false) # screen size + false is for NOT full screen<br>window.show</pre><p>We did 3 things here:</p><p>1. Added the initialize method with 3 arguments found in the docs. We are initializing a Window so thats why “self”, then image source, tileable is explained in comment above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0PBe5yfMAcdYscUmdGOk9A.png" /></figure><p>2. Added one of the most important methods “draw” and as you can see from the docs we need to give the XYZ coordinates and currently (0, 0, 0).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQZ6TiJCQtyjVezVv2u7pQ.png" /></figure><p>Lets test here.</p><pre>bundle exec ruby game.rb </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ltLp_Jb6e6VRM3DbKqVUUA.png" /></figure><p>Oh no! The window is too big! After checking the specs of the image we find out that to fit, it should be 320 x 480.</p><p>3. So the final thing we did here is change the resolution to match the image. I believe this was meant to be for a mobile device screen so that is why the dimensions look small on our laptops/PCs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zizIn5d3xWgZYMsEDit4mQ.png" /></figure><p>It’s a perfect fit now.</p><p>Lets add the foreground now to the initialize first and then to the draw methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IeWU1CmY4gZ-n8sQc9yQHQ.png" /><figcaption>add foreground to initialize then draw methods</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*eeyhYiPpJes0FOJthx13Zg.png" /></figure><p>TEST</p><pre>bundle exec ruby game.rb</pre><p>Starting to look Fancy……</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FtKImUzsA4l91R1CCOt%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FtKImUzsA4l91R1CCOt%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FtKImUzsA4l91R1CCOt%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="175" frameborder="0" scrolling="no"><a href="https://medium.com/media/4494e63552f3e59d1a01c06697207e7f/href">https://medium.com/media/4494e63552f3e59d1a01c06697207e7f/href</a></iframe><p>So we added a scroll_x variable to init, update, and put it in as the first argument in our foreground draw method because remember the first one is the x-axis. In update the</p><pre>@scroll_x += 3<br># means it will move by 3 pixels</pre><pre>Then in the draw method the @scroll_x is saying to scroll the image to the right. </pre><p>Look at that beautiful scrolling…..but it gets cutoff. We need a way for it to repeat.</p><p>Lets make some code to have the image loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qlLPC4lOsgEsDyTB4YrMfQ.png" /></figure><p>Here we added some code to the update method saying if</p><pre>@scroll_x is greater than the width of the foreground image then loop it. </pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F5oJqZQkA9r396LQe5N%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F5oJqZQkA9r396LQe5N%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F5oJqZQkA9r396LQe5N%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="152" frameborder="0" scrolling="no"><a href="https://medium.com/media/44490be27a1be35a652718ad6e171b47/href">https://medium.com/media/44490be27a1be35a652718ad6e171b47/href</a></iframe><p>Pretty cool…. But now its looping but we have that empty space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M1rjFRQVY_hsIP8uUmREgA.png" /></figure><pre>require &#39;gosu&#39;</pre><pre>class GameWindow &lt; Gosu::Window<br>  def initialize(*args)<br>    super<br>    <a href="http://twitter.com/scroll_x">@scroll_x</a> = 0<br>    <a href="http://twitter.com/background">@background</a> = Gosu::Image.new(self, &#39;images/background.png&#39;, false) #last false is for tielable argument and that is just how the edges get rendered, dont need now<br>    <a href="http://twitter.com/foreground">@foreground</a> = Gosu::Image.new(self, &#39;images/foreground.png&#39;, true)<br>  end</pre><pre>def button_down(button)<br>    close if button == Gosu::KbEscape<br>  end</pre><pre>def update<br>    <a href="http://twitter.com/scroll_x">@scroll_x</a> += 3<br>    if <a href="http://twitter.com/scroll_x">@scroll_x</a> &gt; <a href="http://twitter.com/foreground">@foreground</a>.width<br>      <a href="http://twitter.com/scroll_x">@scroll_x</a> = 0<br>    end<br>  end</pre><pre>def draw<br>    <a href="http://twitter.com/background">@background</a>.draw(0, 0 ,0)<br>    <a href="http://twitter.com/foreground">@foreground</a>.draw(<a href="http://twitter.com/scroll_x">@scroll_x</a>, 0 ,0)<br>    <a href="http://twitter.com/foreground">@foreground</a>.draw(<a href="http://twitter.com/scroll_x">@scroll_x</a> - <a href="http://twitter.com/foreground">@foreground</a>.width, 0 ,0)<br>  end</pre><pre>end</pre><pre>window = GameWindow.new(320, 480, false) # screen size + false is for NOT full screen<br>window.show</pre><p>So what we want to do in summary is to draw another foreground and then have it seamlessly attach to the first foreground image so that there is no gap and we have a nice loop with no blank space.</p><p>We would first add another</p><pre>@foreground.draw <br># add to draw method but in argument subtract the @foreground.width so no empty space</pre><p>Then</p><pre>#in the initialize method we would edit the last foreground argument which if you remember is the tiling and set that to true so that the second image will tile right after the first one scrolls.  <br>The two images will be right next to each other consecutively. </pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FMTKNaaaGHT3RWLS0AC%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FMTKNaaaGHT3RWLS0AC%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FMTKNaaaGHT3RWLS0AC%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="175" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7f5b0ff1cd62a1c53174608bd2b7d30/href">https://medium.com/media/a7f5b0ff1cd62a1c53174608bd2b7d30/href</a></iframe><h3>Wow! Awesome!</h3><p>Congratulations you have just made an infinite loop of your foreground to use in your game! Now play around and explore with what we have done so far. Please continue at your own pace by coding along with the official tutorial.</p><p>Also be sure to try out the final game itself as it is a lot of fun and to take a look at the final code.</p><h4>See? That wasn’t so bad was it?</h4><p>I actually had a lot of fun coding along with the tutorial and learning about so many new things in just the first small portion of this game.</p><p>The big takeaway here is that although I know Ruby isn’t the language of choice for games, there are a lot of similarities and thought processes that coincide with the other languages. The logic behind things such as collision detection, game physics, and randomizers just to name a few are all important areas that games will most likely use.</p><p>So fulfill those childhood fantasies and start to make your game idea a reality!</p><h4>Full Tutorial Link</h4><p><a href="https://www.youtube.com/watch?v=QtIlyU2Br3o">https://www.youtube.com/watch?v=QtIlyU2Br3o</a></p><h4>You can also view the finished code at</h4><p><a href="https://www.youtube.com/redirect?v=QtIlyU2Br3o&amp;redir_token=PPONuGhGbJhxGe2sTyXDu0VWCB58MTU1MTMyMTc2OEAxNTUxMjM1MzY4&amp;event=video_description&amp;q=https%3A%2F%2Fgithub.com%2Ftomdalling%2Ffruity_bat">https://github.com/tomdalling/fruity_bat</a></p><ul><li>**Please note as of this post the finished code uses an older ruby version so an error will popup as well as an error regarding the use of an older “Gosu” gem version. Just rvm install the version listed in the error. This will just install 1 more version of ruby on your computer that you can switch to when needed so don’t worry, you are not overwriting your current version. Then in the Gemfile manually set the version to the current version then bundle install.</li><li>(See below)**</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IDT7C9oEao1ruatBIju9zw.png" /></figure><blockquote>cover image: middlebury.edu</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=673f74d6d5ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitten by a bug? => Say “bye bye!” with a SUPER pry!]]></title>
            <link>https://itnext.io/bitten-by-a-bug-say-bye-bye-with-a-super-pry-765eb3d7ea4?source=rss-e0397903fd75------2</link>
            <guid isPermaLink="false">https://medium.com/p/765eb3d7ea4</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[pry]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Robert Han]]></dc:creator>
            <pubDate>Tue, 12 Feb 2019 07:06:47 GMT</pubDate>
            <atom:updated>2019-02-13T03:19:03.863Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bitten by a bug? =&gt; Say “bye bye!” with a SUPER ‘pry’!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*y1dtlCSe2RYjvbK_JqWsJA.png" /></figure><p>Imagine if you could:</p><ol><li>Add as many binding.pry’s you want to anywhere in your code while in a pry session without exiting and restarting!</li><li>Go through your code from start to finish and be able to follow exactly the path/flow of all your methods?</li></ol><p>Given this sample code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*z5ngDydXZo5KlltCyIZtxg.png" /></figure><pre>1:  def test_method<br>2:  10.times.each do |i|<br>3:   puts i <br>4:  end </pre><p>3. Be able to give a conditional pry such as only <strong>‘pry’ </strong>if i == 5.</p><h3>This &amp; more is possible with…….</h3><p>“Look!</p><p>Up in the sky!</p><p>It’s a bird!</p><p>It’s a plane!</p><p>It’s Super PRY!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*GVLn3gzP9dbEGajqrr3ZBg.gif" /></figure><h3>Let your pry gain superpowers with the “pry bye-bug” gem!</h3><p>Upon starting my journey as a Flat Iron School Bootcamp student, I realized I would have to become best friends with what I thought was the equivalent of a dentist visit, require <strong>‘pry’</strong>. During my pre-work leading up to the program, I was introduced to this magical being <strong>‘pry’</strong> but it seemed so foreign to me and using it seemed like such a drag…like a long, dial up modem kind of lag. I grew up most of my life in NY so I am used to everything being quick, TYPE A, you get the point. So, when I started using <strong>‘pry’</strong> at this time it felt like a momentum stopper to my coding.</p><p>Having to constantly stop coding and repeatedly put <strong>‘pry’s’</strong> everywhere to see if my code worked and then having to exit out and rerun my program seemed so tedious. I said to myself, “There has to be a better way to pry.” I did some research and sure enough, somebody made a special pry gem called “pry bye-bug” that essentially supercharges pry. Let’s install it first.</p><p>To install the gem:</p><p>Add:</p><pre>gem ‘pry-byebug’</pre><p>To your Gemfile and run:</p><pre>&#39;bundle install&#39; or just &#39;bundle&#39; (shortcut)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*ZvAvlTsDA9y4z85hHZArCw.png" /></figure><pre>source &quot;<a href="https://rubygems.org/">https://rubygems.org</a>&quot;</pre><pre>gem &quot;sinatra-activerecord&quot;<br>gem &quot;sqlite3&quot;<br>gem &quot;pry&quot;<br>gem &quot;require_all&quot;<br>gem &quot;dotenv&quot;<br>gem &quot;http&quot;<br>gem &#39;pry-byebug&#39;</pre><p>Also you will need to use the original <strong>‘pry’ </strong>method so you need to keep the require<strong> ‘pry’.</strong></p><p>To activate pry-byebug’s superpowers you can use pry as you normally would and it will execute on the first statement after your</p><pre>binding.pry </pre><p>After playing around with the gem, I found it most powerful to put the binding.pry in my “run file” right before the first method/statement. The reason is that this gem allows us to go through our code literally line by line or method by method. So by placing the binding.pry at the very start we can go through our whole code literally from start to finish. We’ll use one of our API labs as a good example of pry-byebug in action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*KCGrpomh7N-dGxnUmQuLUg.png" /></figure><pre>require_relative &quot;../lib/api_communicator.rb&quot;<br>require_relative &quot;../lib/command_line_interface.rb&quot;<br>require &#39;pry&#39;</pre><pre>binding.pry<br>welcome<br>character = get_character_from_user<br>show_character_movies(character)</pre><p>Here’s some of my code so you can have some context:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*ueugxmiIuVmJSvzIk6KTgw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YVvJ0OQnxBZGYL550uNp1g.png" /></figure><pre>def welcome<br> puts ‘*’ * 30<br> puts “Welcome to Star Wars SEARCH”<br> puts ‘*’ * 30<br>end</pre><pre>def get_character_from_user<br> puts “please enter a character name”</pre><pre>user_input = “Luke Skywalker”<br>user_input</pre><pre>test_method<br> # use gets to capture the user’s input. This method should return that input, downcased.<br>end</pre><pre>def test_method<br> 10.times.each do |i|<br> puts i<br> end <br>end</pre><p>Normally in this last picture the user_input would be a gets.chomp but to see my program in action I hard coded a possible search term, “Luke Skywalker” into it so that I can see how my program runs. **Also if you notice I put in the test_method method to be able to test out the conditional pry functionality I mentioned before.</p><p>Now open up the terminal and lets run</p><pre>ruby ./bin/run.rb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i4-5wpnA42KwE_DWuPY_4Q.png" /></figure><p>Great! It stopped on the first statement/method after the <strong>‘pry’. </strong>Here is a simple overview of our command options at this point from the gem Readme file : (**My comments are followed by the hash sign**)</p><ol><li>break: Manage breakpoints. #This is essentially binding.pry’s. More on this later.</li><li>step: Step execution into the next line or method. Takes an optional numeric argument to step multiple times. #This is for if you want to get into the nitty gritty and when executed at a method will go into the method line by line every time you type “step”.</li><li>next: Step over to the next line within the same frame. Also takes an optional numeric argument to step multiple lines. #Will move onto the next method.</li><li>finish: Execute until current stack frame returns.# Finishes the current method/stack.</li><li>continue: Continue program execution and end the Pry session.# Runs the rest of the code same as if you were to type ‘exit’ in a normal <strong>‘pry’.</strong></li></ol><p>Step #1 currently is invalid as we do not have any breakpoints yet.</p><p>If you select #2 “step” want to literally follow the flow of your code from start to finish you would just keep pressing ‘step’. Or after doing it once, press the up arrow and then enter in a loop. :)</p><p>If you select #3 “next” this just moves on to the next method.</p><p>We will select #3 “next”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Uaip1IdHFVdPgi_km893Q.png" /></figure><p>Notice how the welcome method ran and we have now moved on to the next method. Lets dive into this one by choosing “step”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxTtVTl1cHCui2I24TtHvg.png" /></figure><p>Now type “step” again to move to the next statement</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tu-V_RIfbkZkSgB4U-H_Lw.png" /></figure><p>What’s really cool is that you can be in a pry where pry’s normally would not stop such as line 11. But we can “step” one more time and we can test as if we stopped there on a pry!</p><p>So let’s have some fun and try out a conditional pry as well as setting up another pry at the test_method method on line 18 and 19.</p><p>First to set the equivalent of a binding.pry elsewhere we will be using the “break” function.</p><p>Here is the official ReadMe from the gem post:</p><p>############################################<br>“You can set and adjust breakpoints directly from a Pry session using the break command:</p><p>break: Set a new breakpoint from a line number in the current file, a file and line number, or a method. Pass an optional expression to create a conditional breakpoint. Edit existing breakpoints via various flags.</p><p>Examples:</p><pre>break SomeClass#run            # Break at the start of `SomeClass#run`.<br>break Foo#bar if baz?          # Break at `Foo#bar` only if `baz?`.<br>break app/models/user.rb:15    # Break at line 15 in user.rb.<br>break 14                       # Break at line 14 in the current file.<br><br>break --condition 4 x &gt; 2      # Change condition on breakpoint #4 to &#39;x &gt; 2&#39;.<br>break --condition 3            # Remove the condition on breakpoint #3.<br><br>break --delete 5               # Delete breakpoint #5.<br>break --disable-all            # Disable all breakpoints.<br><br>break                          # List all breakpoints.<br>break --show 2                 # Show details about breakpoint #2.</pre><p>Type break --help from a Pry session to see all available options.”</p><p>############################################</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*YVvJ0OQnxBZGYL550uNp1g.png" /></figure><p>I will be using the break function by “break 18” #This means make a breakpoint or a binding.pry between line 17 and 18. We should get a confirm message.</p><p>Lets try it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*L0IAv2ltfjXtCTtAQpVbGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A3YCQGAEBEOTbkj5n2cRSQ.png" /></figure><p>It should tell you that there is now a Breakpoint 1: /Users/…</p><p>Now lets also make a conditional pry at line 19 by typing</p><pre>break line 19 if i == 5</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*gB-TRKD1UwgYj8EGvklzew.png" /></figure><p>We should get a Breakpoint 2: message confirming the creation.</p><p>Now lets type “continue” which as a reminder is,</p><p>“continue: Continue program execution and end the Pry session.# Runs the rest of the code same as if you were to type ‘exit’ in a normal <strong>‘pry’.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*dyH9yv86BjaW3EP2MgtdqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*OwRWUZtn67g6ZenUCWHA9g.png" /></figure><p>Yay! We hit our pry on 18. Let’s try to continue to see if it stops on 19 by “continue” again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*FS1S5KcKzYvXUIZxZbrE6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*DFWsIjJK5jymUqDszgzGzw.png" /></figure><p>Look! It stopped! And if we check to see what “i” is, it is 5! Great! So as you can see the pry-byebug gem is really powerful and would be a great sidekick to any programmer.</p><p>Please feel free to play around with this great tool on your own. I have added code snippets after each picture so you can try out the pry-byebug for yourself.</p><p>Here is the official URL for the gem post:</p><p><a href="https://github.com/deivid-rodriguez/pry-byebug">https://github.com/deivid-rodriguez/pry-byebug</a></p><p>Thanks for stopping by!</p><h3>EXIT!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=765eb3d7ea4" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/bitten-by-a-bug-say-bye-bye-with-a-super-pry-765eb3d7ea4">Bitten by a bug? =&gt; Say “bye bye!” with a SUPER pry!</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>