<?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: jgngo</title>
    <description>The latest articles on DEV Community by jgngo (@jgngo).</description>
    <link>https://dev.to/jgngo</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%2F351629%2Fb171fa21-ef7d-4435-a04c-67eee9bf6004.png</url>
      <title>DEV Community: jgngo</title>
      <link>https://dev.to/jgngo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jgngo"/>
    <language>en</language>
    <item>
      <title>SSL Certificate for Internal Servers</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Mon, 10 Mar 2025 06:58:13 +0000</pubDate>
      <link>https://dev.to/jgngo/ssl-certificate-for-internal-servers-l8j</link>
      <guid>https://dev.to/jgngo/ssl-certificate-for-internal-servers-l8j</guid>
      <description>&lt;p&gt;This is a guide for generating an SSL certificate via Let's Encrypt for a server that is not exposed to the internet. This means the default method where certbot creates a temporary token exposed to the public to verify ownership will not work.&lt;/p&gt;

&lt;p&gt;To prove ownership, you will need to use the DNS challenge and create a DNS TXT entry. To continue with this, you need to have access to create DNS records for your domain.&lt;/p&gt;

&lt;p&gt;Assuming you have installed certbot, you just need to run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo certbot certonly --manual --preferred-challenges=dns
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>devops</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Imagemagick</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Wed, 18 Dec 2024 02:35:29 +0000</pubDate>
      <link>https://dev.to/jgngo/imagemagick-142e</link>
      <guid>https://dev.to/jgngo/imagemagick-142e</guid>
      <description>&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://imagemagick.org/script/download.php#windows" rel="noopener noreferrer"&gt;https://imagemagick.org/script/download.php#windows&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Converting all files to jpg
&lt;/h2&gt;

&lt;p&gt;In a folder, convert all png, webp, gif files to jpg.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;magick mogrify -format jpg -background white -flatten *.png
magick mogrify -format jpg *.webp
magick mogrify -format jpg *.gif
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. File renaming
&lt;/h2&gt;

&lt;p&gt;In Powershell, this will rename all jpeg to jpg.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dir *.jpeg | rename-item -newname { [io.path]::ChangeExtension($_.name, "jpg") }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Resizing all jpg files
&lt;/h2&gt;

&lt;p&gt;This command "Shrinks an image with dimension(s) larger than the corresponding width and/or height argument(s)."&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;magick mogrify -resize '720x720&amp;gt;' *.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Optimize image size
&lt;/h2&gt;

&lt;p&gt;This command will optimize all jpg images to Google Pagespeed recommendations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;magick mogrify -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB *.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Others
&lt;/h2&gt;

&lt;p&gt;These are other commands that may be useful.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;magick mogrify -resize 960x528 *.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command resizes all of the .jpg files in your directory to a size of 960 pixels by 528 pixels. Perhaps the height isn’t as important as the width. You can simply enter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;magick mogrify -resize 960 *.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will scale all of your images to a width of 960 pixels, the height will be scaled accordingly, preserving the aspect ratio.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>imagemagick</category>
      <category>howto</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Starter Nuxt Template</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Thu, 02 May 2024 23:49:31 +0000</pubDate>
      <link>https://dev.to/jgngo/starter-nuxt-template-4cb1</link>
      <guid>https://dev.to/jgngo/starter-nuxt-template-4cb1</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx nuxi@latest init starter
cd starter
pnpm install -D typescript
pnpm add lucide-vue-next
npx nuxi@latest module add shadcn-nuxt
npx shadcn-vue@latest init
npx shadcn-vue@latest add button
npx shadcn-vue@latest add badge
npx shadcn-vue@latest add card
npx shadcn-vue@latest add sheet
npx shadcn-vue@latest add input
npx shadcn-vue@latest add label
npx shadcn-vue@latest add dropdown-menu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Flowbite
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx nuxi@latest init starter
cd starter
npx nuxi@latest module add tailwindcss
pnpm install flowbite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Jasper Studio Design Tips</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Thu, 30 Nov 2023 00:00:23 +0000</pubDate>
      <link>https://dev.to/jgngo/jasper-studio-design-tips-28a8</link>
      <guid>https://dev.to/jgngo/jasper-studio-design-tips-28a8</guid>
      <description>&lt;p&gt;If you are designing a columnar report intended to be exported as Excel, here are some tips.&lt;/p&gt;

&lt;h2&gt;
  
  
  Design
&lt;/h2&gt;

