<?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: Gem Cloud</title>
    <description>The latest articles on DEV Community by Gem Cloud (@gemcloud).</description>
    <link>https://dev.to/gemcloud</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%2F767674%2Fa59a2651-982f-428a-ab31-cd23b2ab25ab.png</url>
      <title>DEV Community: Gem Cloud</title>
      <link>https://dev.to/gemcloud</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gemcloud"/>
    <language>en</language>
    <item>
      <title>Net Core postgreSQL connection string on windows 10</title>
      <dc:creator>Gem Cloud</dc:creator>
      <pubDate>Sun, 01 May 2022 05:38:04 +0000</pubDate>
      <link>https://dev.to/gemcloud/net-core-postgresql-connection-string-on-windows-10-5bmb</link>
      <guid>https://dev.to/gemcloud/net-core-postgresql-connection-string-on-windows-10-5bmb</guid>
      <description>&lt;p&gt;&lt;strong&gt;Prepare knowledge&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The file “pg_hba.conf” control whether password or not:&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%2Fuploads%2Farticles%2F4en5fxfhqoz1wpcw3nre.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%2F4en5fxfhqoz1wpcw3nre.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Find server port number at pgAdmin4:&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%2Fuploads%2Farticles%2Fm4ts7qcw611kycka8oyv.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%2Fm4ts7qcw611kycka8oyv.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Restart PostgreSQL server: &lt;br&gt;
