<?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: Patrick</title>
    <description>The latest articles on DEV Community by Patrick (@patik123).</description>
    <link>https://dev.to/patik123</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%2F621938%2F54719ed2-095e-43ad-a307-ec250ffc9ace.png</url>
      <title>DEV Community: Patrick</title>
      <link>https://dev.to/patik123</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/patik123"/>
    <language>en</language>
    <item>
      <title>What is an open graph? You must know this feature in web development.</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Mon, 23 Oct 2023 18:12:05 +0000</pubDate>
      <link>https://dev.to/patik123/what-is-an-open-graph-you-must-know-this-feature-in-web-development-7bo</link>
      <guid>https://dev.to/patik123/what-is-an-open-graph-you-must-know-this-feature-in-web-development-7bo</guid>
      <description>&lt;p&gt;Open Graph is an Internet protocol created by Facebook to standardize the display of metadata on social networks.&lt;/p&gt;

&lt;h3&gt;
  
  
  What advantages does it bring?
&lt;/h3&gt;

&lt;p&gt;Open Graph brings advantages when displaying a website on social networks. Open Graph makes our posts more visible on social networks and shows them better in searches.&lt;/p&gt;

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

&lt;p&gt;Above we can see a website without Open Graph tags and how the link will be displayed on the Facebook social network.&lt;/p&gt;

&lt;p&gt;Now I will show how my blog post would look if I share or post a link on Facebook or another social network using the Open Graph protocol.&lt;/p&gt;

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

&lt;p&gt;Even if you don't have any Open Graph tags on your page, nothing serious will happen, but they improve your presentation on social networks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basics of Open Graph?
&lt;/h3&gt;

&lt;p&gt;We know the four basic tags used in the Open Graph protocol, which are considered mandatory. These tags are &lt;code&gt;og:title&lt;/code&gt;, &lt;code&gt;og:type&lt;/code&gt;, &lt;code&gt;og:image&lt;/code&gt;, and &lt;code&gt;og:url&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What represents which element is shown in the image below?&lt;/p&gt;

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

&lt;p&gt;Purpose of individual labels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;og:image&lt;/code&gt; - displays an image (contains the URL to the image)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;og:title&lt;/code&gt; - usually the same as in &amp;lt;title&amp;gt; and displays the page title&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;og:description&lt;/code&gt; - used to describe the page&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;og:url&lt;/code&gt; -represents the URL of the page&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;og:locale&lt;/code&gt; - intended to indicate the language of the publication&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are officially 17 different tags that you can use on your website. You can read more about the possible tags in the &lt;a href="https://ogp.me/"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to add an Open Graph to a website?
&lt;/h3&gt;

&lt;p&gt;Adding Open Graph tags is easy. We add them to the header in the meta tag with the desired content. Below is a simple Open Graph example for the above example post at the following &lt;a href="https://blog.thepatik.com/open-source-software-what-makes-it-so-attractive"&gt;link&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:title"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Open-source software: what makes it so attractive?"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"You may already be familiar with the term &amp;amp;quot;open source&amp;amp;quot; if you have been involved in programming for some time. Open-source software has gained popularity for many reasons, some of which I will attempt to explain below."&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:type"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"article"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:url"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"https://blog.thepatik.com/open-source-software-what-makes-it-so-attractive"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"image"&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:image"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"https://hashnode.com/utility/r?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1682593145782%2F3f7705ec-2679-4c1c-a52d-b8d3fdeaa78d.png%3Fw%3D1200%26h%3D630%26fit%3Dcrop%26crop%3Dentropy%26auto%3Dcompress%2Cformat%26format%3Dwebp%26fm%3Dpng"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;As we have seen, the Open Graph protocol is a simple addition to websites that improve presentation on social networks.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>What is Web OTP, and which benefits do it provide to users?</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Sun, 01 Oct 2023 17:03:40 +0000</pubDate>
      <link>https://dev.to/patik123/what-is-web-otp-and-which-benefits-do-it-provide-to-users-4h1f</link>
      <guid>https://dev.to/patik123/what-is-web-otp-and-which-benefits-do-it-provide-to-users-4h1f</guid>
      <description>&lt;p&gt;More and more online services are introducing new ways to confirm login to their services. Logging in with an OTP confirmation token is becoming a very common practice. But such authorization methods have their disadvantages such as bad UX and what if the user does not have a phone with him, what is the other authentication confirmation method?&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%2Fhvx0yzpurmd9wskwfvro.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%2Fhvx0yzpurmd9wskwfvro.png" alt="2Fa"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;WebOTP is a Web API browser function integrated into Chrome, Samsung Internet and Opera Mobile (Apple devices have their version), browsers on mobile devices, intended for obtaining an OTP (One-Time-Password) in the process of two-factor or multi-factor with the help of an SMS message.&lt;/p&gt;

&lt;h3&gt;
  
  
  How WebOTP works
&lt;/h3&gt;

&lt;p&gt;An example of using WebOTP in practice.&lt;/p&gt;

&lt;p&gt;The user logs in to the website with his user data (email and password), and then the server sends him an SMS message in the prescribed format and an OTP token.&lt;/p&gt;

&lt;p&gt;If the browser detects the message, it prompts the user to allow access to read the SMS message.&lt;/p&gt;

&lt;p&gt;If the user gives permission, the OTP is automatically entered in the OTP input field and the form is sent to the server, which confirms the validity of the entered OTP token.&lt;/p&gt;

&lt;p&gt;If the OTP token is valid, the user is logged in, it is not.&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%2F2o1gcptffhulrod0x23f.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%2F2o1gcptffhulrod0x23f.png" alt="Auth flow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A page must use the WebOTP API to have a valid SSL certificate and a secure HTTPS connection established, otherwise, this WebAPI will not work.&lt;/p&gt;

&lt;h3&gt;
  
  
  SMS message format
&lt;/h3&gt;

&lt;p&gt;A standardized message format is provided for using the WebOTP API so that the browser can successfully read the data from the message.&lt;/p&gt;

