<?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: Ayuth Mangmesap</title>
    <description>The latest articles on DEV Community by Ayuth Mangmesap (@ayuthmang).</description>
    <link>https://dev.to/ayuthmang</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%2F150579%2F56dfa12c-18d7-4180-a997-40bae5ef3691.jpg</url>
      <title>DEV Community: Ayuth Mangmesap</title>
      <link>https://dev.to/ayuthmang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ayuthmang"/>
    <language>en</language>
    <item>
      <title>Fix CondaToSPermissionError: Unable to read/write path anaconda</title>
      <dc:creator>Ayuth Mangmesap</dc:creator>
      <pubDate>Fri, 12 Sep 2025 04:25:16 +0000</pubDate>
      <link>https://dev.to/ayuthmang/fix-condatospermissionerror-unable-to-readwrite-path-anaconda-l2o</link>
      <guid>https://dev.to/ayuthmang/fix-condatospermissionerror-unable-to-readwrite-path-anaconda-l2o</guid>
      <description>&lt;p&gt;I've the error message like this when trying to install the &lt;code&gt;opencv&lt;/code&gt; on my Mac&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ conda install opencv

Do you accept the Terms of Service (ToS) for https://repo.anaconda.com/pkgs/main? [(a)ccept/(r)eject/(v)iew]: a

CondaToSPermissionError: Unable to read/write path (/Users/&amp;lt;USER&amp;gt;/.conda/tos/3c9d068aa053e2a1c4313fe3391b7a8ee57c4fbd09c4e8aeae49ef333a740150/1752577200.0.json) for https://repo.anaconda.com/pkgs/main. Please check permissions.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To fix this, I've listed the home's folder permissions where the conda lives:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Folj389lt52jebjrzwwlb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Folj389lt52jebjrzwwlb.png" alt=" " width="800" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and use the &lt;code&gt;chmod&lt;/code&gt; to fix the permission:&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="c"&gt;# ⚠️ note replace &amp;lt;USER&amp;gt; with your username, e.g., tim, john.&lt;/span&gt;
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; &amp;lt;USER&amp;gt;:staff /Users/&amp;lt;USER&amp;gt;/.conda
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then try to install the &lt;code&gt;opencv&lt;/code&gt; once again:&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="nv"&gt;$ &lt;/span&gt;conda &lt;span class="nb"&gt;install &lt;/span&gt;opencv
&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="nb"&gt;.&lt;/span&gt;

The following packages will be DOWNGRADED:

  libabseil                     20250127.0-cxx17_h313beb8_0 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 20240116.2-cxx17_h313beb8_0 
  libgrpc                                 1.71.0-h62f6fdd_0 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 1.62.2-h62f6fdd_0 
  libprotobuf                             5.29.3-h9f9f828_0 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 4.25.3-h514c7bf_0 
  libtiff                                  4.7.0-h91aec0a_0 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 4.5.1-hc9ead59_1 
  orc                                      2.1.1-h55d209b_0 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 2.0.1-h937ddfc_0 
  protobuf                           5.29.3-py313h514c7bf_0 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 4.25.3-py313h1a06a43_1 
  re2                                 2024.07.02-h48ca7d4_0 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 2022.04.01-hc377ac9_0 

The following packages will be REVISED:

  arrow-cpp                               19.0.0-h0b7d223_2 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 19.0.0-h0b7d223_1 
  lcms2                                     2.16-he26ebf3_1 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 2.16-he93ba84_0 
  mysql                                    8.4.0-h065ec36_2 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 8.4.0-h3a6587f_1 
  openjpeg                                 2.5.2-hba36e21_1 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 2.5.2-h54b8e55_0 
  pillow                             11.1.0-py313h41ba818_1 &lt;span class="nt"&gt;--&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 11.1.0-py313h84e58ab_0 


Proceed &lt;span class="o"&gt;([&lt;/span&gt;y]/n&lt;span class="o"&gt;)&lt;/span&gt;? y


Downloading and Extracting Packages:

Preparing transaction: &lt;span class="k"&gt;done
&lt;/span&gt;Verifying transaction: &lt;span class="k"&gt;done
&lt;/span&gt;Executing transaction: &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The issue was fixed.&lt;/p&gt;