typing “services.msc” on Run and Enter key.&lt;/p&gt;&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%2Fuploads%2Farticles%2Fxc075fza31a0tqmb9xpi.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%2Fxc075fza31a0tqmb9xpi.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;config password Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;find the file pg_hba.conf;&lt;/li&gt;
&lt;li&gt;Back it up;&lt;/li&gt;
&lt;li&gt;place the following line
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;local all all trust
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;restart your PostgreSQL server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;you can now connect as any user. Connect as the superuser postgres&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;psql -p 5433 -U postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Reset password ('replace my_user_name with postgres since you are resetting postgres user)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALTER USER my_user_name with password 'my_secure_password';
ALTER USER postgres with password 'pass@2022';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Restore the old pg_hba.conf as it is very dangerous to keep around&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Restart the server, in order to run with the safe pg_hba.conf.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;br&gt;
The ConnectionString is "Host=localhost;Port=5433;Username=postgres;Password=pass@2022;Database=dvdrental;";&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dos Commands:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;cd C:\Program Files\PostgreSQL\14\bin&amp;gt;
&amp;gt;psql -p 5433 -U postgres
postgres=# ALTER USER postgres with password 'pass@2022';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It worked!&lt;br&gt;
The end!&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>dotnet</category>
      <category>csharp</category>
    </item>
    <item>
      <title>Integrating Tailwind into an ASP.NET Core Project</title>
      <dc:creator>Gem Cloud</dc:creator>
      <pubDate>Thu, 21 Apr 2022 04:09:51 +0000</pubDate>
      <link>https://dev.to/gemcloud/integrating-tailwind-into-an-aspnet-core-project-3g4n</link>
      <guid>https://dev.to/gemcloud/integrating-tailwind-into-an-aspnet-core-project-3g4n</guid>
      <description>&lt;p&gt;We use &lt;a href="https://visualstudio.microsoft.com/vs/community/" rel="noopener noreferrer"&gt;Visual Studio 2022 Community&lt;/a&gt;.&lt;br&gt;
You can find out codes at &lt;a href="https://github.com/gemcloud/Gem.NetTailwind" rel="noopener noreferrer"&gt;Gem.NetTailwind&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Create ASP.NET Core 6.0 empty web application:
&lt;/h2&gt;

&lt;p&gt;and add razor page structure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faz5z1kgis4cyn0t1ui5y.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%2Faz5z1kgis4cyn0t1ui5y.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Add npm support to our project: The file "package.json" added into our project.
&lt;/h2&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%2Fubg2ryq70wf5xvp4zgdg.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%2Fubg2ryq70wf5xvp4zgdg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Install tailwind by "Package Manager Console":
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PM&amp;gt; cd Gem.NetTailwind
PM&amp;gt; npm install -D tailwindcss cross-env
PM&amp;gt; npx tailwindcss init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The "node_modules" was installed.&lt;br&gt;
The "tailwind.config.js" file was created.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. To config the tailwind:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;update the tailwind.config.js file to include all your .razor and .cshtml files.&lt;/li&gt;
&lt;li&gt;create the Tailwind input stylesheet Styles\input.css
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@tailwind base;
@tailwind components;
@tailwind utilities;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Finally, update the package.json file to add this script section:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
    "tailwind": "cross-env NODE_ENV=development ./node_modules/tailwindcss/lib/cli.js -i ./Styles/input.css -o ./wwwroot/css/output.css --watch"
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  5. Add &lt;a href="https://github.com/Practical-ASP-NET/Tailwind.Extensions.AspNetCore" rel="noopener noreferrer"&gt;Tailwind.Extensions.AspNetCore&lt;/a&gt; into our project;
&lt;/h2&gt;

&lt;p&gt;to install the Tailwind AspNetCore NuGet package.&lt;br&gt;
to Program.cs and add this code before app.Run();&lt;br&gt;
if (app.Environment.IsDevelopment())&lt;br&gt;
{&lt;br&gt;
    app.RunTailwind("tailwind", "./");&lt;br&gt;
    // or&lt;br&gt;
app.RunTailwind("tailwind", "../Client/");&lt;br&gt;
}&lt;br&gt;
 add this using statement on Program.cs&lt;br&gt;
using Tailwind;&lt;/p&gt;
&lt;h2&gt;
  
  
  6. Integrating NPM into an ASP.Net Core project to use the "MSBuild"
&lt;/h2&gt;

&lt;p&gt;and modify your *.csproj file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;PropertyGroup&amp;gt;
 ...
 &amp;lt;NpmLastInstall&amp;gt;node_modules/.last-install&amp;lt;/NpmLastInstall&amp;gt;
&amp;lt;/PropertyGroup&amp;gt;
...
&amp;lt;!-- Check whether npm install or not! --&amp;gt;
&amp;lt;Target Name="CheckForNpm" BeforeTargets="NpmInstall"&amp;gt;
 &amp;lt;Exec Command="npm -v" ContinueOnError="true"&amp;gt;
  &amp;lt;Output TaskParameter="ExitCode" PropertyName="ErrorCode" /&amp;gt;
 &amp;lt;/Exec&amp;gt;
 &amp;lt;Error Condition="'$(ErrorCode)' != '0'" Text="You must install NPM to build this project" /&amp;gt;
&amp;lt;/Target&amp;gt;

&amp;lt;!-- install package.json package auto "node_modules" --&amp;gt;
&amp;lt;Target Name="NpmInstall" BeforeTargets="Compile" Inputs="package.json" Outputs="$(NpmLastInstall)"&amp;gt;
&amp;lt;Exec Command="npm install" /&amp;gt;
&amp;lt;Touch Files="$(NpmLastInstall)" AlwaysCreate="true" /&amp;gt;
&amp;lt;/Target&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next step we will add Theme features into our project.&lt;br&gt;
stay tune!&lt;/p&gt;

</description>
      <category>tailwindcss</category>
      <category>core</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Invalid href passed to next/router on"next": "12.0.7"</title>
      <dc:creator>Gem Cloud</dc:creator>
      <pubDate>Mon, 24 Jan 2022 20:36:16 +0000</pubDate>
      <link>https://dev.to/gemcloud/invalid-href-passed-to-nextrouter-onnext-1207-269l</link>
      <guid>https://dev.to/gemcloud/invalid-href-passed-to-nextrouter-onnext-1207-269l</guid>
      <description>&lt;p&gt;Environment: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows 11&lt;/li&gt;
&lt;li&gt;"next": "12.0.7"&lt;/li&gt;
&lt;li&gt;TypeScript ( Js should have same issue).&lt;/li&gt;
&lt;li&gt;Dynamic router link&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I met an error "&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%2Fuploads%2Farticles%2Febo18vedcs77ukqd937t.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%2Febo18vedcs77ukqd937t.png" alt="Image description"&gt;&lt;/a&gt;: \, repeated forward-slashes (//) or backslashes \ are not valid in the href", which always shown on VScode &amp;amp; web browsers!&lt;/p&gt;

&lt;p&gt;The root cause is that I joined "/" with my each url string when I generate dynamic links. (nextjs V9 looks should do it!)&lt;/p&gt;

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

href: join('/', slug), 


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

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

slugRoot = "/"
slugAbout = "/about"


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

&lt;/div&gt;

&lt;p&gt;Solution: Do NOT add "/" on head of your url string, and then add "/" on your  tag.&lt;/p&gt;

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

// href: join('/', slug), 
href: slug,


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

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

slugRoot = ""
slugAbout = "about"


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

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

&lt;span class="c1"&gt;// &amp;lt;Link href={`/${yourPath}`} &amp;gt;&amp;lt;/Link&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;prefetch&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;passHref&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>cross-env for front-end (Nextjs) on Windows 10 11</title>
      <dc:creator>Gem Cloud</dc:creator>
      <pubDate>Wed, 29 Dec 2021 17:48:53 +0000</pubDate>
      <link>https://dev.to/gemcloud/front-end-nextjs-on-windows-10-11-3idj</link>
      <guid>https://dev.to/gemcloud/front-end-nextjs-on-windows-10-11-3idj</guid>
      <description>&lt;p&gt;If you are doing front-end projects on windows 10 or 11. &lt;br&gt;
specially, you want to run some of sample codes from GitHub!&lt;br&gt;
Do not forget to install "npm i cross-env" on your project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; npm i cross-env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "cross-env" helps us save a lot of time. otherwise the codes threw errors!&lt;br&gt;
for example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;read some of files from folder (markdown for blog etc.) on Nextjs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;use "NODE_ENV=development" on project.json, see below command about lingui.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "__NoWorkOnWindow_lang:extract": "NODE_ENV=development lingui extract --clean",
    "lang:extract": "cross-env NODE_ENV=development lingui extract --clean",

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

&lt;/div&gt;



&lt;p&gt;Happy Coding!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>webdev</category>
      <category>startup</category>
    </item>
    <item>
      <title>To use yarn at VS-code on Windows 11</title>
      <dc:creator>Gem Cloud</dc:creator>
      <pubDate>Tue, 07 Dec 2021 06:19:59 +0000</pubDate>
      <link>https://dev.to/gemcloud/to-use-yarn-at-vs-code-on-windows-11-15gd</link>
      <guid>https://dev.to/gemcloud/to-use-yarn-at-vs-code-on-windows-11-15gd</guid>
      <description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;install yarn on windows 11.&lt;br&gt;
&lt;a href="https://www.liquidweb.com/kb/how-to-install-yarn-on-windows/"&gt;https://www.liquidweb.com/kb/how-to-install-yarn-on-windows/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Download the Yarn .msi installer &lt;br&gt;
and installed it on windows 11.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Yarn commands for VSCode&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/vscode-yarn"&gt;https://www.npmjs.com/package/vscode-yarn&lt;/a&gt;&lt;br&gt;
install vs-code extension.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Say Hello Dev.to</title>
      <dc:creator>Gem Cloud</dc:creator>
      <pubDate>Fri, 03 Dec 2021 19:29:57 +0000</pubDate>
      <link>https://dev.to/gemcloud/say-hello-devto-60o</link>
      <guid>https://dev.to/gemcloud/say-hello-devto-60o</guid>
      <description>&lt;p&gt;I joined here on Dec. 03 2021.&lt;br&gt;
This is my testing Post.&lt;/p&gt;

&lt;p&gt;Thanks everyone!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