&lt;p&gt;Move the column titles to the Title band. This will allow it to appear only once in the report and not in every page.&lt;/p&gt;

&lt;p&gt;Retain only the Title and Detail bands. Delete all other bands.&lt;/p&gt;

&lt;p&gt;In the Title band, have only the report title and the column header in two rows. There is a property below that tells Excel to freeze the top 2 rows so that the title row and the column headers row is frozen so the user can scroll through thousands of records and still see them.&lt;/p&gt;

&lt;p&gt;In the Detail band properties, set the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Layout: "Grid" or "Spreadsheet". This forces the columns to be right beside each other.&lt;/li&gt;
&lt;li&gt;Height: 14 px&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Properties for Excel Export
&lt;/h2&gt;

&lt;p&gt;In the Source tab, insert the following lines below the other properties. These are selected properties recommended by &lt;a href="https://community.jaspersoft.com/knowledgebase/how-to/tips-exporting-excel/"&gt;this article&lt;/a&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;lt;property name="net.sf.jasperreports.export.xls.wrap.text" value="false"/&amp;gt;
&amp;lt;property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/&amp;gt;
&amp;lt;property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/&amp;gt;
&amp;lt;property name="net.sf.jasperreports.export.xls.white.page.background" value="false"/&amp;gt;
&amp;lt;property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/&amp;gt;
&amp;lt;property name="net.sf.jasperreports.export.xls.ignore.graphics" value="false"/&amp;gt;
&amp;lt;property name="net.sf.jasperreports.page.break.no.pagination" value="apply"/&amp;gt;
&amp;lt;property name="net.sf.jasperreports.export.xls.freeze.row" value="3"/&amp;gt;
&amp;lt;property name="net.sf.jasperreports.print.keep.full.text" value="true"/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Podman Tips</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Tue, 02 May 2023 00:38:40 +0000</pubDate>
      <link>https://dev.to/jgngo/podman-tips-3ank</link>
      <guid>https://dev.to/jgngo/podman-tips-3ank</guid>
      <description>&lt;p&gt;If you are using WSL, you may want to install podman instead of docker. It is a drop-in replacement made by Red Hat. You won't need to do sudo service docker start before running docker commands. To install in WSL, just do the following.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Adding dockerhub registry in the default search
&lt;/h2&gt;

&lt;p&gt;Update the configuration file so it can search the docker.io image registry.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/etc/containers/registries.conf

unqualified-search-registries = ['docker.io']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Access localhost from the container
&lt;/h2&gt;

&lt;p&gt;To allow a running container to access a service running on the host like a database server, a special hostname &lt;code&gt;host.containers.internal&lt;/code&gt; is created in the container &lt;code&gt;/etc/hosts&lt;/code&gt; that points to the local IP.&lt;/p&gt;

&lt;p&gt;PostgreSQL by default only allows connections from localhost. You will need to &lt;a href="https://www.bigbinary.com/blog/configure-postgresql-to-allow-remote-connection" rel="noopener noreferrer"&gt;configure&lt;/a&gt; it to allow remote connections. Update &lt;code&gt;postgresql.conf&lt;/code&gt; and &lt;code&gt;pg_hba.conf&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;postgresql.conf
listen_addresses = '*'

pg_hba.conf
host    all             all             0.0.0.0/0            scram-sha-256
&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;podman run --rm --net=slirp4netns:allow_host_loopback=true -it alpine /bin/sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The parameter &lt;code&gt;--net&lt;/code&gt; allows access to the host. If you run podman as a regular user, the default network setting is &lt;code&gt;slirp4netns&lt;/code&gt; with the &lt;code&gt;allow_host_loopback&lt;/code&gt; set to false. This parameter needs to be set to true to allow slirp4netns to reach the host loopback IP &lt;code&gt;host.containers.internal&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.podman.io/en/latest/markdown/podman-run.1.html" rel="noopener noreferrer"&gt;https://docs.podman.io/en/latest/markdown/podman-run.1.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For docker-compose or podman-compose, add the following under the service.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;network_mode: slirp4netns:allow_host_loopback=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set as default
&lt;/h2&gt;