</description>
      <category>anaconda</category>
      <category>python</category>
    </item>
    <item>
      <title>Fixed MariaDB/MySQL: “2006, MySQL server has gone away"</title>
      <dc:creator>Ayuth Mangmesap</dc:creator>
      <pubDate>Thu, 27 Apr 2023 03:55:18 +0000</pubDate>
      <link>https://dev.to/ayuthmang/fixed-mariadbmysql-2006-mysql-server-has-gone-away-577e</link>
      <guid>https://dev.to/ayuthmang/fixed-mariadbmysql-2006-mysql-server-has-gone-away-577e</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GbKYd-3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77u8obkxwivjgvy1y278.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GbKYd-3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77u8obkxwivjgvy1y278.png" alt='An error screenshot of “2006, MySQL server has gone away" from the phpmyadmin login screen' width="399" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have spent almost 6 hours solving this connection when the phpMyAdmin cannot connect to the MariaDB in Instance B so that’s why I decided to write this blog to save you time (of course we do that all in our dev community such as StackOverflow or such kind of this site).&lt;/p&gt;




&lt;p&gt;The various solution might be found when you google search. So I will not provide those solutions in this post.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OmbD_OCe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7dasijuyc7y5wzw7tlm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OmbD_OCe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7dasijuyc7y5wzw7tlm0.png" alt="Instances A and B in the same network" width="583" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The application is using MariaDB and keeps connecting to the MariaDB database and the error thrown&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MYgMOxOo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0ci0zi5hdfwi3f4yzz2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MYgMOxOo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0ci0zi5hdfwi3f4yzz2.png" alt="Image description" width="387" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After spending almost 6 hours solving those problems. I decided to write the blog to save you time.&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;sudo &lt;/span&gt;vim /etc/mysql/mariadb.conf.d/50-server.cnf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SsgHtMSZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lpv1w9c50t2icd0wesjc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SsgHtMSZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lpv1w9c50t2icd0wesjc.png" alt="The configuration file that defines the connection only accepts when a connection is coming from locally only&amp;lt;br&amp;gt;
" width="548" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Find the &lt;code&gt;[mysqld]&lt;/code&gt; section and find the &lt;code&gt;bind-address&lt;/code&gt; then comment on that line by inserting the # in front-of-the-line configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ct75kpI9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odxhnehmwusep5c8v481.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ct75kpI9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odxhnehmwusep5c8v481.png" alt="Image description" width="553" height="66"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then restart the service to accept new changes&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;sudo &lt;/span&gt;systemctl restart mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And try to connect to it using phpMyAdmin, any tools, or CLI as you preferred. Then the result should be connected successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IURB6rHs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1o9zpq1ah2wc34qsjxdk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IURB6rHs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1o9zpq1ah2wc34qsjxdk.png" alt="The phpmyadmin site indicates that the connection has been established&amp;lt;br&amp;gt;
" width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mariadb</category>
      <category>mysql</category>
      <category>phpmyadmin</category>
    </item>
    <item>
      <title>The docker-compose Database Snippets for Development</title>
      <dc:creator>Ayuth Mangmesap</dc:creator>
      <pubDate>Tue, 11 Apr 2023 09:39:16 +0000</pubDate>
      <link>https://dev.to/ayuthmang/the-docker-compose-database-snippets-for-development-6hl</link>
      <guid>https://dev.to/ayuthmang/the-docker-compose-database-snippets-for-development-6hl</guid>
      <description>&lt;p&gt;Recently, I work on several projects that has different kind of databases. It requires lots of setups and managing overhead.&lt;/p&gt;

&lt;p&gt;For development purpose, I have to setup the development environment to help my fellas mitigate the overhead of setting up their machine for each kind of database on each project. &lt;/p&gt;

&lt;p&gt;Here are my snippets that might help you getting started to setup the dev environment quickly as possible. The snippet is just a boilerplate. You can add, edit or remove anything as you wish to match the project requirements.&lt;/p&gt;




&lt;h2&gt;
  
  
  Snippets
&lt;/h2&gt;