&lt;p&gt;Message content:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Message to the user (optional) -&amp;gt; message to the user;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Website domain (mandatory) -&amp;gt; must be written in its line and start with &lt;code&gt;@&lt;/code&gt; and continue with the domain name without path and protocol;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;OTP (mandatory) -&amp;gt; written in the same line as the domain, the OTP value can be from four to six digits. The OTP must start in the message with &lt;code&gt;#&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example of SMS with OTP&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="1" rowspan="1"&gt;&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/www"&gt;@www&lt;/a&gt;.example.com #123456&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The most common mistakes in OTP messages:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Incorrect message format&lt;/th&gt;
&lt;th&gt;Error description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Your PIN: #123456&lt;/td&gt;
&lt;td&gt;The code must be on its line with the specified domain.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Your registration code: @&lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; #123456&lt;/td&gt;
&lt;td&gt;Domain and OTP must be on their line.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;@&lt;a href="https://example.com" rel="noopener noreferrer"&gt;https://example.com&lt;/a&gt; #123456&lt;/td&gt;
&lt;td&gt;The URL scheme must not be included.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;@example.com/otp.html #123456&lt;/td&gt;
&lt;td&gt;The URL must not include a path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;@example.com #123456 Your code for login: 123456.&lt;/td&gt;
&lt;td&gt;The domain and OTP must be the last line of the message.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Your login code is 123456. @&lt;a href="http://www.example.com#123456" rel="noopener noreferrer"&gt;www.example.com#123456&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;There must be one space between the domain and the OTP.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hi, I'll be home by lunch today 😊&lt;/td&gt;
&lt;td&gt;Missing @ and #.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Your login code is 123456. &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; #123456&lt;/td&gt;
&lt;td&gt;@ is missing before the domain.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  User-Side Code Example (JavaScript)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="nx"&gt;DOCTYPE&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Test&lt;/span&gt; &lt;span class="nx"&gt;WebOTP&lt;/span&gt; &lt;span class="nx"&gt;API&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/title&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/head&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
         &lt;span class="c"&gt;&amp;lt;!--&lt;/span&gt; &lt;span class="nx"&gt;Form&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;GET&lt;/span&gt; &lt;span class="nx"&gt;method&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;see&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;sent&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt; &lt;span class="o"&gt;--&amp;gt;&lt;/span&gt;
         &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;otp_input&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;OTP&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;         &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;autocomplete&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;one-time-code&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;otp_input&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;otp_input&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;required&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;submit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/body&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;OTPCredential&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// Checking if OTP is even available in the browser&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;DOMContentLoaded&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;input[autocomplete="one-time-code"]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ac&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;AbortController&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
          &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;form&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;closest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;form&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;submit&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="nx"&gt;ac&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abort&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
          &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
          &lt;span class="na"&gt;otp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;:[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sms&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="na"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ac&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;signal&lt;/span&gt;
      &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;otp&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// In case of successful reading of the message, sending the OTP message&lt;/span&gt;
          &lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;otp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Enter the OTP value&lt;/span&gt;
          &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;otp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Form submission&lt;/span&gt;
          &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Log an error in case of error&lt;/span&gt;
          &lt;span class="p"&gt;});&lt;/span&gt;
          &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/html&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is a Web component for integration into websites. The web component is written in the JavaScript programming language and can be installed using the NPM tool.&lt;/p&gt;

&lt;p&gt;This library is available on &lt;a href="https://github.com/philnash/web-otp-input" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and it is licensed under the MIT license.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser support
&lt;/h3&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%2Fqklvibd2uiwiq9lpe6dw.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%2Fqklvibd2uiwiq9lpe6dw.png" alt="Browser support"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most commonly used browsers on Android phones are supported. Apple devices are not supported but use their own Apple AutoFill.&lt;/p&gt;