&lt;p&gt;If there is no existing configuration file in &lt;code&gt;/etc/containers/&lt;/code&gt;, create a copy of the default containers.conf so you can edit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo cp /usr/share/containers/containers.conf /etc/cont
ainers/
sudo vi /etc/containers/containers.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Uncomment and edit the following entry.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Default options to pass to the slirp4netns binary.
# For example "allow_host_loopback=true"
#
network_cmd_options = ["allow_host_loopback=true"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Nuxt 3 Project</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Tue, 18 Apr 2023 09:33:16 +0000</pubDate>
      <link>https://dev.to/jgngo/nuxt-3-project-4ng4</link>
      <guid>https://dev.to/jgngo/nuxt-3-project-4ng4</guid>
      <description>&lt;p&gt;Starting a project example-proj. If you wish to build a project including an API, please use &lt;a href="https://sidebase.io/"&gt;Sidebase&lt;/a&gt; because it has selected plugins pre-configured. For building a Single Page Application, this is a good starting point.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx nuxi@latest init example-proj
cd example-proj
pnpm install --save-dev @nuxtjs/tailwindcss
pnpm install --save-dev nuxt-icon
pnpm install --save-dev @tailwindcss/typography
pnpm install --save-dev @sidebase/nuxt-auth
pnpm install @headlessui/vue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure Tailwind&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nuxt.config.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default defineNuxtConfig({
    modules: [
        '@nuxtjs/tailwindcss',
        '@sidebase/nuxt-auth',    
        'nuxt-icon'
    ],
    app: {
        head: {
            link: [
                { rel: 'icon', type: 'image/x-icon', href: '/favicon.png' }
            ]
        }
    }
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Setup for New Machine</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Thu, 28 Jul 2022 07:30:00 +0000</pubDate>
      <link>https://dev.to/jgngo/setup-for-new-machine-12j8</link>
      <guid>https://dev.to/jgngo/setup-for-new-machine-12j8</guid>
      <description>&lt;p&gt;Things to install when setting up a new machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Windows
&lt;/h2&gt;

&lt;p&gt;In PowerShell, you can quickly install software via scoop&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;irm get.scoop.sh | iex
scoop install git
scoop install 7zip
scoop bucket add extras
scoop install putty
scoop install nvm
scoop install vscode
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Desktop apps&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Libreoffice&lt;/li&gt;
&lt;li&gt;DBeaver&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Vue 3 / Vite on Cloudflare Pages</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Thu, 30 Jun 2022 00:09:59 +0000</pubDate>
      <link>https://dev.to/jgngo/vue-3-vite-on-cloudflare-pages-4l02</link>
      <guid>https://dev.to/jgngo/vue-3-vite-on-cloudflare-pages-4l02</guid>
      <description>&lt;p&gt;A build recently failed in Cloudflare Pages and showed the following error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;19:09:34.631    Executing user command: npm run build
19:09:34.980    
19:09:34.981    &amp;gt; webapp@0.0.0 build /opt/buildhome/repo
19:09:34.981    &amp;gt; vite build
19:09:34.981    
19:09:35.288    failed to load config from /opt/buildhome/repo/vite.config.js
19:09:35.289    error during build:
19:09:35.289    Error: Cannot find module 'happy-dom'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Doing &lt;code&gt;npm run build&lt;/code&gt; on my local machine worked fine so I went on to find out the difference between my machine and the Cloudflare Pages build environment.&lt;/p&gt;

&lt;p&gt;It turned out that my machine was on Node 16.15.0 while Cloudflare Pages was at 12.18.0, which is quite old. So, based on the &lt;a href="https://developers.cloudflare.com/pages/platform/build-configuration/"&gt;build configuration docs&lt;/a&gt;, all we need to do is set an environment variable in the build settings of the Cloudflare Pages project for both production and preview &lt;code&gt;NODE_VERSION=16.15.0&lt;/code&gt; so it matches the local build environment.&lt;/p&gt;

&lt;p&gt;After saving the environment variable and retrying deployment, the build was successful. This tip would apply to any javascript project that uses npm or yarn for building.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>vite</category>
      <category>cloudflare</category>
    </item>
    <item>
      <title>Strapi Authentication via Provider</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Mon, 30 May 2022 02:56:01 +0000</pubDate>
      <link>https://dev.to/jgngo/strapi-authentication-via-provider-220e</link>
      <guid>https://dev.to/jgngo/strapi-authentication-via-provider-220e</guid>
      <description>&lt;p&gt;If you use a 3rd party provider in Strapi for authentication, the access token works a little differently.&lt;/p&gt;

&lt;p&gt;The access token that you receive from cognito is not valid in Strapi. You need to retrieve a token from strapi.&lt;/p&gt;

&lt;p&gt;From the frontend app, read the query string from cognito after successful authentication and submit both the id_token and access_token to this Strapi endpoint.&lt;/p&gt;

&lt;p&gt;If you are using the AWS Amplify SDK, Auth.currentSession() will return a CognitoUserSession containing the accessToken and idToken.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const data = await Auth.currentSession()
const access_token = data.accessToken.jwtToken
const id_token = data.idToken.jwtToken
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Send both Cognito tokens to the callback URL so that you can get a Strapi JWT that you can then use for all subsequent calls to Strapi. By calling this URL, Strapi will automatically create a new record in the User table.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;${backendUrl}/api/auth/${params.providerName}/callback?id_token=xxx&amp;amp;access_token=yyy&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You will receive the following response.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"jwt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;access token&amp;gt; that you can use thereafter"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"username"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"google_999999999999999999"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"theuser@gmail.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"provider"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cognito"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"confirmed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"blocked"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"createdAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2022-05-30T02:50:08.907Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"updatedAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2022-05-30T02:50:08.907Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>strapi</category>
      <category>cognito</category>
      <category>jwt</category>
    </item>
    <item>
      <title>New .NET 6 Project</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Fri, 27 May 2022 07:38:14 +0000</pubDate>
      <link>https://dev.to/jgngo/new-net-6-project-1j9a</link>
      <guid>https://dev.to/jgngo/new-net-6-project-1j9a</guid>
      <description>&lt;p&gt;Work in progress...&lt;/p&gt;

&lt;p&gt;This guide helps you setup a new .NET 6 project using PostgreSQL as a database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scaffold a project
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet new webapi -o myapp
cd myapp
dotnet new gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configure an existing project using SQL Server to PostgreSQL
&lt;/h2&gt;

&lt;p&gt;This scenario assumes that you used EntityFramework and have existing models and configuration for SQL Server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup Entity Framework and PostgreSQL libraries
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet add package Npgsql
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL
dotnet add package Microsoft.EntityFrameworkCore
dotnet add package Microsoft.EntityFrameworkCore.Design
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;appsettings.json&lt;/code&gt; add a connection string for PostgreSQL.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"ConnectionStrings": {
    "DefaultConnection": "you_can_retain_existing_connection",
    "PgConnection": "Host=localhost;Database=mydb;Username=myuser;Password=mypassword"
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;Program.cs&lt;/code&gt; setup the DbContext&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var connectionString = builder.Configuration.GetConnectionString("PgConnection");
builder.Services.AddDbContext&amp;lt;MYDB&amp;gt;(opt =&amp;gt; opt.UseNpgsql(connectionString));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Run the migrations
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet ef migrations add InitialCreate
dotnet ef database update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create Models
&lt;/h2&gt;

&lt;p&gt;:WIP: &lt;/p&gt;

&lt;h2&gt;
  
  
  Reverse Engineering an Existing Database
&lt;/h2&gt;

&lt;p&gt;This scenario is when you have an existing database structure. You can generate the Models automatically by running one of the following scaffolding commands. The --output-dir parameter sets the location of the generated files. If you don't specify this parameter, it will create the files in the root folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/ef/core/managing-schemas/scaffolding?tabs=dotnet-core-cli"&gt;https://docs.microsoft.com/en-us/ef/core/managing-schemas/scaffolding?tabs=dotnet-core-cli&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- SQL Server source
dotnet ef dbcontext scaffold "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=Chinook" Microsoft.EntityFrameworkCore.SqlServer" --output-dir Models

-- PostgreSQL source
dotnet ef dbcontext scaffold "Host=my_host;Database=my_db;Username=my_user;Password=my_pw" Npgsql.EntityFrameworkCore.PostgreSQL --output-dir Models
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>dotnet</category>
    </item>
    <item>
      <title>Starting a Vue 3 project</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Thu, 26 May 2022 00:50:48 +0000</pubDate>
      <link>https://dev.to/jgngo/starting-a-vue-3-project-m74</link>
      <guid>https://dev.to/jgngo/starting-a-vue-3-project-m74</guid>
      <description>&lt;h2&gt;
  
  
  tl;dr
&lt;/h2&gt;

&lt;p&gt;Use &lt;code&gt;npm init vue@latest&lt;/code&gt;. This uses Vite as the build tool and provides options to enable state management, routing and testing tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting a vue project
&lt;/h2&gt;

&lt;p&gt;There are 3 official ways to start a Vue project. Vue CLI appears to be &lt;a href="https://medium.com/js-dojo/has-vite-made-vue-cli-obsolete-17868d59bed8"&gt;obsolete&lt;/a&gt; with the arrival of Vue 3.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Vue create-vue: the official Vue project scaffolding tool&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm init vue@latest&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Vite preset: a build tool that aims to provide a faster and leaner development experience for modern web projects&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm create vite@latest&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Vue CLI: aims to be the standard tooling baseline for the Vue ecosystem. This appears to be for Vue 2.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vue create hello-world&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Vue create-vue
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://vuejs.org/guide/quick-start.html#with-build-tools"&gt;official docs&lt;/a&gt; recommend this command to start a build-tool-enabled project. The command provides several options that default to No. I recommend you enable Typescript, Vue Router and Pinia. The others can be added to your project when you are ready to use them.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm init vue@latest&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Vue.js - The Progressive JavaScript Framework

√ Project name: ... vuecreate
√ Add TypeScript? ... No / Yes
√ Add JSX Support? ... No / Yes
√ Add Vue Router for Single Page Application development? ... No / Yes
√ Add Pinia for state management? ... No / Yes
√ Add Vitest for Unit Testing? ... No / Yes
√ Add Cypress for both Unit and End-to-End testing? ... No / Yes
√ Add ESLint for code quality? ... No / Yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Vite vue preset
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;npm create vite@latest&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;√ Project name: ... vite-project
√ Select a framework: » vue
√ Select a variant: » vue

Scaffolding project in C:\Users\ngoja\sandbox\vite-project...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Post project creation
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Install Tailwind
&lt;/h4&gt;

&lt;p&gt;After project creation, cd to your project folder and install Tailwind.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tailwindcss.com/docs/guides/vite"&gt;https://tailwindcss.com/docs/guides/vite&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then edit the following 3 files:&lt;/p&gt;

&lt;p&gt;./tailwind.config.js - replace the &lt;code&gt;content&lt;/code&gt; line with this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;content: [
    "./index.html",
    "./src/**/*.{vue,js,ts,jsx,tsx}",
  ],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;./src/index.css - create this new file&lt;br&gt;
&lt;/p&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;p&gt;./src/main. - insert after the last import statement&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import './index.css'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will then want to delete the &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; section in ./src/App.vue so it won't conflict with the Tailwind css.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>vite</category>
    </item>
    <item>
      <title>VSCode Tips</title>
      <dc:creator>jgngo</dc:creator>
      <pubDate>Wed, 25 May 2022 09:40:06 +0000</pubDate>
      <link>https://dev.to/jgngo/vscode-tips-1ena</link>
      <guid>https://dev.to/jgngo/vscode-tips-1ena</guid>
      <description>&lt;p&gt;If you have 11 minutes to spare, watch this first. The general principle is:&lt;/p&gt;

&lt;p&gt;[🐭 Mouse (Slow) and 🎹 Keyboard (Fast)]&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ifTF3ags0XI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Speed Selection
&lt;/h2&gt;

&lt;p&gt;If you work with tags (HTML, Vue, React), the most common task involves moving an entire tag to another location or file. Amateur coders will use a mouse to highlight the block of code and then cut and paste.&lt;/p&gt;

&lt;p&gt;To save time, move your cursor to the start tag, for example somewhere in &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;. Then press Alt-Shift-Right Arrow. The first stroke selects the word, then repeat the action until the selection is all the way to the closing &lt;code&gt;&amp;lt;/div&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;From here, you can then cut (&lt;code&gt;Ctrl-X&lt;/code&gt;) or move (&lt;code&gt;Alt-Up/Down Arrow&lt;/code&gt;) the selected code.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Ctrl-D&lt;/code&gt;: Quickly select the entire word where the cursor is. Press again to select the same word in a another location. Since there are multiple cursors, deleting or typing will make edits simultaneously. &lt;/p&gt;

&lt;h2&gt;
  
  
  Deleting Lines
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Ctrl-Shift-K&lt;/code&gt;: Deletes the entire line where the cursor is&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigation
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Ctrl-P&lt;/code&gt;: Allows you to open a file directly without using the mouse to locate it in a file directory.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Ctrl-Shift-Period&lt;/code&gt;: Opens a navigator to quickly jump to particular sections of code.&lt;/p&gt;

&lt;p&gt;Enjoy your free time!&lt;/p&gt;

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