&lt;p&gt;To run the snippets:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;docker-compose.yml&lt;/code&gt; file and paste the selected database below.&lt;/li&gt;
&lt;li&gt;Runs the &lt;code&gt;$ docker-compose up -d&lt;/code&gt; command to spawn the environment.&lt;/li&gt;
&lt;li&gt;If you're not using it, just runs &lt;code&gt;$ docker-compose stop&lt;/code&gt; to stop the services or &lt;code&gt;$ docker-compose down&lt;/code&gt; to stop and remove all the services, containers, networks and images. &lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  MySQL
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mysql:5.7.32&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;3306:3306&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;MYSQL_ALLOW_EMPTY_PASSWORD=yes&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  MariaDB
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;3.1'&lt;/span&gt;

&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;mariadb&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mariadb&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;on-failure'&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;3306:3306&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_ROOT_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${MYSQL_ROOT_PASSWORD:?err}&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./mariadb/data:/var/lib/mysql&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  MongoDB + Mongo Expree &lt;code&gt;docker-compose.yml&lt;/code&gt; file.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;3.1'&lt;/span&gt;

&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;mongo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mongo&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./mongo/data:/data/db&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;27017:27017&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;MONGO_INITDB_ROOT_USERNAME&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt; &lt;span class="c1"&gt;# change your username&lt;/span&gt;
      &lt;span class="na"&gt;MONGO_INITDB_ROOT_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;example&lt;/span&gt; &lt;span class="c1"&gt;# change your password&lt;/span&gt;

  &lt;span class="na"&gt;mongo-express&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mongo-express&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;8081:8081&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;ME_CONFIG_MONGODB_ADMINUSERNAME&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
      &lt;span class="na"&gt;ME_CONFIG_MONGODB_ADMINPASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;example&lt;/span&gt;
      &lt;span class="na"&gt;ME_CONFIG_MONGODB_URL&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mongodb://root:example@mongo:27017/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Redis
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;redis&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;redis:6.2.1&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;6379:6379&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/compose/reference/"&gt;https://docs.docker.com/compose/reference/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mongodb</category>
      <category>docker</category>
      <category>mysql</category>
      <category>mariadb</category>
    </item>
    <item>
      <title>Reasons to change the default terminal to Warp</title>
      <dc:creator>Ayuth Mangmesap</dc:creator>
      <pubDate>Thu, 22 Dec 2022 07:46:52 +0000</pubDate>
      <link>https://dev.to/ayuthmang/reasons-to-change-the-default-terminal-to-warp-1j2d</link>
      <guid>https://dev.to/ayuthmang/reasons-to-change-the-default-terminal-to-warp-1j2d</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1516031190212-da133013de50%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D1170%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1516031190212-da133013de50%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D1170%26q%3D80" alt="cover photo" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CLI is the best developers' friend. It could do almost everything by just typing, without leaving your keyboard which insanely boosts your productivity (you might have seen a video that the guy using only &lt;a href="https://www.vim.org/" rel="noopener noreferrer"&gt;vim&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However, remembering commands doesn't seem easy. It involves lots of practice and until embedded in your muscle memory. For my whole life, I think I have been involved in more than 200 commands including Windows, macOS, different Linux distributions, different programming languages, and also npm package modules. 🫣 So that is why the tool that helps us involving with this CLIs is important.&lt;/p&gt;

&lt;p&gt;Many tools were made that might help you interact with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GUI tools, including, &lt;a href="https://iterm2.com/" rel="noopener noreferrer"&gt;iTerm&lt;/a&gt;, &lt;a href="https://hyper.is/" rel="noopener noreferrer"&gt;Hyper&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Shell tools, including, &lt;a href="https://www.zsh.org/" rel="noopener noreferrer"&gt;zsh&lt;/a&gt;, &lt;a href="https://fishshell.com/" rel="noopener noreferrer"&gt;fish&lt;/a&gt;, etc&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Moreover, there are tools were made on top of those to provide more functionalities, and fill some of the gaps, for instance, &lt;a href="https://ohmyz.sh/" rel="noopener noreferrer"&gt;oh-my-zsh&lt;/a&gt;, &lt;a href="https://github.com/sorin-ionescu/prezto" rel="noopener noreferrer"&gt;Prezto&lt;/a&gt;, &lt;a href="https://github.com/oh-my-fish/oh-my-fish" rel="noopener noreferrer"&gt;oh-my-fish&lt;/a&gt;, and much more. However, the default embedded terminal in macOS is still lacking something. That's why &lt;a href="https://iterm2.com/" rel="noopener noreferrer"&gt;iTerm&lt;/a&gt; and other terminal like &lt;a href="https://hyper.is/" rel="noopener noreferrer"&gt;Hyper&lt;/a&gt;. It provides you a set of customization to boost your productivity.&lt;/p&gt;