&lt;p&gt;Chrome, Edge and Opera desktop browsers are also supported, as sending is possible OTP from the phone to the computer if the conditions for this are met (&lt;a href="https://developer.chrome.com/blog/cross-device-webotp/" rel="noopener noreferrer"&gt;https://developer.chrome.com/blog/cross-device-webotp&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx6nnxqx1ayq01he543mo.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%2Fx6nnxqx1ayq01he543mo.png" alt="Computer laptop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages of using WebOTP
&lt;/h3&gt;

&lt;p&gt;The main advantage of using the WebOTP functions is a better user experience of entering OTPs, as there is no need to open the SMS message and copy it only to the application itself.&lt;/p&gt;

&lt;p&gt;I would suggest adding to the login flow the possibility of a different login method in case the user does not have his phone with him to read and enter the OTP.&lt;/p&gt;

&lt;p&gt;Taken from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://developer.chrome.com/articles/web-otp/" rel="noopener noreferrer"&gt;https://developer.chrome.com/articles/web-otp/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/WebOTP_API" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/API/WebOTP_API&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://developer.chrome.com/blog/cross-device-webotp/" rel="noopener noreferrer"&gt;https://developer.chrome.com/blog/cross-device-webotp/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://philna.sh/blog/2022/12/07/better-two-factor-authentication-experiences-with-web-otp" rel="noopener noreferrer"&gt;https://philna.sh/blog/2022/12/07/better-two-factor-authentication-experiences-with-web-otp&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://developer.apple.com/news/?id=z0i801mg" rel="noopener noreferrer"&gt;https://developer.apple.com/news/?id=z0i801mg&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Open-source software: what makes it so attractive?</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Thu, 27 Apr 2023 11:04:29 +0000</pubDate>
      <link>https://dev.to/patik123/open-source-software-what-makes-it-so-attractive-4c0g</link>
      <guid>https://dev.to/patik123/open-source-software-what-makes-it-so-attractive-4c0g</guid>
      <description>&lt;p&gt;You may already be familiar with the term "open source" if you have been involved in programming for some time. Open-source software has gained popularity for many reasons, some of which I will attempt to explain below.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;To start with, let's define what open-source software is. Put simply, it refers to programs whose source code is publicly available. This code can typically be accessed through online Git repositories, with GitHub being one of the largest collections of open-source software available.&lt;/p&gt;

&lt;p&gt;You're likely already familiar with some examples of open-source software, such as MySQL, Visual Studio Code, Apache HTTP server, Mozilla Firefox Browser, VLC media player, and Linux OS. These programs and operating systems have all been developed using open-source methodologies.&lt;/p&gt;

&lt;p&gt;The benefits of open-source software are numerous and extend to developers and businesses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Better security
&lt;/h2&gt;

&lt;p&gt;One common misconception about open-source software is that it is inherently less secure than closed-source software, as the code is publicly accessible and could be vulnerable to analysis by malicious actors. However, the reality is quite the opposite - open-source software is widely considered to be more secure than its closed-source counterparts.&lt;/p&gt;

&lt;p&gt;A prime example of this is the comparison between Windows and Linux operating systems. Windows has been plagued by numerous security vulnerabilities over the years, whereas Linux has a reputation for being more secure.&lt;/p&gt;

&lt;p&gt;This can largely be attributed to the "many eyes" phenomenon, in which a greater number of people can analyze the code and identify bugs and security flaws more quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Freedom
&lt;/h2&gt;

&lt;p&gt;Another major advantage of open-source software is the freedom it provides. With open-source software, individuals and businesses can easily adapt the software to meet their specific needs. This level of customization is not possible with closed-source software, which is often restricted by licensing agreements and proprietary code.&lt;/p&gt;

&lt;p&gt;In practice, open-source software enables greater flexibility and control over the software, allowing for a more tailored user experience. This level of freedom is particularly important for businesses, as it enables them to adapt the software to meet their specific needs and gain a competitive advantage in their industry.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Community support
&lt;/h2&gt;

&lt;p&gt;One of the key strengths of open-source software is the strong sense of community that surrounds it. Open-source projects are often supported by large and passionate communities of developers and users, who are dedicated to improving the software and helping others to use it effectively.&lt;/p&gt;

&lt;p&gt;This community support can take many forms, including online forums, user groups, and developer communities. These resources provide a wealth of knowledge and expertise that can be invaluable when encountering issues with open-source software. The strength of the community also ensures that open-source software is constantly evolving and improving, as developers collaborate and share ideas to enhance the software's functionality and performance.&lt;/p&gt;

&lt;p&gt;For users and businesses, the community support provided by open-source software can be a major advantage, as it ensures that help is readily available when needed and that the software remains up-to-date and relevant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transparency
&lt;/h2&gt;

&lt;p&gt;Another important benefit of open-source software is the transparency it provides. Open-source software is developed in an open and collaborative environment, allowing anyone to view, edit, and review the source code.&lt;/p&gt;

&lt;p&gt;This level of transparency ensures that the software is free from hidden features or malicious code, increasing user confidence in the software's integrity. In contrast, closed-source software can sometimes hide unexpected or unwanted features, such as data collection, which can erode user trust and lead to privacy concerns.&lt;/p&gt;

&lt;p&gt;By providing full visibility into the code, open-source software enables users and businesses to fully understand how the software works and make informed decisions about its use. This transparency is particularly important in industries such as healthcare and finance, where trust and accountability are critical.&lt;/p&gt;

&lt;h2&gt;
  
  
  A free alternative
&lt;/h2&gt;

&lt;p&gt;Open-source applications are often created to create an alternative to paid applications. It can also happen that the alternative to commercial applications is even better than the commercial application itself.&lt;/p&gt;

&lt;p&gt;These are just a few reasons why open source is so attractive, if you have any other ideas of your own why open source is so attractive, add it in the comments.&lt;/p&gt;

&lt;p&gt;If you like the content I create, connect with me at:&lt;/p&gt;

&lt;p&gt;🔷&lt;a href="https://mstdn.social/@patik123"&gt;Mastodon&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔷&lt;a href="https://www.linkedin.com/in/patrick-kosir/"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>opensource</category>
      <category>development</category>
    </item>
    <item>
      <title>How I set up my home server</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Fri, 02 Dec 2022 18:04:37 +0000</pubDate>
      <link>https://dev.to/patik123/how-i-set-up-my-home-server-531o</link>
      <guid>https://dev.to/patik123/how-i-set-up-my-home-server-531o</guid>
      <description>&lt;p&gt;You may wonder why you want to set up your server at home. In today's world, this has many advantages.&lt;/p&gt;

&lt;p&gt;I've wanted to set up my server for my needs for a while now, but never found the time or how to. Well, last week I finally made it happen, and currently, it's working for me (the server, make no mistake).&lt;/p&gt;

&lt;p&gt;First, the advantages of having your server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The data is only yours, everything you have stored on your computer you know until you access it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can configure it as you wish, you are not tied to a service provider&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is cheap to set up and maintain&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But what can be the disadvantages of own server&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Security, you have to deal with who accesses your server and how you have it configured&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extra electricity costs&lt;/p&gt;&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%2Fcq4iia7bpfdnxbzlrzz5.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%2Fcq4iia7bpfdnxbzlrzz5.png" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://nextcloud.com/" rel="noopener noreferrer"&gt;Nextcloud&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Before presenting how my server works, I will present what Nextcloud is. Nextcloud is open-source software that allows us to build our digital cloud.&lt;/p&gt;

&lt;p&gt;Nextcloud is an excellent alternative to big fishes like Dropbox, Office 365 and Google Drive, as it allows for a massive amount of expansion and many extra functions that are unavailable in any of the commercial programs listed above.&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%2Fs3tmugjsrlluunw93zf3.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%2Fs3tmugjsrlluunw93zf3.png" alt="Nextcloud logo" width="352" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The software also has the option of installing a tool for group file editing and an online editor of documents, layouts, and tables like that of Microsoft Office. Nextcloud also allows you to make video calls and send direct messages.&lt;/p&gt;

&lt;p&gt;By adding plugins, Nextcloud can become the ultimate productivity tool.&lt;/p&gt;

&lt;p&gt;Nextcloud is also used in companies and also in the German government and schools.&lt;/p&gt;

&lt;h1&gt;
  
  
  How do I set up my server?
&lt;/h1&gt;

&lt;p&gt;I've taken tons of photos in my life, and last year Google Photos introduced a photo upload limit. So, some time ago, I ran out of space in the Google Photo service. So, I had one computer at home, which I did not use in principle, and I installed the Ubuntu operating system.&lt;/p&gt;

&lt;p&gt;I chose the Ubuntu operating system because it is used and because it has a nice graphical interface (if I ever decide to take my computer with me).&lt;/p&gt;

&lt;p&gt;First, it was necessary to update all packages to the latest version.&lt;/p&gt;

&lt;p&gt;How I went about installing &lt;a href="https://nextcloud.com/" rel="noopener noreferrer"&gt;Nextcloud&lt;/a&gt; on Ubuntu.&lt;/p&gt;

&lt;p&gt;There is already a package for easy installation of Nextcloud in the Snap online market and it contains everything we need (&lt;a href="https://snapcraft.io/nextcloud" rel="noopener noreferrer"&gt;installation package link&lt;/a&gt;).&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%2Fg0xqc37b26vuicxdasha.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%2Fg0xqc37b26vuicxdasha.png" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All we have to do is install this package. The easiest way to do this is with a simple command.&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;snap &lt;span class="nb"&gt;install &lt;/span&gt;nextcloud
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, inside my home local network, I entered the IP address of my computer in the web browser and installed Nextcloud to the end and created a user account to access the installation.&lt;/p&gt;

&lt;p&gt;Such an installation is only available within a local network? But what if I want to access my “cloud” also from some other network?&lt;/p&gt;

&lt;p&gt;There are many solutions for this as well, from redirecting your router to a suitable computer, setting up a VPN server at home or tunnelling. Tuning turned out to be the most optimal and cheapest solution for me.&lt;/p&gt;

&lt;p&gt;I always host my domains with Cloudflare because it gives me many free features. Some free services are CDN with unlimited bandwidth, static website hosting, DNS domain hosting with unlimited DNS records, Cloudflare Tunnels, DDoS website protection…&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloudflare Tunnels
&lt;/h2&gt;

&lt;p&gt;Usually, to access your server at home in a private network, you need a static IP and port forwarding on the router.&lt;/p&gt;

&lt;p&gt;But there are tunnels in the networking. Like in the real world, tunnels are designed to overcome obstacles. In our case, the obstacle is our local network. Network tunnels allow us to create secure connections to our application on the server, something like a VPN.&lt;/p&gt;

&lt;p&gt;In case we already have our domain on Cloudflare DNS, then creating tunnels is easy like a cake. We only need to install the Cloudflare application on the device (only one command on Linux) and then we can set up the applications hosted on the device in the Cloudflare GUI.&lt;/p&gt;

&lt;p&gt;The first step of installing Cloudflare Tunnels. We must install this little package into our system.&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%2Fadtty3jdtakvk7s9qnpf.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%2Fadtty3jdtakvk7s9qnpf.png" alt="Image description" width="800" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then set our public hostnames. What is simple, is just enter the subdomain of the domain which we like and then set the hostname on the device URL.&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%2Frli9vw7pe3ua38rcjxp2.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%2Frli9vw7pe3ua38rcjxp2.png" alt="Image description" width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can use &lt;a href="https://www.cloudflare.com/products/tunnel/" rel="noopener noreferrer"&gt;Cloudflare Tunnels&lt;/a&gt; for SSH or RDP access to our machine.&lt;/p&gt;

&lt;p&gt;The function is also useful when we want to show a prototype of our product.&lt;/p&gt;

&lt;p&gt;I hope this article helped you to discover how easy it is to set up your own media server.&lt;/p&gt;

&lt;p&gt;Till next time 👋.&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>How to make a website compliant with Europe law?</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Fri, 07 Oct 2022 18:39:26 +0000</pubDate>
      <link>https://dev.to/patik123/how-to-make-a-website-compliant-with-europe-law-4jk2</link>
      <guid>https://dev.to/patik123/how-to-make-a-website-compliant-with-europe-law-4jk2</guid>
      <description>&lt;p&gt;Europe is a country that puts citizens and their privacy first.&lt;/p&gt;

&lt;p&gt;Large corporations collect data about their users daily, without their knowledge. Because of these examples, there is quite a lot of European legislation that we must follow when creating websites and applications.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Privacy is dead, and social media holds the smoking gun.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Protection of personal data
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H9GlLSz9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89njojxcu5wzdyh5047y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H9GlLSz9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89njojxcu5wzdyh5047y.png" alt="europe GDPR" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the most high-profile requirements was the GDPR (&lt;strong&gt;General Data Protection Regulation&lt;/strong&gt;) adopted in 2016, which changed a lot of things in the field of personal data collection and processing. The order increased the transparency of the use and collection, transmission and use of personal data.&lt;/p&gt;

&lt;p&gt;The GDPR requires every developer of web applications/sites to draw up a privacy policy in which data collected about who collects personal data (it can be a natural or legal person), what data is collected and how it is obtained. It is necessary to be aware that the amount of collected personal data must be limited to a minimum, which means that we must not collect more data “in case we need it sometime in the future”. It is also necessary to provide a contact whom the visitor/user can contact in case he wants to exercise his rights under the GDPR. At the same time, it is necessary to specify the user's rights.&lt;/p&gt;

&lt;p&gt;The document in which we describe this is called the &lt;strong&gt;privacy policy.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Cookies
&lt;/h2&gt;

&lt;p&gt;Cookies are very popular for storing data in user sessions, and services for website visit analytics are very popular on websites.&lt;/p&gt;

&lt;p&gt;The European directive on electronic privacy (ePrivacy) requires the companies to offer the user, in the case of using cookies for analytics, and marketing, the option of choosing if they agree to the use of services. &lt;/p&gt;

&lt;p&gt;In practice, this usually means. When visitors visit the page, the website must display a banner about the use of cookies and options to agree or not.&lt;/p&gt;

&lt;p&gt;If the visitor/user refuses to use cookies, it is necessary to ensure that the cookies aren't installed. &lt;/p&gt;

&lt;p&gt;This rule does not apply to functional cookies (e.g., cookies that store login information)&lt;/p&gt;

&lt;p&gt;But this directive does not only apply to cookies but to all technologies that enable storage on the computer and re-recognition of users, including possible storage in the browser's local storage (LocalStorage, SessionStorage).&lt;/p&gt;

&lt;p&gt;Because of this European law, every website must have a document called a &lt;strong&gt;cookie policy&lt;/strong&gt;, which must contain what a cookie is, why it is used and the categorization of each cookie on the website. What this means, is that it is necessary to list all the cookies that are on the website and describe why they are used and how long they are kept.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Privacy is not something that I'm entitled to, it's an absolute prerequisite.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SvGWy--8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gs1c4d7hp0on08xux4pl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SvGWy--8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gs1c4d7hp0on08xux4pl.png" alt="business" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Google Analytics yes, or no?
&lt;/h1&gt;

&lt;p&gt;Many companies/organizations use Google Analytics to track user behaviour (me included). &lt;/p&gt;

&lt;p&gt;But, can I even use it? The answer is not clear. &lt;/p&gt;

&lt;p&gt;The European countries of Austria, France, and Italy have already banned the use of Google Analytics on websites, as Google collects a huge amount of data on user behaviour with Google Analytics and uses it for its own needs - targeted advertising.&lt;/p&gt;

&lt;p&gt;However, there are quite a few alternatives with which we can collect analytical data about visits to our websites.&lt;/p&gt;

&lt;p&gt;Some of them are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://matomo.org/"&gt;Matomo Analytics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://plausible.io/"&gt;Plausible Analytics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://piwik.pro/"&gt;Piwik Analytics Suite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://umami.is/"&gt;umami&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;All these alternatives try to be and collect as little data about visitors as possible, but still, try to get enough data for analysis.&lt;/p&gt;

&lt;p&gt;If you ever check a website, you will find that many websites do not follow European directives.&lt;/p&gt;

&lt;p&gt;I hope I have shown you how much is required for a website to follow European legislation.&lt;/p&gt;

&lt;p&gt;All these rules apply in the European Union and to companies outside the European Union if they collect data about EU citizens.&lt;/p&gt;

&lt;p&gt;The article is informative, I am not a lawyer. Consult a lawyer/lawyer for exact determinations.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>career</category>
    </item>
    <item>
      <title>Web Storage API - Explain Like I'm Five</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Mon, 13 Jun 2022 19:26:52 +0000</pubDate>
      <link>https://dev.to/patik123/web-storage-api-explain-like-im-five-7mm</link>
      <guid>https://dev.to/patik123/web-storage-api-explain-like-im-five-7mm</guid>
      <description>&lt;p&gt;Web browsers today have a huge range of features, and more and more will get them.&lt;/p&gt;

&lt;p&gt;We all know about cookies in our browsers, but browsers today have a special feature called the Web Storage API that allows us to temporarily or permanently store values.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Web Storage API?
&lt;/h2&gt;

&lt;p&gt;The Web Storage API is a browser functionality that can store data in key-value format. The purpose of this browser API is to make the site more intuitive than cookies.&lt;/p&gt;

&lt;p&gt;A big advantage of the Web Storage API is that values are stored even if the user closes the browser.&lt;/p&gt;

&lt;p&gt;But where is the data stored? Data stored using the Web Storage API is stored in an SQLite file in the user's local folder.&lt;/p&gt;

&lt;p&gt;The data stored in &lt;code&gt;localStorage&lt;/code&gt; and &lt;code&gt;sessionStorage&lt;/code&gt; can be accessed anywhere in the application with the JavaScript code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pN1lvcDX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/531e3k6pt9m3g0x9m22l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pN1lvcDX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/531e3k6pt9m3g0x9m22l.png" alt="Keyboard image" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Difference between &lt;code&gt;localStorage&lt;/code&gt; and &lt;code&gt;sessionStorage&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The Web Storage API has two data storage functions, &lt;code&gt;localStorage&lt;/code&gt; and &lt;code&gt;sessionStorage&lt;/code&gt;, the main difference between the two being that localStorage remains stored in the browser until it is deleted (it can also be permanent). However, SessionStorage is only stored until the user closes the browser. SessionStorage is a useful thing if you want to save some value in a browser instead of a cookie.&lt;/p&gt;

&lt;p&gt;In this article, I will focus on &lt;code&gt;localStorage&lt;/code&gt;, but almost all functions and features are the same as &lt;code&gt;sessionStorage&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;LocalStorage&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;LocalStorage, as I mentioned earlier, stores data in key-value format.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;localStorage&lt;/code&gt; knows five main functions that can be used anywhere within the application.&lt;/p&gt;

&lt;p&gt;These features are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;setItem()&lt;/code&gt;, the function allows us to store values in &lt;code&gt;localStorage&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;getItem()&lt;/code&gt;, allows us to retrieve a specific value from &lt;code&gt;localStorage&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;removeItem()&lt;/code&gt;, the function allows us to remove key with value from &lt;code&gt;localStroage&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;clear()&lt;/code&gt;, the function clears all &lt;code&gt;localStorage&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;key()&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;setItem()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With this feature, we can store the value in our localStorage.&lt;/p&gt;

&lt;p&gt;Using the feature is very simple. The function accepts two parameters, the first is the key and the second is the value of this key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;key&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;localStorage&lt;/code&gt; we can store different data types such as string, int, bool, object…&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;JSON.stringify&lt;/code&gt; function allows us to save a JSON object to &lt;code&gt;localStorage&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;12345&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John Doe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;john.doe@example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;getItem()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With this function, we can get the value stored in &lt;code&gt;localStorage&lt;/code&gt;. The function accepts one parameter, which is the value we want to get from memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getItem&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function will return a string with the value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"{" id ": 12345," name ":" John Doe "," email ":" john.doe@example.com "} '
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since such a string cannot be used in our application, it must be returned to the JSON object. This is done with the &lt;code&gt;JSON.parse()&lt;/code&gt; function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;removeItem()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;removeItem()&lt;/code&gt; function is used to remove only one element from localStorage.&lt;/p&gt;

&lt;p&gt;The function accepts only one parameter and that is the name of the key we want to remove from &lt;code&gt;localStorage&lt;/code&gt;. Removes the item if the key exists.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;removeItem&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;clear()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the &lt;code&gt;clear()&lt;/code&gt; function, we remove all elements in &lt;code&gt;localStorage&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The function does not accept any parameters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h3&gt;
  
  
  Disadvantages of &lt;code&gt;localStorage&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Everything has its drawbacks and so does &lt;code&gt;localStorage&lt;/code&gt;, one of the biggest is limiting the amount of data we can store to 5 MB.&lt;/p&gt;

&lt;p&gt;Another drawback is that &lt;code&gt;localStorage&lt;/code&gt; is synchronous, which means that items can be accessed gradually.&lt;/p&gt;




&lt;p&gt;I hope I have introduced you to how we can store data in a browser in a different way.&lt;/p&gt;

&lt;p&gt;Let's connect:&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://twitter.com/Patik123_"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://instagram.com/patik_123_"&gt;Instagram&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://github.com/patik123"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://polywork.com/patik123"&gt;PolyWork&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>SQL vs. NoSQL</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Fri, 13 May 2022 10:12:48 +0000</pubDate>
      <link>https://dev.to/patik123/sql-vs-nosql-59jf</link>
      <guid>https://dev.to/patik123/sql-vs-nosql-59jf</guid>
      <description>&lt;p&gt;In my previous article about &lt;a href="https://blog.thepatik.com/what-is-crud"&gt;what CRUD is&lt;/a&gt;, I also discussed that a part of any application is a database.&lt;/p&gt;

&lt;p&gt;Today, a database is almost necessary for every application, because it allows us to store different data.&lt;/p&gt;

&lt;p&gt;Databases can be relational or non-relational, they can be accessed via the Internet and the Internet, or they can be local on a local device.&lt;/p&gt;

&lt;p&gt;Today, I will walk between relational and non-relational databases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relational Databases (SQL)
&lt;/h2&gt;

&lt;p&gt;Relational databases are the most used databases. Data in these databases are stored in tables and rows.&lt;/p&gt;

&lt;p&gt;The relational database is like Excel worksheets.&lt;/p&gt;

&lt;p&gt;Relational databases have better readable data than non-relational databases because they have very structured data.&lt;/p&gt;

&lt;p&gt;For creating queries in those databases is used an existing language called SQL is.&lt;/p&gt;

&lt;p&gt;Advantages of relational database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Great choice for structured data&lt;/li&gt;
&lt;li&gt;Great choice for demanding queries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The biggest drawback of a non-relational database is the inability to dynamically change the schema. After all, if we want to add a new attribute to a relational database, this will affect the entire database.&lt;/p&gt;

&lt;p&gt;At the same time, compared to non-relational databases, they need more time to execute and search for data.&lt;/p&gt;

&lt;p&gt;Some relational databases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.mysql.com"&gt;MySQL&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://mariadb.org"&gt;MariaDB&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.postgresql.org"&gt;PostgreSQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.microsoft.com/en-us/sql-server/sql-server-2019"&gt;Microsoft SQL-Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.sqlite.org/index.html"&gt;SQLite&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cgusC8eq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/970iv1p7iamlva1e8oe7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cgusC8eq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/970iv1p7iamlva1e8oe7.png" alt="Server" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Non-relational databases (NoSQL)
&lt;/h2&gt;

&lt;p&gt;Non-relational databases contain unstructured, structured or structured data, usually in a key-value pair.&lt;/p&gt;

&lt;p&gt;The big advantage of those databases is the option of being very flexible. This allows you to quickly add new attributes which do not impact the full database. &lt;/p&gt;

&lt;p&gt;The advantage of such a database is that we can store a lot of data in one table.&lt;/p&gt;

&lt;p&gt;The non-relational database is faster than the relational sub-database.&lt;/p&gt;

&lt;p&gt;The disadvantage of such a database is that each has its own method of making queries for managing data in the database.&lt;/p&gt;

&lt;p&gt;Some non-relational databases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.mongodb.com"&gt;MongoDB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://redis.io"&gt;Redis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.couchbase.com"&gt;Couchbase&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I can figure out that relational databases are the best option in an application that had structured data and we want to have them portable and an option for use in different infrastructures. But, a lot of companies still use relational databases.&lt;/p&gt;

&lt;p&gt;But non-relational databases get the most out when we start creating a project and want to have a lot of flexibility. Also, the non-relation database is great if we store a huge amount of data. &lt;/p&gt;




&lt;p&gt;If you like reading what I write, you can donate me a cup of coffee or start following me on Twitter(&lt;a href="https://twitter.com/Patik123_"&gt;@Patik123_&lt;/a&gt;).&lt;/p&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why is an SSL certificate important?🔐</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Tue, 05 Apr 2022 09:27:59 +0000</pubDate>
      <link>https://dev.to/patik123/why-is-an-ssl-certificate-important-27jl</link>
      <guid>https://dev.to/patik123/why-is-an-ssl-certificate-important-27jl</guid>
      <description>&lt;p&gt;A few days ago, I got a question from a colleague about why we need to have an SSL certified website nowadays.&lt;/p&gt;

&lt;p&gt;I answered, “It's because you see the green lock in your browser,” off the top of my head. However, because I am the type of person who isn't pleased with such a response, I began my research. This is how the idea for this article came.&lt;/p&gt;

&lt;p&gt;The SSL certificate allows us to have an encrypted connection on the HTTP protocol used to transfer the server's web pages to the browser.&lt;/p&gt;

&lt;p&gt;With an SSL certificate, we prevent anyone from intercepting or accessing confidential data on the network as such (bank card numbers or passwords from web applications).&lt;/p&gt;

&lt;p&gt;Because Google decided in 2018 to penalize all sites without an SSL certificate, indicating that the site is not secure is a must-have today.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8EbPUGYz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f63nohqj5mk0lzoep7j9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8EbPUGYz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f63nohqj5mk0lzoep7j9.png" alt="Computer" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What types of SSL do we know?
&lt;/h1&gt;

&lt;p&gt;We know three types of certificates, but they have different levels of authentication.&lt;/p&gt;

&lt;h3&gt;
  
  
  Domain Certificate
&lt;/h3&gt;

&lt;p&gt;The domain certificate is one of the most common certificates in the world. It is also the cheapest, you can also get it for free.&lt;/p&gt;

&lt;p&gt;When issuing a certificate, only domain ownership is verified. The disadvantage of these certificates is that they do not protect subdomains, but only domains.&lt;/p&gt;

&lt;h3&gt;
  
  
  Business certificate
&lt;/h3&gt;

&lt;p&gt;The business certificate has a medium level of trust, as it verifies domain ownership and the company that owns the domain when issuing the certificate. Business certificates are used by companies, non-profit organizations and governments, as they want to show that they are on the correct site of the company.&lt;/p&gt;

&lt;h3&gt;
  
  
  Extended SSL Certificates (EV SSL)
&lt;/h3&gt;

&lt;p&gt;Extended SSL certificates offer the highest level of trust. The issuing process also to verification, domain and company, ensuring that the connection between the server and the browser is encrypted.&lt;/p&gt;

&lt;p&gt;In the address bar, it shows the company name in addition to the lock and HTTPS tag.&lt;/p&gt;

&lt;p&gt;We also know three types of certificates, which differ in how many domains we can use.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wildcard SSL Certificates
&lt;/h3&gt;

&lt;p&gt;Wildcard certificates are alternate certificates and are issued to only one domain and allow installation on different subdomains. For example, if a certificate is issued for &lt;a href="http://example.com"&gt;example.com&lt;/a&gt;, you can also install it on &lt;a href="http://blog.example.com"&gt;blog.example.com&lt;/a&gt; and &lt;a href="http://mail.example.com"&gt;mail.example.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The advantage is that we can protect multiple subdomains with one certificate instead of buying each subdomain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-domain SSL certificates
&lt;/h3&gt;

&lt;p&gt;Multi-domain certificates allow you to connect multiple domains under one SSL certificate. It is used when a company has several domains and wants to protect several domains with one certificate. Up to 100 domains can be protected by one SSL certificate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Single domain SSL certificates
&lt;/h3&gt;

&lt;p&gt;Single-domain certificates are intended and issued for only one domain. This means that they cannot be used for subdomains such as blog.example.com and mail.example.com if is a certificate issued for example.com.&lt;/p&gt;

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

&lt;h1&gt;
  
  
  Benefits of SSL Certificates
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Data encryption
&lt;/h3&gt;

&lt;p&gt;In the first place, the SSL certificate encrypts the connection between the user and the server, thus preventing any data from being read during the transfer.&lt;/p&gt;

&lt;p&gt;If you have an online store, and you are transferring personal data, the security of your visitors must be paramount, so you must install the certificate. &lt;/p&gt;

&lt;p&gt;This also gains the additional trust of your visitors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Confirm identity
&lt;/h3&gt;

&lt;p&gt;With an SSL certificate, you not only protect visitors but also prove that you own the site. This gains the trust of visitors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Increases SEO of the site
&lt;/h3&gt;

&lt;p&gt;It has been proven that using SSL certification increases the SEO of your website. With an SSL certificate, your site will be ranked higher among the hits in the browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  Speed up our website
&lt;/h3&gt;

&lt;p&gt;The SSL certificate allows the use of the HTTP/2 protocol, which reduces and speeds up our site as the protocol compresses the request heads.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bh3ccodk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5yd6ri8406rh3x0zjvlx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bh3ccodk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5yd6ri8406rh3x0zjvlx.png" alt="Computer" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What is the difference between a free and paid SSL certificate?
&lt;/h1&gt;

&lt;p&gt;Some providers such as Let’s Encrypt offer free domain certificates. Why do half the other providers offer paid certificates if I can get a certificate for free?&lt;/p&gt;

&lt;p&gt;The difference is that both certificates provide data encryption but, the difference is in the extra trust of the users.&lt;/p&gt;

&lt;p&gt;If you have one blog in WordPress or another CMS then free SSL is enough, but if you accept payments or run an online store then it is wise to buy an SSL certificate.&lt;/p&gt;

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

&lt;p&gt;I hope I have introduced you to what SSL certificates exist and how they help today.&lt;/p&gt;




&lt;p&gt;Let's connect&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://twitter.com/Patik123_"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://instagram.com/patik_123_"&gt;Instagram&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://github.com/patik123"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://polywork.com/patik123"&gt;PolyWork&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By the way, I love coffee.&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/patik123"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n7XsGLsY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" alt="Buy Me A Coffee" width="545" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>security</category>
    </item>
    <item>
      <title>What is CRUD?</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Fri, 25 Mar 2022 12:25:20 +0000</pubDate>
      <link>https://dev.to/patik123/what-is-crud-1meh</link>
      <guid>https://dev.to/patik123/what-is-crud-1meh</guid>
      <description>&lt;p&gt;We interact with the CRUD application daily as part of our work. Maybe you record a task in your phone's calendar or take notes.&lt;/p&gt;

&lt;p&gt;CRUD is the acronym for Create, Read, Update, and Delete. Any program's basic operations are known as CRUD.&lt;/p&gt;

&lt;p&gt;The CRUD application consists of three key components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database&lt;/li&gt;
&lt;li&gt;User interface&lt;/li&gt;
&lt;li&gt;API or back-end system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The database is used to store data. A relational (SQL) or non-relational (NoSQL) database can be used. In most CRUD applications, relational databases are used. MySQL, MariaDB, PostgreSQL, and MS SQL are some of the most popular relational databases.&lt;/p&gt;

&lt;p&gt;User Interface (UI) display data in a user-friendly format. With the user interface, the user makes API calls.&lt;/p&gt;

&lt;p&gt;The API or back-end system communicates between the database and the user interface. It contains functions for performing CRUD operations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BKWaa0mC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3flyokxpq8k2ihelak8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BKWaa0mC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3flyokxpq8k2ihelak8.jpg" alt="Computer" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CRUD operations
&lt;/h2&gt;

&lt;p&gt;We know four different CRUD operations: create, read, update and delete. Each of these operations has its function in the SQL programming language.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CREATE&lt;/th&gt;
&lt;th&gt;INSERT&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;READ&lt;/td&gt;
&lt;td&gt;SELECT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UPDATE&lt;/td&gt;
&lt;td&gt;UPDATE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DELETE&lt;/td&gt;
&lt;td&gt;DELETE&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;API requests can use different HTTP methods.&lt;/p&gt;

&lt;p&gt;We know different HTTP methods such as POST, GET, PETCH, PUT, DELETE. Each letter of the CRUD can be associated with a specific HTTP method.&lt;/p&gt;

&lt;p&gt;These are usually:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CREATE&lt;/th&gt;
&lt;th&gt;POST&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;READ&lt;/td&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UPDATE&lt;/td&gt;
&lt;td&gt;PUT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DELETE&lt;/td&gt;
&lt;td&gt;DELETE&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The create operation allows us to create new rows in the database.&lt;/p&gt;

&lt;p&gt;The read operation retrieves data from the database. It can return different data to us, depending on the filters created.&lt;/p&gt;

&lt;p&gt;The update operation updates the existing data in the table. We can update only one line in or even more lines at a time.&lt;/p&gt;

&lt;p&gt;The delete operation allows us to delete a row in the database.&lt;/p&gt;

&lt;p&gt;Some CRUD application ideas&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To-Do list&lt;/li&gt;
&lt;li&gt;library system,&lt;/li&gt;
&lt;li&gt;account management system&lt;/li&gt;
&lt;li&gt;notebook&lt;/li&gt;
&lt;li&gt;contact manager&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you have got an idea of what CRUD is and how we use it daily.&lt;/p&gt;




&lt;p&gt;You can start following me on &lt;a href="https://twitter.com/Patik123_"&gt;Twitter&lt;/a&gt;, or you can &lt;a href="https://www.buymeacoffee.com/patik123"&gt;buy me a cup of coffee☕&lt;/a&gt; if you enjoy it.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Is a progressive web application the future?</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Mon, 21 Feb 2022 20:06:17 +0000</pubDate>
      <link>https://dev.to/patik123/is-a-progressive-web-application-the-future-1h6o</link>
      <guid>https://dev.to/patik123/is-a-progressive-web-application-the-future-1h6o</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Time is money.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Today, we want to make as much software as possible with the least amount of effort. Large online stores are developing their own smartphone applications.&lt;/p&gt;

&lt;p&gt;But what are the advantages of a progressive app for a business?&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of a mobile application for business
&lt;/h2&gt;

&lt;p&gt;The great majority of us have a mobile device that we carry with us at all times. We check our e-mails, read the news, and shop online.&lt;/p&gt;

&lt;p&gt;Many larger businesses have developed their own mobile app. Why?&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RKV161Sk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v9wy1cphfmqi0v35zhv1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RKV161Sk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v9wy1cphfmqi0v35zhv1.jpg" alt="Mobile phone" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because the mobile application, among other things, gives consumers more options. It provides us with more opportunities to interact with potential consumers. It provides us with total creative control over our programs.&lt;/p&gt;

&lt;p&gt;Above all, it provides us with unique chances to interact with our consumers.&lt;/p&gt;

&lt;p&gt;A mobile application, on the other hand, is a significant investment for a company. Yes, this is correct, as an application must be developed for at least two separate platforms (Android and iOS).&lt;/p&gt;

&lt;p&gt;This is where a progressive web application may help since it can drastically lower the cost of development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Progressive web application
&lt;/h2&gt;

&lt;p&gt;A progressive web application (PWA) is a hybrid of a web app and a native app.&lt;/p&gt;

&lt;p&gt;A progressive application is made up of a variety of technologies, browser APIs, and multiple processes rather than just one.&lt;/p&gt;

&lt;p&gt;Access to user filesystem, user locations, push notifications, and WebRTC are some of the elements that may be employed in a progressive application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Differences between a progressive web application and a native application
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Progressive Web Application&lt;/th&gt;
&lt;th&gt;Native application&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Programming languages&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;​​Used HTML, JavaScript, CSS&lt;/td&gt;
&lt;td&gt;Objective-C, Swift for iOS and Java, Kotlin for Android&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cost of development&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Low (need only a web developer, updates reach users faster)&lt;/td&gt;
&lt;td&gt;High (different programming languages require different developers)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Distribution&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Via the website (user only needs URL and browser)&lt;/td&gt;
&lt;td&gt;Various app stores (App Store, Huawei App Gallery, Google Play)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Discoverability&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;SEO (application can be found by searching in a search engine - the application is indexed)&lt;/td&gt;
&lt;td&gt;ASO (application can only be detected within the application market)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Security&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Uses HTTPS&lt;/td&gt;
&lt;td&gt;It has more security options than PWA.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The progressive application depends on the browser&lt;/td&gt;
&lt;td&gt;Native applications are faster than web applications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Functions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The progressive application cannot use all the features of the phone&lt;/td&gt;
&lt;td&gt;Native app has access to all phone features and deeper access.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;When we have a small budget to work with and we don't have any demanding components in the program, a progressive application pays off to create.&lt;/p&gt;

&lt;p&gt;However, we start constructing a native application when we require more sophisticated features with access to the user's device's native capabilities, and we need more complicated user apps if we want to have more security functions or start producing games.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9jVL59GU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eee1jt1hmqglk4hkq9dl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9jVL59GU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eee1jt1hmqglk4hkq9dl.jpg" alt="Computer dark" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Progressive apps, in my view, will become more common in the near future since they minimize the cost of developing a mobile app for a firm and because each browser adds new capabilities every day.&lt;/p&gt;

&lt;p&gt;Let's connect&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://twitter.com/Patik123_"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://instagram.com/patik_123_"&gt;Instagram&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹&lt;a href="https://github.com/patik123"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By the way, I love coffee.&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/patik123"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n7XsGLsY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" alt="Buy Me A Coffee" width="545" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>pwa</category>
    </item>
    <item>
      <title>How to bypass CAPTCHA?</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Mon, 07 Feb 2022 12:01:17 +0000</pubDate>
      <link>https://dev.to/patik123/how-to-bypass-captcha-575j</link>
      <guid>https://dev.to/patik123/how-to-bypass-captcha-575j</guid>
      <description>&lt;p&gt;Nowadays, almost every time we send a form, we are forced to solve a minor challenge. For many, this is a very annoying task. Well, here is the solution for those of us who hate saving CAPTCHA.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is CAPTCHA, and how does it work?
&lt;/h2&gt;

&lt;p&gt;CAPTCHA (Completely Automated Public Turing Test to Tell Computers and Humans Apart) is a challenge that prevents computers from submitting forms that are not planned for them. &lt;/p&gt;

&lt;p&gt;CAPTCHA tests can only be solved by humans, in theory. CAPTCHAs are becoming more and more complex as computers become more powerful and capable of recognizing characters (unfortunately).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are CAPTCHA's weaknesses?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's often impossible to figure out what's on the Captcha test&lt;/li&gt;
&lt;li&gt;Some CAPTCHAs aren't compatible with all browsers&lt;/li&gt;
&lt;li&gt;Tests make website visitors feel uncomfortable&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://2captcha.com"&gt;2Captcha&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://2captcha.com"&gt;2Captcha&lt;/a&gt; is an image and CAPTCHA recognition service. 2Captcha's main purpose is for workers to solve CAPTCHA fast and correctly.&lt;br&gt;
&lt;a href="https://2captcha.com"&gt;2Captcha&lt;/a&gt; allows you to solve almost all CAPTCHAs currently in use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wsfkopUF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v1t2ajc0gr2ss5cynshy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wsfkopUF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v1t2ajc0gr2ss5cynshy.png" alt="2Captcha main webpage" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  2Captcha Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;High level of accuracy&lt;/li&gt;
&lt;li&gt;CAPTCHA resolution speed—around 12 seconds&lt;/li&gt;
&lt;li&gt;Numerous APIs and SDKs for practically all programming languages&lt;/li&gt;
&lt;li&gt;Nearly 100% rescue assurance&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
  
  
  How to use JavaScript to solve the CAPTCHA test?
&lt;/h1&gt;

&lt;p&gt;Before we begin, we must first obtain the API key. It's available through the 2Captcha control panel. We create a user account if we haven't already done so before receiving the API key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kul-CD6a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/atjgvorps1iqpi2e2j0y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kul-CD6a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/atjgvorps1iqpi2e2j0y.png" alt="2Captcha dashboard" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we'll make a basic communication form. The user must complete the CAPTCHA test generated by the backend before submitting the message.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://drive.google.com/file/d/1Fg0aU1FIQdeD_poCRy4rLMVUnu6k2dtu/view?usp=sharing"&gt;This link&lt;/a&gt; will take you to the complete source code. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How our site works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We make a request to 2Captcha to save CAPTCHA built with our backend when we push the solution button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wMVNk2-6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ki9qt8fm13nsv8loiiv6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wMVNk2-6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ki9qt8fm13nsv8loiiv6.png" alt="Our example page" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We won't be using the CAPTCHA auto-solve button in real life, of course. The goal of this example is to demonstrate how 2Captcha solves CAPTCHA.&lt;/p&gt;

&lt;p&gt;Our JavaScript code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Captcha&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;&amp;lt;https://cdn.skypack.dev/2captcha&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;solver&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Captcha&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Solver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;YOUR API KEY&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getBase64Image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;canvas&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;dataURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toDataURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image/png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;dataURL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/^data:image&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;png&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nx"&gt;jpg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="nx"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sr"&gt;/, ""&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;refreshButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;refresh-captcha&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;captchaImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image-captcha&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;solveButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;solve&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;token&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;refreshButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onclick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;captchaImage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;captcha/image.php?&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;now&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;solveButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onclick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;solver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;imageCaptcha&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;getBase64Image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;captchaImage&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;base64&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code makes use of the JavaScript package 2Captcha, which handles all aspects of sending and receiving the 2Captcha API answers. The library's documentation &lt;a href="https://github.com/furry/2captcha#readme"&gt;may be found here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;CAPTCHA solving demonstration&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C64Q4bpO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k8wyy63j80344cjjyejt.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C64Q4bpO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k8wyy63j80344cjjyejt.gif" alt="demo" width="770" height="818"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus 🤑
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://blog.thepatik.eu.org/how-to-make-money-as-a-programmer-in-a-simple-way"&gt;In one of my previous posts&lt;/a&gt;, I looked at easy ways for us to make money. We may now add another choice. This one is accomplished by saving CAPTCHA. Starting at $0.50 per hour, you can make (maybe more). Before you begin solving CAPTCHAs, you must first complete a 10-minute training session about how to solve a CAPTCHA. This is to avoid numerous CAPTCHA being lost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;2Captcha helps us to solve CAPTCHA for us automatically.&lt;br&gt;
If we don't want to mess around with the API, there is a free Chrome plug-in that will solve all CAPTCHA checks for us without any further setups. You can download the plug-in at the following link: &lt;a href="https://chrome.google.com/webstore/detail/2captcha-solver/ifibfemgeogfhoebkmokieepdoobkbpo"&gt;2Captcha Solver&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s connect&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/Patik123_"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/patik123"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.polywork.com/patik123"&gt;PolyWork&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/patik123"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n7XsGLsY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" alt="Buy Me A Coffee" width="545" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Find A reason why to write a blog📚</title>
      <dc:creator>Patrick</dc:creator>
      <pubDate>Fri, 21 Jan 2022 18:37:34 +0000</pubDate>
      <link>https://dev.to/patik123/find-a-reason-why-to-write-a-blog-4p12</link>
      <guid>https://dev.to/patik123/find-a-reason-why-to-write-a-blog-4p12</guid>
      <description>&lt;p&gt;Many people have asked me why I started writing a blog when I first began doing so. For me, the motivation was that I enjoy sharing my knowledge with people and want to demonstrate what I know and can accomplish in some way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to change the world, pick up your pen and write. - Martin Luther&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Many computer science students struggle to explain themselves, and by that, I don't mean in a professional manner, but rather in a way that the general reader can understand what they're trying to say. &lt;/p&gt;

&lt;p&gt;I'm aware that this is a challenging assignment. However, we can enhance this by writing articles. &lt;/p&gt;

&lt;p&gt;Blogging has the added benefit of allowing us to learn a language by writing in it. It increases our visibility in the computer world (many people say that when he started writing a blog, he got more job offers than before writing). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LgY-mtBG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4451y8qell718jj11f73.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LgY-mtBG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4451y8qell718jj11f73.png" alt="Paper" width="800" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It enables us to track our progress. In a sense, we're demonstrating what we know and can do, since if we want to write a good post, we need to know what we're talking about.&lt;/p&gt;

&lt;h2&gt;
  
  
  How?
&lt;/h2&gt;

&lt;p&gt;You just take a pen and paper (or a computer and Word; I prefer Notion) and begin writing (typing) about the subject we wish to share.&lt;/p&gt;

&lt;p&gt;Well, sessions aren't so simple because you're instantly troubled by ideas of what others will think about it, and this article, in my opinion, isn't worth addressing...&lt;/p&gt;

&lt;p&gt;The first lesson I learned about writing is that we should write for ourselves, not for others. There would be fewer overall bloggers than there are today if everyone dealt with these difficulties.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where?
&lt;/h2&gt;

&lt;p&gt;When it comes to launching a blog, you have two options: utilize a specialized writing platform or get your own domain and web hosting and start from scratch.&lt;/p&gt;

&lt;p&gt;Both solutions have advantages and disadvantages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using a platform&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are familiar with a number of platforms on which we can publish our blog posts. &lt;a href="https://medium.com"&gt;Medium&lt;/a&gt;, &lt;a href="https://dev.to"&gt;DevTo&lt;/a&gt;, and &lt;a href="https://hashnode.com/@patik123/joinme"&gt;Hashnode&lt;/a&gt; are a few of them...&lt;/p&gt;

&lt;p&gt;All of these platforms allow other people who are interested in the topic to see our articles.&lt;/p&gt;

&lt;p&gt;Because all platforms are quite popular, your posts have a good chance of being discovered by a large number of people.&lt;/p&gt;

&lt;p&gt;Most platforms are SEO-friendly, helping search engines such as Google and Bing to rank that content higher. However, the platform's most important features are generally free of charge.&lt;/p&gt;

&lt;p&gt;I would recommend &lt;a href="https://hashnode.com/@patik123/joinme"&gt;Hashnode&lt;/a&gt; as a fantastic platform for creating articles because it is quite adaptable. It's definitely worth a look. We can use our own domain with a free SSL certificate provided by this platform, and we can basically set up a totally personal blog.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setup own blog&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;However, if we choose the first choice, we will have a lot more work to do. We must first purchase a domain (Hashnode and Medium provide a free subdomain), and then we must pay for site hosting. After we've completed this, we'll need to pick which CMS we'll utilize (WordPress, Jommla ...) or create our own platform for writing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0aVQAB7y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qnylu65fnfko7hyg5ybe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0aVQAB7y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qnylu65fnfko7hyg5ybe.png" alt="WordPress" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we've got a basic blog up and running, it's time to start attracting readers. In my experience, it gets stuck here since fresh blogs are hard to come by.&lt;/p&gt;

&lt;p&gt;The benefit of creating our own blog from the scratch is that we are not limited by settings and also can customize it to our taste.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of blog writing
&lt;/h2&gt;

&lt;p&gt;Many people have negative attitudes toward writing and reading. Each day, though, we write and read. Do you ever write down a task on a piece of paper? Do you create your shopping list by hand? However, we read at every turn. As a result, I don't see why you shouldn't start a blog.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ug6-mmvL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mwjc7ldwfxw4wxi58nip.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ug6-mmvL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mwjc7ldwfxw4wxi58nip.png" alt="Pen" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We could not only help people by writing a blog, but we can also demonstrate our skills to potential employers.&lt;/p&gt;

&lt;p&gt;Since starting the blog, I've received several invitations to participate and contribute to various platforms.&lt;/p&gt;

&lt;p&gt;Since starting my blog, I've begun utilizing a lot more social media platforms. At the same time, I recognized that, if we knew how to utilize social media correctly, we can harness immense potential.&lt;/p&gt;

&lt;p&gt;Individuals who have read my writings continue to inspire me to write all of their postings. &lt;/p&gt;

&lt;p&gt;Several companies nowadays value good product documentation. With a blog, we may demonstrate that we can write on a specific topic.&lt;/p&gt;

&lt;p&gt;At the same time, writing a blog can make money in a very simple way. Some additional ideas in the article How to make money as a blogger the easy way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;All it takes is the desire to create a blog for every one of us. This may most likely appear to be a pointless task at first, but with time and dedication, it will become simpler and, most likely, profitable.&lt;/p&gt;




&lt;p&gt;You can start following me on &lt;a href="https://twitter.com/Patik123_"&gt;Twitter&lt;/a&gt;, or you can &lt;a href="https://www.buymeacoffee.com/patik123"&gt;buy me a cup of coffe☕&lt;/a&gt; if you enjoy it.&lt;/p&gt;

</description>
      <category>writing</category>
      <category>blog</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
