<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: zivka</title>
    <description>The latest articles on DEV Community by zivka (@ziv).</description>
    <link>https://dev.to/ziv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F258961%2F85d1ab7b-456a-4d3c-8f7f-e3636db17cb7.jpg</url>
      <title>DEV Community: zivka</title>
      <link>https://dev.to/ziv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ziv"/>
    <language>en</language>
    <item>
      <title>How to find repos to contribute to during Hacktoberfest </title>
      <dc:creator>zivka</dc:creator>
      <pubDate>Wed, 20 Oct 2021 20:06:38 +0000</pubDate>
      <link>https://dev.to/ziv/how-to-find-repos-to-contribute-to-during-hacktoberfest-42ki</link>
      <guid>https://dev.to/ziv/how-to-find-repos-to-contribute-to-during-hacktoberfest-42ki</guid>
      <description>&lt;p&gt;I really wanted to be part of Hacktoberfest celebration. Find a repo, understanding the issue and create a pull request that will be merged... &lt;/p&gt;

&lt;p&gt;But, it's not so easy when so many people want to do this as well.&lt;/p&gt;

&lt;p&gt;So let me share with you a quick tip how to find easily repos that you can contribute to during Hacktoberfest.&lt;/p&gt;

&lt;p&gt;In github there is an option for &lt;a href="https://github.com/search/advanced" rel="noopener noreferrer"&gt;advanced search&lt;/a&gt; &lt;br&gt;
I'm using the following filters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With the labels - hacktoberfest (well, duh)&lt;/li&gt;
&lt;li&gt;Written language - javascript (but it's really up to you)&lt;/li&gt;
&lt;li&gt;In the state - open&lt;/li&gt;
&lt;li&gt;With this many comments - 0 (so no one started to work on them)&lt;/li&gt;
&lt;li&gt;With this many stars - &amp;gt; 15 (it's legit repo)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's a search &lt;a href="https://github.com/search?q=label%3Ahacktoberfest+state%3Aopen+comments%3A0+language%3AJavaScript+state%3Aopen+language%3AJavaScript&amp;amp;type=Issues&amp;amp;ref=advsearch&amp;amp;l=JavaScript&amp;amp;l=JavaScript" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6kgcrhlkszz6mlamgfqf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6kgcrhlkszz6mlamgfqf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Good luck...&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>github</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Hackathon Swags</title>
      <dc:creator>zivka</dc:creator>
      <pubDate>Thu, 15 Apr 2021 13:30:33 +0000</pubDate>
      <link>https://dev.to/ziv/hackathon-swags-5bda</link>
      <guid>https://dev.to/ziv/hackathon-swags-5bda</guid>
      <description>&lt;p&gt;Hey, &lt;br&gt;
I'm responsible for the upcoming hackathon swags in my company.&lt;/p&gt;

&lt;p&gt;What was the coolest swag you've ever get?&lt;br&gt;
Photo can really help:)&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Running Puppeteer on Heroku Free Tier </title>
      <dc:creator>zivka</dc:creator>
      <pubDate>Tue, 27 Oct 2020 12:03:14 +0000</pubDate>
      <link>https://dev.to/ziv/running-puppeteer-on-heroku-free-tier-e7b</link>
      <guid>https://dev.to/ziv/running-puppeteer-on-heroku-free-tier-e7b</guid>
      <description>&lt;p&gt;Heroku is my favorite cloud platform to host my apps.&lt;br&gt;
During Covid-19 I created myself some cool automation(I'm working on another post on it) and was looking for a place to run it for free.&lt;/p&gt;

&lt;p&gt;For example, notify me when my restaurant is open in Wolt.&lt;/p&gt;

&lt;p&gt;So my requirement was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running puppeteer&lt;/li&gt;
&lt;li&gt;Easy to create a scheduled task&lt;/li&gt;
&lt;li&gt;Easy to deploy&lt;/li&gt;
&lt;li&gt;Free&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have experience with Heroku, so it was my first choice.&lt;br&gt;
The &lt;a href="https://www.heroku.com/pricing" rel="noopener noreferrer"&gt;free tier&lt;/a&gt; is giving you more than 500h per month.&lt;/p&gt;

&lt;p&gt;Easy to sync with my GitHub repo already integrated into Heroku.&lt;/p&gt;

&lt;p&gt;Scheduled task - There is a simple addon named - &lt;a href="https://elements.heroku.com/addons/scheduler" rel="noopener noreferrer"&gt;Heroku Scheduler&lt;/a&gt; which allows you to run commands in scheduled time. Super easy to use, and doesn't require any additional runtime of the instance itself(so we're still in the free tier)&lt;/p&gt;

&lt;p&gt;The biggest problem for me was to find the right configuration to run a puppeteer in Heroku.&lt;br&gt;
BTW, if you don't know &lt;a href="https://developers.google.com/web/tools/puppeteer" rel="noopener noreferrer"&gt;puppeteer&lt;/a&gt; yet. &lt;code&gt;Puppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I was looking at how to run it, but couldn't find a configuration that worked for me...&lt;/p&gt;

&lt;p&gt;So, this is my configuration(it's not necessarily ideal, but it works)&lt;/p&gt;

&lt;p&gt;Buildpacks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/jontewks/puppeteer-heroku-buildpack" rel="noopener noreferrer"&gt;https://github.com/jontewks/puppeteer-heroku-buildpack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;heroku/nodejs
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe4p6pbituelx4aq03f99.png" alt="Alt Text"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;JS code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chromeOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;headless&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;defaultViewport&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;--incognito&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;--no-sandbox&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;--single-process&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;--no-zygote&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chromeOptions&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the following flags when you launch puppeteer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"--incognito",&lt;/li&gt;
&lt;li&gt;"--no-sandbox",&lt;/li&gt;
&lt;li&gt;"--single-process",&lt;/li&gt;
&lt;li&gt;"--no-zygote"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to read more about it...&lt;/p&gt;

&lt;p&gt;I hope it solved your problem:)&lt;br&gt;
Good luck&lt;/p&gt;

</description>
      <category>heroku</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>A Gag on a recursion</title>
      <dc:creator>zivka</dc:creator>
      <pubDate>Mon, 26 Oct 2020 21:09:09 +0000</pubDate>
      <link>https://dev.to/ziv/understanding-recursion-4j9m</link>
      <guid>https://dev.to/ziv/understanding-recursion-4j9m</guid>
      <description>&lt;p&gt;Recursion is a method of solving problems in which the solution relies on a simpler instance of the problem.&lt;br&gt;
In order to understand it better press &lt;a href="https://dev.to/ziv/understanding-recursion-4j9m?message=hello"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>computerscience</category>
      <category>functional</category>
    </item>
    <item>
      <title>Dockerize Create-React-App in 3 minutes</title>
      <dc:creator>zivka</dc:creator>
      <pubDate>Sat, 04 Jan 2020 02:17:00 +0000</pubDate>
      <link>https://dev.to/ziv/dockerize-create-react-app-in-3-minutes-3om3</link>
      <guid>https://dev.to/ziv/dockerize-create-react-app-in-3-minutes-3om3</guid>
      <description>&lt;p&gt;First of all, I'm pretty excited since it's my first blog post ever... I hope you would like it&lt;/p&gt;

&lt;p&gt;Lately I got a full stack home assignment which was included NodeJS micro services in  the backend and React for the front-end.&lt;/p&gt;

&lt;p&gt;I created a really nice project using &lt;a href="https://github.com/facebook/create-react-app"&gt;Create React App&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you don't know Create React App, It's creating in less then 20 seconds React App the works Simply by running the following command&lt;br&gt;
&lt;br&gt;
&lt;code&gt;npx create-react-app webapp&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Ok, once I got my project, I coded my stuff, which was pretty straight forward using the basic templated. Then I wonder, what will be the easiest way to serve this page.&lt;br&gt;
Remember that I need to submit this home assignment.&lt;/p&gt;

&lt;p&gt;Since I already have micro-services I had docker-compose file for the rest of the services, so I was looking how to dockerized my React project.&lt;/p&gt;

&lt;p&gt;I'm happy to tell you that it's really easy.&lt;/p&gt;

&lt;p&gt;Let's say my project name is webapp.&lt;/p&gt;

&lt;p&gt;Create two files under the project root folder &lt;code&gt;Dockerfile&lt;/code&gt; and &lt;code&gt;.dockerignore&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Copy the content into your files accordingly&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Lines 1 - 6 are building the image:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating working dir&lt;/li&gt;
&lt;li&gt;Copy all the files besides the one in the &lt;code&gt;.dockerignore&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Installing react-scripts which is using for serving the project&lt;/li&gt;
&lt;li&gt;Running yarn insatll - Get the dependencis &lt;/li&gt;
&lt;li&gt;Yarn run build - Build the project in optimized way&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Lines 8-12 are the one used to serve the project.&lt;br&gt;
Note the at we are serving this project in port &lt;code&gt;80&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let's build this image just run on the &lt;code&gt;Dockerfile&lt;/code&gt; folder&lt;br&gt;
&lt;code&gt;docker build -t react-webapp .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And run our container&lt;br&gt;
&lt;code&gt;docker run -it -p 8000:80 react-webapp&lt;/code&gt;&lt;br&gt;
Once the container is running, you can open &lt;a href="http://localhost:8000"&gt;http://localhost:8000&lt;/a&gt; and you'll be able to access the React app running inside the Docker container.&lt;/p&gt;

&lt;p&gt;For docker-compose you can copy&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;That's it...&lt;br&gt;
Now you got a dockerized UI solution in less then 3 minutes.&lt;/p&gt;

</description>
      <category>react</category>
      <category>docker</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