&lt;p&gt;In this blog, I want to introduce a new terminal called "Warp" with some set of reasons why I have changed my mind from iTerm to Warp. I hope this blog convinces you like some of your friends told you that he/her found a new tool, this is awesome, why don't give it a try? Let's get into it.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤔 What is Warp?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fo5fyym0zx1eix9qaciqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fo5fyym0zx1eix9qaciqc.png" alt="Warp terminal overview" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;WARP IS A BLAZINGLY FAST, RUST-BASED TERMINAL REIMAGINED FROM THE GROUND UP TO WORK LIKE A MODERN APP.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here are several reasons that you might to try Warp&lt;/p&gt;

&lt;h3&gt;
  
  
  ⌨️ Intuitive keyboard navigation
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1555532538-dcdbd01d373d%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D1264%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1555532538-dcdbd01d373d%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D1264%26q%3D80" alt="decoration photo" width="800" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are a developer. Keyboard navigation is important, you don't need to let your muscle remember new keyboard navigation.&lt;/p&gt;

&lt;p&gt;I often use VS Code as my main code editor. It is intuitive enough that you don't need to remember a new set of keyboard navigation. There is no need to change settings, it is embedded.&lt;/p&gt;

&lt;p&gt;Remembering keyboard navigation is boost your productivity. However, if you are like me that working on several editors as such VS Code, JetBrains' IDE, VIM, and nano. I'm sure that it doesn't seem easy to remember all of those even though you have practiced until it embedded in your muscle memory, trust me.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✍️ Auto-completion by default
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1516321318423-f06f85e504b3%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D1170%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1516321318423-f06f85e504b3%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D1170%26q%3D80" alt="decoration photo" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Auto-completion in a terminal is fascinating. It helps you a lot when you are working on CLI. Most terminal doesn't have these feature by default. You might take a lot of effort to make it shown unless Warp is embedded auto-completion by default. Let's see some examples.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Directory completion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ffav60errs5vido1pk6j0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ffav60errs5vido1pk6j0.png" alt="directory completion preview" width="724" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Commands completion including, directory completion, command suggestion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fxppqablxq0lklqyi2rur.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fxppqablxq0lklqyi2rur.png" alt="command completion preview" width="742" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🗺️ Awesome Command History
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ff17j4ul6ymnp408tnpzb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ff17j4ul6ymnp408tnpzb.png" alt="overview of command history in wrap terminal" width="555" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the greatest experience in command history browsing. It enabled you to view the previous with mouse and keyboard, including substring search, and gives us an experience like an IntelliSense or auto-completion in most of IDEs.&lt;/p&gt;

&lt;h3&gt;
  
  
  🤖 AI is your best friend
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1534723328310-e82dad3ee43f%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D736%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1534723328310-e82dad3ee43f%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D736%26q%3D80" alt="decoration photo" width="736" height="980"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Warp has embedded an AI friend to help you. I am feeling that I have using ChatGPT or google search, let's see the examples&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;zip my folder, it shows the suggested command directly on your terminal and has a hotkey to put it through.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fpboxaq317za61giukbyj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fpboxaq317za61giukbyj.png" alt="Image description" width="747" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;extract row number 2 from json file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fuf6pjjbjk69nzi8ukads.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fuf6pjjbjk69nzi8ukads.png" alt="Image description" width="748" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, &lt;strong&gt;Network connection is required&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Workflows
&lt;/h3&gt;

