<?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: Maxime Kubik</title>
    <description>The latest articles on DEV Community by Maxime Kubik (@mkubdev).</description>
    <link>https://dev.to/mkubdev</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%2F266741%2F6d22afcd-ff85-487a-965c-117f2095f681.jpg</url>
      <title>DEV Community: Maxime Kubik</title>
      <link>https://dev.to/mkubdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mkubdev"/>
    <language>en</language>
    <item>
      <title>Cypress 💚 Iframes</title>
      <dc:creator>Maxime Kubik</dc:creator>
      <pubDate>Mon, 28 Feb 2022 14:29:44 +0000</pubDate>
      <link>https://dev.to/mkubdev/cypress-iframes-1ole</link>
      <guid>https://dev.to/mkubdev/cypress-iframes-1ole</guid>
      <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;If you've ever used Cypress, you probably know that testing Iframes isn't always easy. Especially when you want to test a child iframe contained in a parent iframe.&lt;/p&gt;

&lt;p&gt;That's why &lt;a href="https://github.com/mkubdev/cypress-nested-iframe"&gt;I created an example&lt;/a&gt; on one of the ways it could be used in this context 🌌&lt;/p&gt;




&lt;p&gt;⚙️ An example of how to use &lt;a href="https://www.cypress.io/"&gt;Cypress&lt;/a&gt; to target nested elements within iframes.&lt;/p&gt;

