<?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: Peter Haddad</title>
    <description>The latest articles on DEV Community by Peter Haddad (@peterhdd).</description>
    <link>https://dev.to/peterhdd</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%2F223473%2F9a099758-522f-490d-a85a-49ef739e8c4d.jpeg</url>
      <title>DEV Community: Peter Haddad</title>
      <link>https://dev.to/peterhdd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/peterhdd"/>
    <language>en</language>
    <item>
      <title>Data Structure cheat sheet</title>
      <dc:creator>Peter Haddad</dc:creator>
      <pubDate>Sun, 01 Sep 2024 20:50:22 +0000</pubDate>
      <link>https://dev.to/peterhdd/data-structure-cheat-sheet-jmp</link>
      <guid>https://dev.to/peterhdd/data-structure-cheat-sheet-jmp</guid>
      <description>&lt;p&gt;Data structure cheat sheet in which I explain in simple terms how to use and implement different data structures and also explain about the different algorithms related to searching and sorting. In the repository i use both Python and Java.&lt;/p&gt;

&lt;p&gt;You can find the repository here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/PeterHdd/coding-interview-preparations" rel="noopener noreferrer"&gt;https://github.com/PeterHdd/coding-interview-preparations&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
      <category>java</category>
    </item>
    <item>
      <title>Introducing PCER, A CLI Tool</title>
      <dc:creator>Peter Haddad</dc:creator>
      <pubDate>Mon, 15 May 2023 18:15:33 +0000</pubDate>
      <link>https://dev.to/peterhdd/introducing-pcer-a-cli-tool-2cg7</link>
      <guid>https://dev.to/peterhdd/introducing-pcer-a-cli-tool-2cg7</guid>
      <description>&lt;p&gt;PCER is an NPM CLI tool, which makes it easier for people working in companies with some proxy system to be able to add certificates in thier locally machine.&lt;/p&gt;

&lt;p&gt;To use it, all you have to do first:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -g pcer&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This would download the latest version, then you can do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pcer --help&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Which would give you the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZniAs6tE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://github.com/PeterHdd/pcer/assets/29070108/3f127245-94f2-4e6d-b596-9e80d25f833a" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZniAs6tE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://github.com/PeterHdd/pcer/assets/29070108/3f127245-94f2-4e6d-b596-9e80d25f833a" alt="image" width="800" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here you can see all the available commands, if you want to add SSL certificates to ca-bundle.crt, you can first create an alias for it and then easily always reuse it for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pcer alias git "C:\Program Files\Git\mingw64\etc\ssl\certs\ca-bundle.crt"
pcer add C:/Users/p.haddad/Downloads/github.crt -l git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This would first create the alias, and then it gets added to ca-bundle.crt file.&lt;/p&gt;

&lt;p&gt;You can read more about it here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/PeterHdd/pcer"&gt;https://github.com/PeterHdd/pcer&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>github</category>
      <category>node</category>
    </item>
    <item>
      <title>NextJS with TailwindCSS and Firebase</title>
      <dc:creator>Peter Haddad</dc:creator>
      <pubDate>Mon, 24 Apr 2023 21:01:11 +0000</pubDate>
      <link>https://dev.to/peterhdd/nextjs-with-tailwindcss-and-firebase-35ec</link>
      <guid>https://dev.to/peterhdd/nextjs-with-tailwindcss-and-firebase-35ec</guid>
      <description>&lt;p&gt;I have created a responsive weather app showcasing the use of NextJS with Tailwind CSS and also using Firebase for storing data in Firestore. You can find the source code here:&lt;/p&gt;

&lt;p&gt;Source code: &lt;a href="https://github.com/PeterHdd/nextjs-weather-app"&gt;Github Project&lt;/a&gt;&lt;br&gt;
Deployment: &lt;a href="https://weather-indol.vercel.app/"&gt;https://weather-indol.vercel.app/&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  To get Started
&lt;/h2&gt;

&lt;p&gt;First you would need to create a project in Firebase and then get the &lt;code&gt;firebaseconfig&lt;/code&gt; object and add the firebase API keys in the &lt;code&gt;.env.local&lt;/code&gt; file. Then you can clone the project here and then execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which would install the NPM packages found in the package.json.&lt;/p&gt;

&lt;p&gt;Then you can execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which will run the development environment and you can find it in &lt;a href="http://localhost:3000"&gt;http://localhost:3000&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Concepts used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic Routing&lt;/li&gt;
&lt;li&gt;Server side rendering&lt;/li&gt;
&lt;li&gt;Tailwind CSS&lt;/li&gt;
&lt;li&gt;Mock Data&lt;/li&gt;
&lt;li&gt;Firebase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you find the repository useful, support it by starring it!&lt;/p&gt;

</description>
      <category>firebase</category>
      <category>nextjs</category>
      <category>tailwindcss</category>
      <category>react</category>
    </item>
    <item>
      <title>Github Repositories</title>
      <dc:creator>Peter Haddad</dc:creator>
      <pubDate>Sun, 18 Apr 2021 17:22:53 +0000</pubDate>
      <link>https://dev.to/peterhdd/github-repositories-46mi</link>
      <guid>https://dev.to/peterhdd/github-repositories-46mi</guid>
      <description>&lt;p&gt;Showcase your Github repositories in your static website, including updated stars, forks count! Check the repository here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/PeterHdd/ghrepos"&gt;https://github.com/PeterHdd/ghrepos&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;website: &lt;a href="https://peterhdd.github.io/ghrepos/"&gt;https://peterhdd.github.io/ghrepos/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;just include the iframe provided in the website, add your Github username, stars condition and you can have a section dedicated to your Github projects in your static website.&lt;/p&gt;