&lt;p&gt;I haven't tried yet enough but it allows us to create an automation of some commands with in Warp.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1542744094-24638eff58bb%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D1171%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1542744094-24638eff58bb%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D1171%26q%3D80" alt="decoration image" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Workflows are an easier way to execute and share commands within Warp. They are easily parameterized and searchable by name, description, or command arguments. Common workflows sourced by the Warp team and community are readily available within the app. Additionally, you can create and scope workflows locally or to a git repository.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Read more at &lt;a href="https://docs.warp.dev/features/entry/workflows" rel="noopener noreferrer"&gt;https://docs.warp.dev/features/entry/workflows&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  👉 Give it a try!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1620802421008-4f4fac8e14eb%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D1074%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1620802421008-4f4fac8e14eb%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D1074%26q%3D80" alt="decoration image" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Talk cheap, show me the terminal&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I wrote a blog that will tell you how to set up your terminal, let's take a look at &lt;a href="https://medium.com/ayuth/iterm2-zsh-oh-my-zsh-the-most-power-full-of-terminal-on-macos-bdb2823fb04c" rel="noopener noreferrer"&gt;iTerm2 + zsh + oh-my-zsh The Most Power Full Terminal on macOS&lt;/a&gt;. You could replace the iTerm with Warp without any problems.&lt;/p&gt;

&lt;p&gt;Let's give it a try in Warp &lt;a href="https://app.warp.dev/referral/7M6GM9" rel="noopener noreferrer"&gt;https://app.warp.dev/referral/7M6GM9&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;P.S. With or without a referral register link is still fine. I just want to share a new tool with you, like my friend told me, hey, let's look at this tool.&lt;/p&gt;

&lt;p&gt;Have a great upcoming Christmas and an Early Happy New Year.&lt;/p&gt;

</description>
      <category>french</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Folder Structure for React Component That Scale</title>
      <dc:creator>Ayuth Mangmesap</dc:creator>
      <pubDate>Fri, 17 Jun 2022 07:22:25 +0000</pubDate>
      <link>https://dev.to/ayuthmang/my-favorite-structure-for-react-components-f5p</link>
      <guid>https://dev.to/ayuthmang/my-favorite-structure-for-react-components-f5p</guid>
      <description>&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%2Fj5dinuo1enh4lpczfkja.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%2Fj5dinuo1enh4lpczfkja.png" alt="cover"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;b&gt;Background image by Greg Rakozy&lt;/b&gt;






&lt;p&gt;After spending a bunch of time on open source react projects and writing react components on my own, here is my favorite way to create a react component.&lt;/p&gt;

&lt;p&gt;Also, this might help others to getting started quickly, and easily.&lt;/p&gt;

&lt;p&gt;Let's see the example. Imagine that we have the folder &lt;code&gt;Card&lt;/code&gt; which has two files inside, first is &lt;code&gt;index.js&lt;/code&gt;, and &lt;code&gt;Card.tsx&lt;/code&gt; in a project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Card
├── index.tsx
└── Card.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The codes are&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 📄 Card/Card.tsx&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Card&lt;/span&gt; &lt;span class="o"&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;&amp;lt;&amp;gt;&amp;lt;/&amp;gt;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Card&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 📄 Card/index.tsx&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;default&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;./Card&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you've created the component like this, you can import it into the other component like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 📄 pages/Login/Login.tsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Card&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;components/Card&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Login&lt;/span&gt; &lt;span class="o"&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Card&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; 
    ...
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Card&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Login&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you can combine components in to pages&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;├── components
│   ├── Button
│   │   ├── Button.tsx
│   │   └── index.tsx
│   ├── Card
│   │   ├── Card.tsx
│   │   └── index.tsx
│   ├── Footer
│   │   ├── Footer.tsx
│   │   └── index.tsx
│   ├── Header
│   │   ├── Header.tsx
│   │   └── index.tsx
│   └── SideNav
│       ├── SideNav.tsx
│       └── index.tsx
└── pages
    └── AdminDashboard
        ├── AdminDashboard.tsx
        └── index.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code in the dashboard component will be like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 📄 pages/AdminDashboard/AdminDashboard.tsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Button&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;components/Button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Card&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;components/Card&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Header&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;components/Header&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;SideNav&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;components/SideNav&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Footer&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;components/Footer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="c1"&gt;// You can omit the Header, SideNav, and Footer to the layout comment if you wanted to.&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;AdminDashboard&lt;/span&gt; &lt;span class="o"&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="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Header&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;SideNav&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Card&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      ...
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Card&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Footer&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;AdminDashboard&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern helps&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;🙈 Encapsulation - once we import the component from its folder not any details component in it, this increased.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;♻️ Reusability - the encapsulated component makes it isolated from others. Once it is isolated and has no dependency, also the reusability increased.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;👀 Scalability - we can composing components that isolated, reusable to a larger component or page&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You might also see this pattern uses in plenty of open source react projects, for instance, &lt;a href="https://github.com/pancakeswap/pancake-frontend/" rel="noopener noreferrer"&gt;pancake-frontend&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pages
└── AdminDashboard
    ├── AdminDashboard.tsx
    ├── components
    │   ├── SalesChart
    │   └── SearchNav
    └── index.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nevertheless, creating files &lt;code&gt;index.tsx&lt;/code&gt; and &lt;code&gt;{component-file-name}.tsx}&lt;/code&gt; and writing the repetitive code every time it might get so annoying.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/9MITppNYL8aYtqYZ27/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/9MITppNYL8aYtqYZ27/giphy.gif" alt="boring face"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Introducing to &lt;a href="https://github.com/joshwcomeau/new-component" rel="noopener noreferrer"&gt;new-component&lt;/a&gt; cli tool.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;new-component&lt;/code&gt; is a CLI utility for quickly creating new React components in such a way we've read through, for instance&lt;/p&gt;