&lt;p&gt;With limited iframe support from Cypress [&lt;a href="https://github.com/cypress-io/cypress/issues/136"&gt;Issue #136&lt;/a&gt;], the following workaround in this repo allowed to target elements and interact with iframes during tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explanation
&lt;/h2&gt;

&lt;p&gt;The solution is to create an iframe command that returns a promise upon iframe loading completion. These commands, aliased as &lt;code&gt;iframe()&lt;/code&gt;, can be chained together to deal with nested iframes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Javascript:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// support/commands.js&lt;/span&gt;

&lt;span class="nx"&gt;Cypress&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Commands&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;iframe&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="na"&gt;prevSubject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;element&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;$iframe&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Cypress&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;$iframe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$iframe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;body&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="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is an example of usage:&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="c1"&gt;// One iframe&lt;/span&gt;
&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#iframe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#target&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;HELLO WORLD&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Nested iframes&lt;/span&gt;
&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#firstFrame&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#secondFrame&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#target&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;HELLO WORLD&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Typescript:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// support/commands.ts&lt;/span&gt;

&lt;span class="kr"&gt;declare&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nx"&gt;Cypress&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Chainable&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;Chainable&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Element&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;Cypress&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Commands&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;iframe&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="na"&gt;prevSubject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;element&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="nx"&gt;$iframe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JQuery&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Element&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Cypress&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Element&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;$iframe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$iframe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;body&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="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is an example of usage (same as javascript):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// One iframe&lt;/span&gt;
&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#iframe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#target&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;HELLO WORLD&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Nested iframes&lt;/span&gt;
&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#firstFrame&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#secondFrame&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#target&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;HELLO WORLD&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/mkubdev/cypress-nested-iframe"&gt;The Github repository&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.cypress.io/"&gt;Cypress.io&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cypress</category>
      <category>javascript</category>
      <category>todayilearned</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How To Install NVM on macOS with Homebrew</title>
      <dc:creator>Maxime Kubik</dc:creator>
      <pubDate>Fri, 30 Apr 2021 09:23:39 +0000</pubDate>
      <link>https://dev.to/mkubdev/how-to-install-nvm-on-macos-with-homebrew-gfn</link>
      <guid>https://dev.to/mkubdev/how-to-install-nvm-on-macos-with-homebrew-gfn</guid>
      <description>&lt;p&gt;The NVM (Node Version Manager) is a shell script used for installing and managing Node.js on a Linux based system. The macOS users can install NVM using the homebrew.&lt;/p&gt;

&lt;p&gt;This tutorial help you to install NVM on your macOS system and manage Node.js versions.&lt;/p&gt;

&lt;h1&gt;
  
  
  Prerequisites
&lt;/h1&gt;

&lt;p&gt;You must have macOS desktop access with administrator privileges.&lt;/p&gt;

&lt;p&gt;Login to the macOS desktop system and install Homebrew on your system (if not already installed)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

ruby &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Homebrew/install/master/install&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Step 1 – Remove existing Node Versions
&lt;/h1&gt;

&lt;p&gt;If your system already have node installed, uninstall it first. My system already have installed node via Homebrew. So uninstalling it first. Skip if not already installed.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

brew uninstall &lt;span class="nt"&gt;--ignore-dependencies&lt;/span&gt; node 
brew uninstall &lt;span class="nt"&gt;--force&lt;/span&gt; node 


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Step 2 – Install NVM on macOS
&lt;/h1&gt;

&lt;p&gt;Now, you system is ready for the installation. Update the Homebrew package list and install NVM.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

brew update 
brew &lt;span class="nb"&gt;install &lt;/span&gt;nvm


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next, create a directory for NVM in home.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;mkdir&lt;/span&gt; ~/.nvm 


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, configure the required environment variables. Edit the following configuration file in your home directory&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

vim ~/.bash_profile


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and, add below lines to ~/.bash_profile ( or ~/.zshrc for macOS Catalina or later)&lt;/p&gt;

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

export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Press &lt;strong&gt;ESC + :wq&lt;/strong&gt; to save and close your file.&lt;/p&gt;

&lt;p&gt;Next, load the variable to the current shell environment. From the next login, it will automatically loaded.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bash_profile


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That’s it. The NVM has been installed on your macOS system. Go to next step to install Node.js versions with the help of nvm.&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3 – Install Node.js with NVM
&lt;/h1&gt;

&lt;p&gt;First of all, see what Node versions are available to install. To see available versions, type:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

nvm ls-remote 


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, you can install any version listed in above output. You can also use aliases names like node for latest version, lts for latest LTS version, etc.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

nvm &lt;span class="nb"&gt;install &lt;/span&gt;node     &lt;span class="c"&gt;## Installing Latest version &lt;/span&gt;
nvm &lt;span class="nb"&gt;install &lt;/span&gt;14       &lt;span class="c"&gt;## Installing Node.js 14.X version &lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After installing you can verify what is installed with:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

nvm &lt;span class="nb"&gt;ls&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fwgj8qgc4b98h67l4uf75.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%2Fwgj8qgc4b98h67l4uf75.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have installed multiple versions on your system, you can set any version as the default version any time. To set the node 14.X as default version, simply use:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

nvm use 14 


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Similarly, you can install other versions like Node 12.X or Node 15 and switch between them.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This tutorial explained you to how to install NVM and node.js on macOS system.&lt;/p&gt;

</description>
      <category>node</category>
      <category>todayilearned</category>
      <category>tutorial</category>
      <category>tooling</category>
    </item>
    <item>
      <title>VS Code: different color themes for different projects 🌈</title>
      <dc:creator>Maxime Kubik</dc:creator>
      <pubDate>Mon, 07 Dec 2020 15:54:17 +0000</pubDate>
      <link>https://dev.to/mkubdev/visual-studio-code-different-color-themes-for-different-projects-467k</link>
      <guid>https://dev.to/mkubdev/visual-studio-code-different-color-themes-for-different-projects-467k</guid>
      <description>&lt;p&gt;Hi, have you ever worked with multiple VSCode instances? 🔥&lt;/p&gt;

&lt;p&gt;It's sometimes difficult to navigate between the different projects when using the same &lt;code&gt;colorTheme&lt;/code&gt; ...&lt;/p&gt;

&lt;h1&gt;
  
  
  The solution:
&lt;/h1&gt;

&lt;p&gt;Maybe you already know it, but &lt;strong&gt;you can have a different theme per workspace/folder&lt;/strong&gt; by adjusting the &lt;code&gt;workbench.colorTheme&lt;/code&gt; in the workspace settings.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a new VSCode window.&lt;/li&gt;
&lt;li&gt;Open the project folder where you would like to have a different color theme.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;code&gt;File &amp;gt; Preferences &amp;gt; Settings&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select the &lt;code&gt;Workspace Settings&lt;/code&gt; tab at the top of the settings screen. Anything you edit in here will now be specific to this workspace.&lt;/li&gt;
&lt;li&gt;Search for &lt;code&gt;colorTheme&lt;/code&gt; and select the color theme you would like for this specific workspace.&lt;/li&gt;
&lt;/ol&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%2Fi%2Fw9drcz8tm7ove42gia5o.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%2Fi%2Fw9drcz8tm7ove42gia5o.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Alternatively...
&lt;/h1&gt;

&lt;p&gt;You can use a VSCode extension called &lt;a href="https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock" rel="noopener noreferrer"&gt;Peacock&lt;/a&gt; wich subtly change the color of your Visual Studio Code workspace. Ideal when you have multiple VS Code instances, use VS Live Share, or use VS Code's Remote features, and you want to quickly identify your editor.&lt;/p&gt;

&lt;h1&gt;
  
  
  In the end...
&lt;/h1&gt;

&lt;p&gt;I hope you’ll find these useful for yourself ! It's a game changer for me to boost my productivity 🎉🦥&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;And you ? What's your favorite &lt;strong&gt;hack&lt;/strong&gt; to boost your productivity ? ❤&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>todayilearned</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>5 Useful VSCode Extension</title>
      <dc:creator>Maxime Kubik</dc:creator>
      <pubDate>Tue, 27 Oct 2020 16:15:15 +0000</pubDate>
      <link>https://dev.to/mkubdev/5-useful-vscode-extension-2g5j</link>
      <guid>https://dev.to/mkubdev/5-useful-vscode-extension-2g5j</guid>
      <description>&lt;p&gt;Hi,&lt;br&gt;
Here is the list of my 5 useful extensions you need to know about.&lt;/p&gt;

&lt;h1&gt;
  
  
  5. Todo Tree
&lt;/h1&gt;

&lt;p&gt;Todo Tree is a simple extension that searches a workspace for comment tags like TODO and FIXME, and displays them in a tree view in the explorer pane.&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%2Fi%2Fz1miz1p7hhneimkwxxxx.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%2Fi%2Fz1miz1p7hhneimkwxxxx.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Placeholder Images
&lt;/h1&gt;

&lt;p&gt;This extension generates and inserts placeholder images into HTML.&lt;/p&gt;

&lt;p&gt;Useful on the prototype phase.&lt;/p&gt;

&lt;p&gt;You can use Unsplash, placehold.it, and LoremFlickr with it.&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%2Fi%2Fc2qsx9w9v5l24bt4ly55.gif" 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%2Fi%2Fc2qsx9w9v5l24bt4ly55.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Better Comments
&lt;/h1&gt;

&lt;p&gt;The Better Comments extension creates human-friendly comments in your code.&lt;/p&gt;

&lt;p&gt;This extension categorizes your annotations into :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alerts&lt;/li&gt;
&lt;li&gt;Queries&lt;/li&gt;
&lt;li&gt;TODOs&lt;/li&gt;
&lt;li&gt;Highlights&lt;/li&gt;
&lt;/ul&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%2Fi%2F2vxko9419lsfcb17p1k0.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%2Fi%2F2vxko9419lsfcb17p1k0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Faker
&lt;/h1&gt;

&lt;p&gt;A simple extension to generate fake data.&lt;/p&gt;

&lt;p&gt;Very useful on early-stage development.&lt;/p&gt;

&lt;p&gt;You can generate :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;address&lt;/li&gt;
&lt;li&gt;commerce&lt;/li&gt;
&lt;li&gt;company&lt;/li&gt;
&lt;li&gt;database&lt;/li&gt;
&lt;li&gt;date&lt;/li&gt;
&lt;li&gt;and many many more...&lt;/li&gt;
&lt;/ul&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%2Fi%2F8p387p71l64adl4c2nx8.gif" 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%2Fi%2F8p387p71l64adl4c2nx8.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Code Time
&lt;/h1&gt;

&lt;p&gt;It’s an open-source plugin for automatic programming metrics and time tracking.&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%2Fi%2Fh16m9vgrso8p1b6at4mg.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%2Fi%2Fh16m9vgrso8p1b6at4mg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Track your progress during the day&lt;/li&gt;
&lt;li&gt;Check out the coding activity&lt;/li&gt;
&lt;li&gt;Generate code time summary&lt;/li&gt;
&lt;li&gt;Generate data visualizations&lt;/li&gt;
&lt;/ul&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%2Fi%2Fbwimtpzcoeb12j69zp8v.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%2Fi%2Fbwimtpzcoeb12j69zp8v.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  In the end...
&lt;/h1&gt;

&lt;p&gt;I hope you’ll find these extensions useful for yourself ! 🎉🦥&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;And you ? What's your favorite &lt;strong&gt;VSCode extension&lt;/strong&gt; ? ❤&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>todayilearned</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to fast build Web Application with Strapi + Angular</title>
      <dc:creator>Maxime Kubik</dc:creator>
      <pubDate>Wed, 21 Oct 2020 09:44:57 +0000</pubDate>
      <link>https://dev.to/mkubdev/the-power-of-strapi-building-web-application-has-never-been-easier-291i</link>
      <guid>https://dev.to/mkubdev/the-power-of-strapi-building-web-application-has-never-been-easier-291i</guid>
      <description>&lt;p&gt;For us, developers, starting a new web project can be a tedious job. It raises questions like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What technology should I use for the front-end?&lt;/li&gt;
&lt;li&gt;What technology should I use for the back-end?&lt;/li&gt;
&lt;li&gt;What database is the best?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Because nowadays all Javascript technologies like &lt;strong&gt;React&lt;/strong&gt;, &lt;strong&gt;Angular&lt;/strong&gt; and &lt;strong&gt;Vue&lt;/strong&gt; are very popular for building Web applications, so we can get an answer for the first question very fast. But what about the back-end? Should I use &lt;strong&gt;NodeJS&lt;/strong&gt; or &lt;strong&gt;.NET Core&lt;/strong&gt;? Is it better to use a &lt;strong&gt;relational&lt;/strong&gt; or &lt;strong&gt;non-relational&lt;/strong&gt; database? Well, &lt;strong&gt;Strapi&lt;/strong&gt; has the answer to all these questions.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Strapi ?
&lt;/h1&gt;

&lt;p&gt;Strapi is an open-source Headless CMS that gives developers the freedom to choose their favorite tools and frameworks. With all the plugins and features Strapi gives the developers the ability for customization and extensibility. Strapi is also very Developer-Friendly by providing an API that can be easily accessed either via REST or GraphQL endpoint.&lt;/p&gt;

&lt;p&gt;In this article, we are going to build a simple web application using Strapi and Angular.&lt;/p&gt;

&lt;p&gt;First, we are going to set up and build our API.&lt;/p&gt;




&lt;h2&gt;
  
  
  Install Strapi
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-strapi-app blog_api &lt;span class="nt"&gt;--quickstart&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once the setup from the command above is finished Strapi will automatically run (NOTE: when manually start the project run the command strapi develop) and we can navigate to our admin panel on the following link: &lt;a href="http://localhost:1337/admin" rel="noopener noreferrer"&gt;http://localhost:1337/admin&lt;/a&gt;. When you navigate you will able to see the registration form.&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%2Fi%2Fqawzds0zvny9yhu8pa1u.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%2Fi%2Fqawzds0zvny9yhu8pa1u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we finish with registering our first user, we can start building our API.&lt;/p&gt;

&lt;p&gt;First, what we need to do for our Blog Application is to define the models that we will have. We will define three models: Page, Post, and Content.&lt;/p&gt;

&lt;p&gt;To create a new Model navigate to Content Type Builder.&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%2Fi%2Fuwed2lha8rolrsggnqys.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%2Fi%2Fuwed2lha8rolrsggnqys.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our model &lt;code&gt;Content&lt;/code&gt; will have:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Title - type &lt;code&gt;Text&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Value - type &lt;code&gt;RichText&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;IsPublished - type &lt;code&gt;Boolean&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;CoverImage - type &lt;code&gt;Media&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Relation to &lt;code&gt;Post&lt;/code&gt; (Content belong to many &lt;code&gt;Posts&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Relation to &lt;code&gt;Page&lt;/code&gt; (Content belong to many &lt;code&gt;Pages&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;Page&lt;/code&gt; model will have:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Name - type &lt;code&gt;Text&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Relation to &lt;code&gt;Content&lt;/code&gt; (&lt;code&gt;Page&lt;/code&gt; has many &lt;code&gt;Contents&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Relation to &lt;code&gt;Post&lt;/code&gt; (&lt;code&gt;Page&lt;/code&gt; has many and belongs to many &lt;code&gt;Posts&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;and &lt;code&gt;Post&lt;/code&gt; model will have:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;IsDeleted - type &lt;code&gt;Boolean&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Relation to &lt;code&gt;Page&lt;/code&gt; (&lt;code&gt;Post&lt;/code&gt; has many and belongs to many &lt;code&gt;Pages&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Relation to &lt;code&gt;Contents&lt;/code&gt; (&lt;code&gt;Post&lt;/code&gt; has many &lt;code&gt;Contents&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As soon as we define our models we are ready to create some pages, contents, and posts. We can simply do that by navigating to each model and click &lt;code&gt;Add new [name-of-the-model]&lt;/code&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%2Fi%2Frd3qkvyio48invmjd2zp.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%2Fi%2Frd3qkvyio48invmjd2zp.png" alt="Alt Text"&gt;&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%2Fi%2F4oe31kesqgdln90mue63.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%2Fi%2F4oe31kesqgdln90mue63.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, when we have models and data into our database we need to give access to our visitors of blog application. To do that we need to navigate to &lt;code&gt;Roles and Permissions&lt;/code&gt; tab in the menu. We can see there are by default two types of roles: &lt;code&gt;Public&lt;/code&gt; and &lt;code&gt;Authorized&lt;/code&gt;. We navigate to &lt;code&gt;Public&lt;/code&gt; role and select:&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%2Fi%2Feyfog290mygxjxq27s9s.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%2Fi%2Feyfog290mygxjxq27s9s.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's it. Our API is ready. Now we only need to make our web application.&lt;/p&gt;


&lt;h1&gt;
  
  
  Angular Application
&lt;/h1&gt;

&lt;p&gt;Install the Angular CLI with the following command:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @angular/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Run the following commands at the root of your strapi server to create and run a new angular app:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ng new blog-web 
&lt;span class="nb"&gt;cd &lt;/span&gt;blog-web 
ng serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you navigate to &lt;a href="http://localhost:4200/" rel="noopener noreferrer"&gt;http://localhost:4200/&lt;/a&gt; you will able to see the new app.&lt;/p&gt;

&lt;p&gt;Now, we can start with styling our application and access data from our API. First, we will create services and API calls to get our data from Strapi. Navigate to &lt;code&gt;src&lt;/code&gt; folder and run the following commands:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;services
&lt;span class="nb"&gt;cd &lt;/span&gt;services
ng g s page
ng g s post
ng g s content
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Angular CLI will create these services so we are ready for coding. In &lt;code&gt;environment.ts&lt;/code&gt; we will put our API URL.&lt;br&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%2Fi%2Fi2ttbi1lgzr5qcdmpr6n.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%2Fi%2Fi2ttbi1lgzr5qcdmpr6n.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Navigate to page service and insert the following code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;page-service.ts
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;We created two methods: one for getting all pages and one for getting page by id. We will make the same for &lt;code&gt;post&lt;/code&gt; and &lt;code&gt;content&lt;/code&gt; services.&lt;/p&gt;

&lt;p&gt;NOTE: Before using &lt;code&gt;HttpClient&lt;/code&gt; we need to register into &lt;code&gt;app-module.ts&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to app-module.ts&lt;/li&gt;
&lt;li&gt;Import the &lt;code&gt;HttpClientModule&lt;/code&gt; from &lt;code&gt;@angular/common/http&lt;/code&gt;,
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HttpClientModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/common/http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Add it to the &lt;code&gt;@NgModule.imports&lt;/code&gt; array :
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:[&lt;/span&gt;&lt;span class="nx"&gt;HttpClientModule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="p"&gt;...]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;post-service.ts&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;content-service.ts&lt;br&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Next, we will create &lt;code&gt;post-component&lt;/code&gt; that will contain style and functionality for posts and we will use &lt;code&gt;app-component&lt;/code&gt; for displaying our landing page. Navigate to &lt;code&gt;app&lt;/code&gt; folder and create a new folder called components. Here, we will store all components that we use in our blog application. With the following command we can generate a new component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ng g c post
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Insert the following code into the post component :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;post.component.html &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;post.component.css&lt;br&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;post.component.ts&lt;br&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;p&gt;Because we are using bootstrap classes we need to include bootstrap into our project as well. We can do that by adding the following into &lt;code&gt;index.html&lt;/code&gt; :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/cosmo/bootstrap.min.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And we are almost done. The only thing that left is to modify &lt;code&gt;app-component&lt;/code&gt; and our blog is ready for use.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;app.component.html&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;app.component.scss&lt;br&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;app.component.ts&lt;br&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Congratulations, we successfully built a Blog application.&lt;br&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%2Fi%2Fpegfy4g53ys9v9sa1suy.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%2Fi%2Fpegfy4g53ys9v9sa1suy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Feel free to continue working on your blog. You can try various scenarios navigation, styling e.t.c. Play with models into &lt;strong&gt;Strapi&lt;/strong&gt; and API calls from your &lt;strong&gt;Angular&lt;/strong&gt; application.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>webdev</category>
      <category>testing</category>
      <category>angular</category>
    </item>
    <item>
      <title>🐳 mongodump and mongorestore with Docker</title>
      <dc:creator>Maxime Kubik</dc:creator>
      <pubDate>Tue, 13 Oct 2020 13:41:16 +0000</pubDate>
      <link>https://dev.to/mkubdev/mongodump-and-mongorestore-with-docker-39m7</link>
      <guid>https://dev.to/mkubdev/mongodump-and-mongorestore-with-docker-39m7</guid>
      <description>&lt;p&gt;Hi! TIL how to restore and dump a MongoDB container. The trick is to disable pseudo-tty allocation. Otherwise extra characters are added to the backup file. They prevent mongorestore from working properly.&lt;/p&gt;

&lt;h1&gt;
  
  
  With Docker
&lt;/h1&gt;

&lt;p&gt;With docker, pseudo-tty allocation is deactivated by default, but the -i (interactive) option is required with the restore command.&lt;/p&gt;

&lt;h2&gt;
  
  
  mongodump
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;No Auth : &lt;code&gt;docker exec &amp;lt;mongodb container&amp;gt; sh -c 'mongodump --archive' &amp;gt; db.dump&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Authenticated : &lt;code&gt;docker exec &amp;lt;mongodb container&amp;gt; sh -c 'mongodump --authenticationDatabase admin  -u &amp;lt;user&amp;gt; -p &amp;lt;password&amp;gt; --db &amp;lt;database&amp;gt; --archive' &amp;gt; db.dump&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  mongorestore
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;No Auth : &lt;code&gt;docker exec -i &amp;lt;mongodb container&amp;gt; sh -c 'mongorestore --archive' &amp;lt; db.dump&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Authenticated : &lt;code&gt;docker exec -i &amp;lt;mongodb container&amp;gt; sh -c 'mongorestore --authenticationDatabase admin -u &amp;lt;user&amp;gt; -p &amp;lt;password&amp;gt; --db &amp;lt;database&amp;gt; --archive' &amp;lt; db.dump&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  With Docker Compose
&lt;/h1&gt;

&lt;p&gt;With docker-compose, pseudo-tty allocation needs to be deactivated explicitly each time with -T :&lt;/p&gt;

&lt;h2&gt;
  
  
  mongodump
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;docker-compose exec -T &amp;lt;mongodb service&amp;gt; sh -c 'mongodump --archive' &amp;gt; db.dump&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  mongorestore
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;docker-compose exec -T &amp;lt;mongodb service&amp;gt; sh -c 'mongorestore --archive' &amp;lt; db.dump&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That's all ! ✨🎉&lt;br&gt;
Now, feel free to write a script and add it to your pipeline.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>mongodb</category>
      <category>todayilearned</category>
      <category>todayisearched</category>
    </item>
  </channel>
</rss>