</description>
      <category>github</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Generate getters And Setters</title>
      <dc:creator>Peter Haddad</dc:creator>
      <pubDate>Wed, 01 Jan 2020 23:31:10 +0000</pubDate>
      <link>https://dev.to/peterhdd/generate-getters-and-setters-4lb9</link>
      <guid>https://dev.to/peterhdd/generate-getters-and-setters-4lb9</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/PeterHdd/gettersetter"&gt;https://github.com/PeterHdd/gettersetter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dart VsCode Extension to automatically generate getters and setters. &lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
    </item>
    <item>
      <title>Answer: What is the difference between calling the function without parentheses and with parentheses</title>
      <dc:creator>Peter Haddad</dc:creator>
      <pubDate>Sat, 28 Dec 2019 15:30:54 +0000</pubDate>
      <link>https://dev.to/peterhdd/answer-what-is-the-difference-between-calling-the-function-without-parentheses-and-with-parentheses-1fgf</link>
      <guid>https://dev.to/peterhdd/answer-what-is-the-difference-between-calling-the-function-without-parentheses-and-with-parentheses-1fgf</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/59497620/what-is-the-difference-between-calling-the-function-without-parentheses-and-with/59504089#59504089" rel="noopener noreferrer"&gt;
              &lt;span class="title-flare"&gt;answer&lt;/span&gt; re:  What is the difference between calling the function without parentheses and with parentheses
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Dec 27 '19&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/59497620/what-is-the-difference-between-calling-the-function-without-parentheses-and-with/59504089#59504089" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          3
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;&lt;code&gt;_incrementCounter&lt;/code&gt; inside &lt;code&gt;onPressed&lt;/code&gt; is a function reference, which basically means it is not executed immediately, it is executed after the user clicks on the specific widget.(callback)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;_incrementCounter()&lt;/code&gt; is a function call and it is executed immediately.&lt;/p&gt;

&lt;p&gt;Therefore, inside &lt;code&gt;onPressed&lt;/code&gt; you can either pass a function reference or an anonymous function…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/59497620/what-is-the-difference-between-calling-the-function-without-parentheses-and-with/59504089#59504089" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>flutter</category>
    </item>
    <item>
      <title>Answer: Update fields in nested objects in firestore documents?</title>
      <dc:creator>Peter Haddad</dc:creator>
      <pubDate>Tue, 22 Oct 2019 18:44:15 +0000</pubDate>
      <link>https://dev.to/peterhdd/answer-update-fields-in-nested-objects-in-firestore-documents-4a9g</link>
      <guid>https://dev.to/peterhdd/answer-update-fields-in-nested-objects-in-firestore-documents-4a9g</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/49150917/update-fields-in-nested-objects-in-firestore-documents/49151326#49151326" rel="noopener noreferrer"&gt;
              &lt;span class="title-flare"&gt;answer&lt;/span&gt; re:  Update fields in nested objects in firestore documents?
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Mar  7 '18&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/49150917/update-fields-in-nested-objects-in-firestore-documents/49151326#49151326" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          25
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;According to the link you provided, it says this:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;If your document contains nested objects, you can use "dot notation" to reference nested fields within the document when you call update():&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Therefore you need to use &lt;code&gt;dot notation&lt;/code&gt; to be able to update only one field without overwriting, so like…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/49150917/update-fields-in-nested-objects-in-firestore-documents/49151326#49151326" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>firestore</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Answer: Catch Firestore error in valueChanges subscription and retry in case of failure</title>
      <dc:creator>Peter Haddad</dc:creator>
      <pubDate>Tue, 08 Oct 2019 16:51:40 +0000</pubDate>
      <link>https://dev.to/peterhdd/answer-catch-firestore-error-in-valuechanges-subscription-and-retry-in-case-of-failure-14hp</link>
      <guid>https://dev.to/peterhdd/answer-catch-firestore-error-in-valuechanges-subscription-and-retry-in-case-of-failure-14hp</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/58093513/catch-firestore-error-in-valuechanges-subscription-and-retry-in-case-of-failure/58093751#58093751" rel="noopener noreferrer"&gt;
              &lt;span class="title-flare"&gt;answer&lt;/span&gt; re:  Catch Firestore error in valueChanges subscription and retry in case of failure
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Sep 25 '19&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/58093513/catch-firestore-error-in-valuechanges-subscription-and-retry-in-case-of-failure/58093751#58093751" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          4
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;The &lt;code&gt;subscribe&lt;/code&gt; method contains a second argument incase of error:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;code&gt;Rx.Observable.prototype.subscribe([observer] | [onNext], [onError], [onCompleted])&lt;/code&gt;&lt;/p&gt;
  
  &lt;ul&gt;
  &lt;li&gt;&lt;p&gt;[observer] (Observer): The object that is to receive notifications.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;[onNext] (Function): Function to invoke for each element in the observable sequence.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;[onError] (Function): Function to invoke upon exceptional termination of the observable sequence.&lt;/li&gt;
  &lt;li&gt;[onCompleted] (Function)…&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/58093513/catch-firestore-error-in-valuechanges-subscription-and-retry-in-case-of-failure/58093751#58093751" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>firebase</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