&lt;p&gt;I'm going to create the component called &lt;code&gt;Header&lt;/code&gt;, I just type&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="nv"&gt;$ &lt;/span&gt;new-component Header
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then the result will be&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;09:38:54 &lt;span class="k"&gt;in&lt;/span&gt; ~/Desktop/new-component-test
➜ new-component Header


✨  Creating the Header component ✨


Directory:  src/components/Header
Type:       functional  class  pure-class
&lt;span class="o"&gt;=========================================&lt;/span&gt;


✓ Directory created.
✓ Component built and saved to disk.
✓ Index file built and saved to disk.


Component created! 🚀
Thanks &lt;span class="k"&gt;for &lt;/span&gt;using new-component.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, you can config the generated file, output directory, and its extension.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜ new-component &lt;span class="nt"&gt;--help&lt;/span&gt;
Usage: new-component &lt;span class="o"&gt;[&lt;/span&gt;options] &amp;lt;componentName&amp;gt;

Options:
  &lt;span class="nt"&gt;-V&lt;/span&gt;, &lt;span class="nt"&gt;--version&lt;/span&gt;                    output the version number
  &lt;span class="nt"&gt;-t&lt;/span&gt;, &lt;span class="nt"&gt;--type&lt;/span&gt; &amp;lt;componentType&amp;gt;       Type of React component to generate &lt;span class="o"&gt;(&lt;/span&gt;default: &lt;span class="s2"&gt;"functional"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;default: &lt;span class="s2"&gt;"functional"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt;, &lt;span class="nt"&gt;--dir&lt;/span&gt; &amp;lt;pathToDirectory&amp;gt;      Path to the &lt;span class="s2"&gt;"components"&lt;/span&gt; directory &lt;span class="o"&gt;(&lt;/span&gt;default: &lt;span class="s2"&gt;"src/components"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;default: &lt;span class="s2"&gt;"src/components"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;-x&lt;/span&gt;, &lt;span class="nt"&gt;--extension&lt;/span&gt; &amp;lt;fileExtension&amp;gt;  Which file extension to use &lt;span class="k"&gt;for &lt;/span&gt;the component &lt;span class="o"&gt;(&lt;/span&gt;default: &lt;span class="s2"&gt;"js"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;default: &lt;span class="s2"&gt;"js"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;-h&lt;/span&gt;, &lt;span class="nt"&gt;--help&lt;/span&gt;                       output usage information
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enjoy creates your components, and thanks for reading. 😊&lt;/p&gt;

</description>
      <category>react</category>
    </item>
    <item>
      <title>Setup Java Development Environment for macOS</title>
      <dc:creator>Ayuth Mangmesap</dc:creator>
      <pubDate>Sat, 19 Oct 2019 14:08:06 +0000</pubDate>
      <link>https://dev.to/ayuthmang/setup-java-development-environment-for-macos-2pdg</link>
      <guid>https://dev.to/ayuthmang/setup-java-development-environment-for-macos-2pdg</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OqTD5L1q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A_fmUaZzYFFOTlP0YBb2b6A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OqTD5L1q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A_fmUaZzYFFOTlP0YBb2b6A.png" alt="Cover image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I googling a while for "how to install java 8 on macOS" but isn't help me so much to figure it out how to actually install java 8 in my MacBook. Some tutorial is outdated. So I decided to write a tutorial for setup java development environment in macOS which covering all of you need to setup and how to have multiple versions of java in the same machine, how to switch java version 8 to 13, etc.&lt;/p&gt;

&lt;p&gt;Let's get started.&lt;/p&gt;




&lt;h2&gt;
  
  
  Install brew
&lt;/h2&gt;

&lt;p&gt;Open terminal or iTerm and paste this line to install brew.&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="nv"&gt;$ &lt;/span&gt;/usr/bin/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;h2&gt;
  
  
  Install java
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;brew tap adoptopenjdk/openjdk

&lt;span class="c"&gt;# javc 8&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; adoptopenjdk8

&lt;span class="c"&gt;# java 11&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; adoptopenjdk11

&lt;span class="c"&gt;# gradle&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;gradle

&lt;span class="c"&gt;# maven&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;maven
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List of java version see here: &lt;a href="https://github.com/AdoptOpenJDK/homebrew-openjdk"&gt;https://github.com/AdoptOpenJDK/homebrew-openjdk&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use multiple versions of java in the same machine
&lt;/h2&gt;

&lt;p&gt;If you want to use other versions of java in the same machine, instead of setup &lt;code&gt;JAVA_HOME&lt;/code&gt; every time that you started the terminal we'll use &lt;code&gt;jenv&lt;/code&gt; for switching between versions and do the path setup for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install jenv and setup
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;jenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add java home folder to jenv&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="nv"&gt;$ &lt;/span&gt;jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home

&lt;span class="nv"&gt;$ &lt;/span&gt;jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Jenv commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ jenv
jenv 0.5.2
Usage: jenv &amp;lt;&lt;span class="nb"&gt;command&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&amp;lt;args&amp;gt;]

Some useful jenv commands are:
   commands    List all available jenv commands
   &lt;span class="nb"&gt;local       &lt;/span&gt;Set or show the &lt;span class="nb"&gt;local &lt;/span&gt;application-specific Java version
   global      Set or show the global Java version
   shell       Set or show the shell-specific Java version
   rehash      Rehash jenv shims &lt;span class="o"&gt;(&lt;/span&gt;run this after installing executables&lt;span class="o"&gt;)&lt;/span&gt;
   version     Show the current Java version and its origin
   versions    List all Java versions available to jenv
   which       Display the full path to an executable
   whence      List all Java versions that contain the given executable

See &lt;span class="sb"&gt;`&lt;/span&gt;jenv &lt;span class="nb"&gt;help&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;command&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="s1"&gt;' for information on a specific command.
For full documentation, see: https://github.com/hikage/jenv#readme
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;list versions with &lt;code&gt;jenv versions&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ jenv versions
&lt;span class="k"&gt;*&lt;/span&gt; system &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;set &lt;/span&gt;by /Users/&amp;lt;USER&amp;gt;/.jenv/version&lt;span class="o"&gt;)&lt;/span&gt;
  1.8
  1.8.0.222
  11.0
  11.0.4
  openjdk64-1.8.0.222
  openjdk64-11.0.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;switching between version&lt;/p&gt;

&lt;p&gt;usage &lt;code&gt;jenv shell openjdk64-1.8.0.222 #or openjdk64-11.0.4&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ java &lt;span class="nt"&gt;-version&lt;/span&gt;
openjdk version &lt;span class="s2"&gt;"1.8.0_222"&lt;/span&gt;
OpenJDK Runtime Environment &lt;span class="o"&gt;(&lt;/span&gt;AdoptOpenJDK&lt;span class="o"&gt;)(&lt;/span&gt;build 1.8.0_222-b10&lt;span class="o"&gt;)&lt;/span&gt;
OpenJDK 64-Bit Server VM &lt;span class="o"&gt;(&lt;/span&gt;AdoptOpenJDK&lt;span class="o"&gt;)(&lt;/span&gt;build 25.222-b10, mixed mode&lt;span class="o"&gt;)&lt;/span&gt;
➜  ~ jenv versions
  system
  1.8
  1.8.0.222
  11.0
  11.0.4
&lt;span class="k"&gt;*&lt;/span&gt; openjdk64-1.8.0.222 &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;set &lt;/span&gt;by JENV_VERSION environment variable&lt;span class="o"&gt;)&lt;/span&gt;
  openjdk64-11.0.4
➜  ~ jenv shell openjdk64-11.0.4
➜  ~ java &lt;span class="nt"&gt;-version&lt;/span&gt;
openjdk version &lt;span class="s2"&gt;"11.0.4"&lt;/span&gt; 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK &lt;span class="o"&gt;(&lt;/span&gt;build 11.0.4+11&lt;span class="o"&gt;)&lt;/span&gt;
OpenJDK 64-Bit Server VM AdoptOpenJDK &lt;span class="o"&gt;(&lt;/span&gt;build 11.0.4+11, mixed mode&lt;span class="o"&gt;)&lt;/span&gt;
➜  ~ jenv versions
  system
  1.8
  1.8.0.222
  11.0
  11.0.4
  openjdk64-1.8.0.222
&lt;span class="k"&gt;*&lt;/span&gt; openjdk64-11.0.4 &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;set &lt;/span&gt;by JENV_VERSION environment variable&lt;span class="o"&gt;)&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Set default java version in &lt;code&gt;/Users/&amp;lt;USER&amp;gt;/.jenv/version&lt;/code&gt; and the content will be the version of java you wanna use, save file and start a new shell will be set default java version that you wrote in file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ jenv versions
  system
  1.8
  1.8.0.222
  11.0
  11.0.4
&lt;span class="k"&gt;*&lt;/span&gt; openjdk64-1.8.0.222 &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;set &lt;/span&gt;by /Users/ayuth/.jenv/version&lt;span class="o"&gt;)&lt;/span&gt;
  openjdk64-11.0.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Set the JAVA_HOME
&lt;/h3&gt;

&lt;p&gt;If the &lt;code&gt;JAVA_HOME&lt;/code&gt; not found. Just using the &lt;code&gt;jenv&lt;/code&gt; plugin export plugin.&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;echo&lt;/span&gt; &lt;span class="nv"&gt;$JAVA_HOME&lt;/span&gt;

➜  ~ jenv enable-plugin &lt;span class="nb"&gt;export&lt;/span&gt;

&lt;span class="c"&gt;# -------- restart your shell session --------&lt;/span&gt;

➜  ~ &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$JAVA_HOME&lt;/span&gt;
/Users/ayuth/.jenv/versions/1.8.0.242
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More interestingly, they have &lt;code&gt;jenv enable-plugin maven&lt;/code&gt; and &lt;code&gt;jenv enable-plugin gradle&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure global SDKs in Intellij
&lt;/h3&gt;

&lt;p&gt;In case you wanna add your installed JDK versions to Intellij you can go to read there: &lt;a href="https://www.jetbrains.com/help/idea/sdk.html#manage_sdks"&gt;https://www.jetbrains.com/help/idea/sdk.html#manage_sdks&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--US1PR7rO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jkzmnwjnz0mhdv212bgs.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--US1PR7rO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jkzmnwjnz0mhdv212bgs.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open IntelliJ.&lt;/li&gt;
&lt;li&gt;In the startup window, click "Configure" in the bottom right menu.&lt;/li&gt;
&lt;li&gt;Select "Structure for New Projects". You'll see the popup window open-up called "Project Structure for New Projects".&lt;/li&gt;
&lt;li&gt;In left menus, Select "Platform Settings" --&amp;gt; "SDK".&lt;/li&gt;
&lt;li&gt;Click the "+" button to add a new SDK, you'll see the drop-down menu.&lt;/li&gt;
&lt;li&gt;Click the "Add JDK..." button.&lt;/li&gt;
&lt;li&gt;You'll see the finder window.&lt;/li&gt;
&lt;li&gt;Press Command + Shift + G to open the go-to path dialog and paste &lt;code&gt;/Library/Java/JavaVirtualMachines&lt;/code&gt;, and then press go.&lt;/li&gt;
&lt;li&gt;In the finder window, you'll see a list of JDK versions. Just select a JDK version that you wanna add and click "Open".&lt;/li&gt;
&lt;li&gt;You'll see the selected JDK in the list that means you're doing the right thing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's all.&lt;br&gt;
Happy Hacking!&lt;/p&gt;

</description>
      <category>setup</category>
      <category>java</category>
      <category>brew</category>
      <category>jenv</category>
    </item>
  </channel>
</rss>
