<?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: Boris</title>
    <description>The latest articles on DEV Community by Boris (@bokub).</description>
    <link>https://dev.to/bokub</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%2F246106%2Faaf6ec8a-9161-4853-9c34-04f451c3139f.png</url>
      <title>DEV Community: Boris</title>
      <link>https://dev.to/bokub</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bokub"/>
    <language>en</language>
    <item>
      <title>How to properly set up Prettier in less than 2 minutes</title>
      <dc:creator>Boris</dc:creator>
      <pubDate>Mon, 20 Jun 2022 07:17:02 +0000</pubDate>
      <link>https://dev.to/bokub/how-to-properly-set-up-prettier-in-less-than-2-minutes-2ld0</link>
      <guid>https://dev.to/bokub/how-to-properly-set-up-prettier-in-less-than-2-minutes-2ld0</guid>
      <description>&lt;blockquote&gt;
&lt;h3&gt;
  
  
  My step-by step guide to set up Prettier in any project, and integrate it with ESLint and Git Hooks
&lt;/h3&gt;
&lt;/blockquote&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%2F3icljjf5ueqz73smmex6.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%2F3icljjf5ueqz73smmex6.png" alt="@bokub/prettier-config" width="800" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ve been using &lt;a href="https://prettier.io/" rel="noopener noreferrer"&gt;Prettier&lt;/a&gt; for more than 5 years now, and every time I create a new project or join an existing one, I ask myself the same questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How do I install Prettier?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Where should I put my configuration?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Should I add new scripts to my package.json ?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to integrate it with ESLint?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How can I setup Git hooks to ensure the code is always properly formatted?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For many years, every time I had to setup Prettier in a project, I had to read multiple documentation pages, look up tutorials, or dig into my old projects, and this took me so long that one day, &lt;strong&gt;I decided to create my own “step-by-step” guide&lt;/strong&gt;, just for myself.&lt;/p&gt;

&lt;p&gt;After using and updating my guide for 2 years, I finally decided to share it here, so everyone can benefit from it ✨&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;N.B&lt;/strong&gt;: A summary of all the commands used in this guide can be found in my &lt;a href="https://github.com/bokub/prettier-config" rel="noopener noreferrer"&gt;dedicated GitHub repo&lt;/a&gt;, this guide is just here to explain the different steps.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 1: Install Prettier
&lt;/h2&gt;

&lt;p&gt;Installing Prettier can be done with one simple command&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: for each code block in this guide, you can choose between npm and Yarn, depending on what you use in your project.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# With npm&lt;/span&gt;
npm i &lt;span class="nt"&gt;-D&lt;/span&gt; prettier

&lt;span class="c"&gt;# With Yarn&lt;/span&gt;
yarn add &lt;span class="nt"&gt;-D&lt;/span&gt; prettier
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Configure your options
&lt;/h2&gt;

&lt;p&gt;Prettier is installed, you can now configure the format you want to use! A Prettier configuration is nothing more than a set of “options”.&lt;/p&gt;

&lt;p&gt;Note that &lt;strong&gt;this step is totally optional&lt;/strong&gt;, because Prettier is pre-configured with default options that you can use without any additional configuration&lt;/p&gt;

&lt;h3&gt;
  
  
  Method 1: Configure your own options
&lt;/h3&gt;

&lt;p&gt;To add your own options, create a new file called &lt;code&gt;.prettierrc.js&lt;/code&gt; at the root of your project, and add your options using the following format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// .prettierrc.js&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;tabWidth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;singleQuote&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="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;N.B: You can find the list of all available options &lt;a href="https://prettier.io/docs/en/options.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;. The name of each option should be the one from the “API Override” section.&lt;/p&gt;

&lt;h3&gt;
  
  
  Method 2: Use someone else’s options
&lt;/h3&gt;

&lt;p&gt;I personally always use the same options, which are the default ones, plus:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Single quotes instead of double quotes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Max line length: 120 instead of 80&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A indent size of 2 spaces&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some other niche options for .vue files&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to use my set of options, &lt;strong&gt;it’s super easy&lt;/strong&gt;, add the following line to your package.json&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"prettier"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@bokub/prettier-config"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, install my config with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# With npm&lt;/span&gt;
npm i &lt;span class="nt"&gt;-D&lt;/span&gt; @bokub/prettier-config

&lt;span class="c"&gt;# With Yarn&lt;/span&gt;
yarn add &lt;span class="nt"&gt;-D&lt;/span&gt; @bokub/prettier-config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Run prettier on existing code
&lt;/h2&gt;

&lt;p&gt;Now that Prettier is installed and configured, you can actually run it on your existing code to properly format it.&lt;/p&gt;

&lt;p&gt;Just run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx prettier &lt;span class="nt"&gt;--write&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Prettier will replace all your existing code with properly formatted code. You can add this command to a &lt;strong&gt;npm&lt;/strong&gt; script so you can run it when you need to, but I think it’s actually not necessary, because you can do something so much better: &lt;strong&gt;automate it!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check out the next step to see how 😉&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Set up a pre-commit hook (optional)
&lt;/h2&gt;

&lt;p&gt;Running the command from step 3 is easy, but it’s also easy to forget. It can also take a few seconds if your project is very big.&lt;/p&gt;

&lt;p&gt;How to be sure your code is always formatted by everyone working on the project, without slowing the development workflow? Use a &lt;strong&gt;git hook&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;By using &lt;a href="https://github.com/typicode/husky" rel="noopener noreferrer"&gt;&lt;strong&gt;husky&lt;/strong&gt;&lt;/a&gt; and &lt;a href="https://github.com/azz/pretty-quick" rel="noopener noreferrer"&gt;&lt;strong&gt;pretty-quick&lt;/strong&gt;&lt;/a&gt;, you can automatically force every developer to format all the changed files (and nothing more) every time they commit.&lt;/p&gt;

&lt;p&gt;The setup can be a little bit long if you actually read the whole documentation, but here are the commands you need to run to set everything up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# With npm&lt;/span&gt;
npx husky-init
npm i &lt;span class="nt"&gt;-D&lt;/span&gt; pretty-quick
npx husky &lt;span class="nb"&gt;set&lt;/span&gt; .husky/pre-commit &lt;span class="s2"&gt;"npx pretty-quick --staged"&lt;/span&gt;

&lt;span class="c"&gt;# With yarn&lt;/span&gt;
npx husky-init
yarn add &lt;span class="nt"&gt;-D&lt;/span&gt; pretty-quick
yarn husky &lt;span class="nb"&gt;set&lt;/span&gt; .husky/pre-commit &lt;span class="s2"&gt;"npx pretty-quick --staged"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it ! You will now see this kind of message every time you commit something:&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%2Fxp8yxl41v1vqbu27obu7.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%2Fxp8yxl41v1vqbu27obu7.png" alt="Screenshot" width="691" height="233"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5: Setup with ESLint (optional)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The main differences between &lt;strong&gt;Prettier&lt;/strong&gt; and &lt;strong&gt;ESLint&lt;/strong&gt; are the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;ESLint is a &lt;strong&gt;linter&lt;/strong&gt;: it can &lt;strong&gt;detect errors&lt;/strong&gt; in your code and also format your code if you configure it correctly&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prettier is only a code formater, but doesn’t need a configuration to work&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A lot of projects use both a linter and a formater. In this guide, &lt;strong&gt;I won’t explain how to setup ESLint&lt;/strong&gt;, but instead, I’ll show you &lt;strong&gt;how to edit an existing ESLint configuration&lt;/strong&gt; to make it work perfectly with Prettier.&lt;/p&gt;

&lt;p&gt;Start by installing the following dependencies (I suppose you already have installed &lt;strong&gt;ESLint&lt;/strong&gt; 7 or higher):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# With npm&lt;/span&gt;
npm i &lt;span class="nt"&gt;-D&lt;/span&gt; eslint-config-prettier eslint-plugin-prettier

&lt;span class="c"&gt;# With yarn&lt;/span&gt;
yarn add &lt;span class="nt"&gt;-D&lt;/span&gt; eslint-config-prettier eslint-plugin-prettier
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, edit your &lt;strong&gt;ESLint&lt;/strong&gt; configuration file like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Add "prettier" to the list of “plugins”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add "plugin:prettier/recommended" &lt;strong&gt;at the end&lt;/strong&gt; of the list of “extends”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optionally, you can set the error level to warn by adding a new rule as you can see below&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"plugins"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"prettier"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extends"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;some-config&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"plugin:prettier/recommended"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"rules"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prettier/prettier"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"warn"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Following this step-by-step guide should help you configure Prettier properly in only a few minutes, without having to search through the documentation of multiple tools.&lt;/p&gt;

&lt;p&gt;If you prefer, you can also use the “tl;dr” version of this guide which can be found in my &lt;a href="https://github.com/bokub/prettier-config#readme" rel="noopener noreferrer"&gt;dedicated GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hope it helps ! 👍&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to add a login form to any website, without a single line of code</title>
      <dc:creator>Boris</dc:creator>
      <pubDate>Mon, 19 Jul 2021 13:25:29 +0000</pubDate>
      <link>https://dev.to/bokub/how-to-add-a-login-form-to-any-website-without-a-single-line-of-code-39h</link>
      <guid>https://dev.to/bokub/how-to-add-a-login-form-to-any-website-without-a-single-line-of-code-39h</guid>
      <description>&lt;p&gt;Creating a website or an app has never been so easy. There are so many tools and platforms to help you in this journey, with or without code, paid or free, with lots of features to make your life easier.&lt;/p&gt;

&lt;p&gt;With these tools, you can create blogs, e-commerce websites and portfolios in less than a day! However, most of the time, adding a login form to your website quickly becomes a nightmare:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  If you have access to all the code of the website (including the back-end), and if you’re an experienced developer, you can try to code this feature yourself, which will probably take a few weeks, or you can try to integrate an authentication platform, which can be quite complex if it is your first time.&lt;/li&gt;
&lt;li&gt;  If you created and deployed your website on a no-code platform, maybe this platform offers a password protection feature, maybe not!&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Whatever your case may be, &lt;a href="https://octauthent.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Octauthent&lt;/strong&gt;&lt;/a&gt; can probably help you!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Octauthent&lt;/strong&gt; is a simple service that adds login forms on your website
&lt;/h3&gt;

&lt;p&gt;Once installed on  your site, Octauthent provides a dashboard where you can manage users, settings, and analytics.&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%2Fr7i7zz3mx0xnpgz9jsqq.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%2Fr7i7zz3mx0xnpgz9jsqq.png" alt="Dashboard" width="800" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Octauthent can be installed on almost every site or platform, even the most limited ones. In fact, there is &lt;strong&gt;only one requirement&lt;/strong&gt; to use Octauthent on your website: &lt;strong&gt;You need to own the domain name of this website&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If that’s the case, congratulations! Follow the tutorial below, and you’ll have a login form on your website in a few minutes 🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Before we start, how does it work?
&lt;/h2&gt;

&lt;p&gt;To make it very simple, imagine that instead of linking your domain name to your website, you link your domain to a third party service (in our case, Cloudflare), which then redirects all your traffic to your website.&lt;/p&gt;

&lt;p&gt;Not only it makes your website faster (because the Cloudflare network is available on hundred of locations all around the globe), but it can also protect your website from attackers.&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%2F6i4m0mqrwbkz9pguotz2.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%2F6i4m0mqrwbkz9pguotz2.png" alt="With &amp;amp; without Cloudflare" width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, imagine that the third party service not only redirects traffic, but can also block requests and show them a login form instead of your site.&lt;/p&gt;

&lt;p&gt;That’s exactly what &lt;a href="https://octauthent.com/" rel="noopener noreferrer"&gt;Octauthent&lt;/a&gt; does!&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%2F1oz562su4an1iux7p6l9.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%2F1oz562su4an1iux7p6l9.png" alt="With Cloudflare &amp;amp; Octauthent" width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every request to your website domain is intercepted by Cloudflare, and analyzed by Octauthent, which acts like a bouncer. Unauthorized requests are blocked, allowed ones are routed to your site through Cloudflare’s intelligent global network&lt;/p&gt;

&lt;p&gt;Now that you have a better understanding of how it works, let me show you how to set up Cloudflare and Octauthent on your site.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Setup Cloudflare
&lt;/h2&gt;

&lt;p&gt;As explained above, Cloudflare is a company that provides web performance and security services, and is &lt;strong&gt;completely free&lt;/strong&gt; for most users! If you’re not familiar with Cloudflare, here’s a quick list of some benefits you’ll get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;CDN&lt;/strong&gt; — Cloudflare’s content delivery network helps speed up your site by serving your static content from a huge network of global servers. Cloudflare is the most popular free CDN service.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;SSL&lt;/strong&gt; — if your site doesn’t already have an SSL certificate, Cloudflare can help you use HTTPs on your site to get the green padlock in visitors’ browsers&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;DNS&lt;/strong&gt; — Cloudflare is one of the fastest DNS providers, which can speed up your site’s time to first byte (TTFB)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;DDoS protection&lt;/strong&gt; — Cloudflare can help you protect against distributed denial of service (DDoS) attacks. It can also help you just generally filter out malicious traffic&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Other performance benefits&lt;/strong&gt; — Cloudflare can help you minify your code, enable Brotli compression, and implement other performance best practices&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Let’s start
&lt;/h3&gt;

&lt;p&gt;For my example, I’ll use a &lt;strong&gt;WordPress blog&lt;/strong&gt;, which is already working with my custom domain name: &lt;strong&gt;example-blog.ml&lt;/strong&gt;. You can follow the exact same steps with your own domain.&lt;/p&gt;

&lt;p&gt;First, &lt;a href="https://dash.cloudflare.com/sign-up" rel="noopener noreferrer"&gt;create a Cloudflare account&lt;/a&gt;. As soon as you have signed up, Cloudflare will start the installation process.&lt;/p&gt;

&lt;p&gt;Enter your website domain, then choose the free plan (on the bottom). The free plan is &lt;strong&gt;more than enough&lt;/strong&gt; for most website owners, including me.&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%2Fybnwz5sg9knp9gb7kk44.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%2Fybnwz5sg9knp9gb7kk44.png" alt="Free plan" width="800" height="659"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cloudflare will now perform a quick scan to detect your current domain configuration. Accept the recommended settings (unless you know what you’re doing), and click on &lt;strong&gt;Continue&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In order to use Octauthent on a domain or a subdomain, you &lt;strong&gt;must&lt;/strong&gt; have the orange cloud in the “Proxy status” column. In the screenshot below, I’ll be able to install Octauthent on &lt;em&gt;example-blog.ml&lt;/em&gt; and &lt;em&gt;&lt;a href="http://www.example-blog.com" rel="noopener noreferrer"&gt;www.example-blog.com&lt;/a&gt;&lt;/em&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%2Fjuaw0fxzvw1jyprztqfq.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%2Fjuaw0fxzvw1jyprztqfq.png" alt="DNS settings" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In order to finish the installation, Cloudflare will now give you clear instructions about what to do from your registrar account (where you bought your domain name!)&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%2F4hk9gvrs5hc9chf5doxd.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%2F4hk9gvrs5hc9chf5doxd.png" alt="Instructions" width="800" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my case, I log into my registrar account, look for the DNS / nameservers settings, and change them as I’m told. Please note that the user interface may be completely different in your case, because we probably don’t have the same registrar.&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%2Fy80xe9k3fgex37qg5i6t.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%2Fy80xe9k3fgex37qg5i6t.png" alt="DNS" width="800" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, there is one last step: &lt;strong&gt;waiting.&lt;/strong&gt; DNS is a complex matter and there are lots of cache levels, so be patient. You probably need to wait only a few minutes, but in some cases it can be several hours.&lt;/p&gt;

&lt;p&gt;To know if the installation process is finished, refresh the “Overview” tab of your Cloudflare dashboard. If you still see the setup instructions, wait a little bit more. If the installation is finished, you’ll see the following message&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%2Fpowqll3a8h2zds3g7vjk.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%2Fpowqll3a8h2zds3g7vjk.png" alt="Message" width="800" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please note that even after you see this message, you may have to wait a little bit more until your visitors (including you) are actually passing through the Cloudflare network.&lt;/p&gt;

&lt;p&gt;To confirm that Cloudflare is effectively protecting your site, go to:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://[your-domain]/cdn-cgi/trace&lt;/code&gt; using your web browser. In my example: &lt;a href="https://example-blog.ml/cdn-cgi/trace" rel="noopener noreferrer"&gt;&lt;code&gt;https://example-blog.ml/cdn-cgi/trace&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  If you see a black text with your domain in the second line, you’re good to go to the next step!&lt;/li&gt;
&lt;li&gt;  If you see a &lt;strong&gt;404 Not found&lt;/strong&gt; error, a &lt;strong&gt;ERR_SSL_PROTOCOL_ERROR&lt;/strong&gt;, or any other result, wait a little bit more. DNS propagation can take up to 24 hours.&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%2Fxlf11b77n9h4ntjn2wt0.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%2Fxlf11b77n9h4ntjn2wt0.png" alt="CGI trace" width="800" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Install Octauthent
&lt;/h2&gt;

&lt;p&gt;Now that all your traffic is passing through Cloudflare, let’s install Octauthent on it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.octauthent.com/login/" rel="noopener noreferrer"&gt;Sign up to Octauthent&lt;/a&gt;, then click on the &lt;strong&gt;New Site&lt;/strong&gt; button. For each step, answer to the questions, and click &lt;strong&gt;Next.&lt;/strong&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%2Ffa0756fcdjucrkg46haq.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%2Ffa0756fcdjucrkg46haq.png" alt="New site" width="800" height="765"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The last step to create your site will be to choose users and passwords. In my case, I’ll start with only one user: “&lt;em&gt;demo&lt;/em&gt;”, and I’ll set the password to “&lt;em&gt;octauthent&lt;/em&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%2F4heajbhiaa46su5lnldf.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%2F4heajbhiaa46su5lnldf.png" alt="Auth" width="800" height="609"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once your site is created, go to the &lt;strong&gt;Install&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;You will first see a tutorial to create an API Token on your Cloudflare account, just follow the instructions.&lt;/p&gt;

&lt;p&gt;Then, you’ll be asked to choose on which Cloudflare site you want to install Octauthent.&lt;/p&gt;

&lt;p&gt;In my case, I choose the “example-blog.ml” site, which is my example site.&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%2Fqkj5p3gi97k29ckr55te.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%2Fqkj5p3gi97k29ckr55te.png" alt="Cloudflare site" width="800" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, configure which pages will be protected by Octauthent, and which pages will stay public.&lt;/p&gt;

&lt;p&gt;For my example, let’s say I want to protect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  All the &lt;code&gt;wp-admin&lt;/code&gt; pages, which contain the admin part of my WordPress&lt;/li&gt;
&lt;li&gt;  A very private page where I can write private thing. I created a page that can be accessed at &lt;code&gt;example-blog.ml/private-page/&lt;/code&gt; (in my case, there is a trailing slash, but maybe not in yours!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is my config:&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%2Fqfphw850eeavjqfh1w33.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%2Fqfphw850eeavjqfh1w33.png" alt="Routes" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the &lt;strong&gt;install&lt;/strong&gt; button, wait a few seconds and the Octauthent login form should appear on your website in the next minute! That’s it!&lt;/p&gt;




&lt;p&gt;I hope you enjoyed this tutorial, don’t hesitate to comment if you think it can be improved&lt;/p&gt;

&lt;p&gt;Also, Octauthent is still very new and in active development. Don’t hesitate to tell me what you think about it and how it could be improved.&lt;/p&gt;

&lt;p&gt;Have a nice day 👍&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>security</category>
      <category>saas</category>
      <category>cloud</category>
    </item>
    <item>
      <title>How I made a Pastebin clone with NO database and NO back-end code</title>
      <dc:creator>Boris</dc:creator>
      <pubDate>Fri, 29 May 2020 15:46:32 +0000</pubDate>
      <link>https://dev.to/bokub/how-i-made-a-pastebin-clone-with-no-database-and-no-back-end-code-ffp</link>
      <guid>https://dev.to/bokub/how-i-made-a-pastebin-clone-with-no-database-and-no-back-end-code-ffp</guid>
      <description>&lt;p&gt;Hello everyone !&lt;/p&gt;

&lt;p&gt;I'd like to show you the project I've been working on for the last few weeks, which is, as said in the title, a &lt;strong&gt;client side&lt;/strong&gt; paste service, called NoPaste.&lt;/p&gt;

&lt;h4&gt;
  
  
  What does it mean exactly? Let's take a simple example
&lt;/h4&gt;

&lt;p&gt;When you share a piece of code on Pastebin, your data is saved somewhere in a database, then Pastebin gives you a short link to access this data&lt;/p&gt;

&lt;p&gt;NoPaste has a different approach: instead of using a database, your data is compressed then stored into a unique URL that can be shared and decoded later. &lt;/p&gt;

&lt;p&gt;As a result, there is no risk of data being lost, censored or deleted. The data is stored entirely &lt;strong&gt;in the links&lt;/strong&gt; and nowhere else!&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%2Frzs0vzzfds0vgl2kk8bl.gif" 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%2Frzs0vzzfds0vgl2kk8bl.gif" width="252" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Here are a few examples so you can see it in action:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://nopaste.ml/?l=css#XQAAAQB2DQAAAAAAAAAXioAj/ZZaukKWizx++f8w08qY+xe+w0AeNB0EtEDMR1jPECOrMSz2rcy5XqUVTzusmFXo407ujwufsB1Va3cy02BV4Chx15I+SbM8Ei2WS8/MaZa0wIOjHf0s6B9Kcwi1J73qYeIcKm39PEWGnBM4Ym5aXFOF1Irrn1N95vEcl4YI+98rydudZHmsNCmt995GvCpLImwH7yj3SlMadWaQA0jHCrY1ZBvhjSJ9mAAdYjCJLduITZuXomgpqtr3sYI1WKeRGNmPSD8J8WRLtCx0BZl3yWZZrUxJbmVod8cYiPJnlO+CzQA03qA/GZnxhMYd9TPc2Xlq8UIhBX6gmvo/xhHJc/WHnuBFB32xJ37O5FZlZuXGy6wFE/lakVteoqEqgvyan4LfaiL0pMfYapWjV8YoPa/KyVGugANNjvtRw0hRr+Z1IgKoVL2a1xqvQiB65vIXkw68/ui82O1ko9HTbsLMHX/2/CgWZ8TkTEvgr0+dzVqQYIpaWpB3hDnUTHMkG2UehM5iJyJXAgODNqk8IiWCJn5k/j2FeFpchSTWdgi7AeaCowubmWnFTNgNFXLf5zzARWBUGQFT55T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noreferrer"&gt;This code&lt;/a&gt; is the CSS code used on the NoPaste page. &lt;br&gt;
It has &lt;strong&gt;more than 3400 characters&lt;/strong&gt;, but thanks to the compression, the link to access it has a length of 1710 characters.&lt;/p&gt;

&lt;p&gt;Want something more impressive?&lt;br&gt;
What about &lt;a href="https://nopaste.ml/?l=css#XQAAAQB3CQEAAAAAAAAXioBCwZsoQnbcR/xeXm9V/v7QJsB0UYWtWtct2khBVRSIBy+TeEQlF8baOy5+Dlx1XDTAK5Fo+dS1EvIyCUMMZGIsG52GmA/azqqva6+uP5BfX4P8gWxWLBpOg5kHEop1ywD+FHwYNOrEDIYEapcTJHXMpNomkHJtpJZpAtbdQBA7cSlN9Pd+Klagn1AQbtD1o+kXno0GDptLbfjc00kDB9ZyUeT/IvhNiQMCwswZcBWEQyb43IWS8t9j9EHaRDzsrApw1bNpx6c2lMupmEk6nJhNZitpp+/U2/9uQ/nLMwpBp7oXOY2IskSWkLaIyiUt0VePfpF1QAtTiFfjVJ0CL0Q3mDVhSBYgc52FM40DTPTwQKCQ6xcyxrdIVG4kd2BsNWwfb0Kuul4xgUTt9TcQtFbWGiw6wh07obv+gY9X49tPr6HQ/lF8OrMZJKZb98BwLHlsl7KQTfq1pdsH7zJXyf2tXlFlSUJvWWYo1boly0aalUASecFoTd4JdYPy/Il7S/BwcTjvn1crFes48qOs+gq+WqDFUK0Y4nv9issVNrepbsizuhRTsm8FXpB4mY8qwGvLfGPwGBfKV01QG/pPaGWbn0qLANaofIMSyGE5Pk32C6CY+h62GAwvEPtQhdumRMm7PrGng6VLHTbT05cNRacKt7sSGyvZL6W17I6EEvNC+fDISkkPvHr8C5gZ4phiGe7SFntFYsAX7nlkP/ftfHRA7RvjzUU0GghLbi8u6ferPBXm124exV8NHq5xJTx33XH+ckLgIJ9tjTWgloJ+Nx46kTCPwxiPC4AiQoLAz7LPsbyzOVUwN0HRPKVusW2p4C2ftORZNyX157sUZuASU+Z9Wz2u3tKweTxQxVsU6mI0e8su1eCcJ8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Zva2tye+G/LpgVjZqzqMjNVhEnDzJREmfh0NGdgLJqjj9pfMCrvpHKXrr76RrizNS0zMMp4JJ/mJTacxckO5Z9jf7ciPzvOQL//nxmqlUlXE6qfRg/0ND70W5TZ6VZ8E1BmVGinjts/M0YxL8CPhLnsBGd5qz95JqSAlh+J/GDQywNX1DyLZgr1wBWVx8HMFHorh5RyaVAAZo7aik59eSjlX9KZFuRPnZ2VCm8KLi+c3m9qneDHTD04D4z4ZCp12XUVAyzY4KHb63q2pLlxYIEAVUm64TCYycJnb0vjZwObTHYEyBQXaVLfgS1tCOroDt+jRQAjV06rKWvIpsmiBU6y1IUQ3eAtLLEGRQ/dJiOkL5zg9/SPCuljIaA5YwwuKItUwYG5ByzOQJ6/BkU3B0nJJtmErXEWoxDbt7SKcYLdVAiqeHN0O2Zp/AcFUPTZxFKXGJod0w6ftuBqA0xj+tYd0LlXu7PRIE5KUZDeH0mXFQv4TDgL/rYBf6A==" rel="noopener noreferrer"&gt;the CSS code of the Bootstrap grid system&lt;/a&gt;?&lt;br&gt;
Because there are lots of repetitions, the compression is very efficient: &lt;strong&gt;67959 characters stored in a link that's only 5762 characters&lt;/strong&gt; (compression ratio about 8%)🤯&lt;/p&gt;
&lt;h4&gt;
  
  
  But a link length cannot be infinite! What's the limit?
&lt;/h4&gt;

&lt;p&gt;Well, that's true, in some cases your browser won't support a URL which is too long, but that limit is actually quite high:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Browser&lt;/th&gt;
&lt;th&gt;Max length&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Google Chrome&lt;/td&gt;
&lt;td&gt;(win) 32,779 (mac) 10,000&lt;/td&gt;
&lt;td&gt;Will not display, but larger links work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Firefox&lt;/td&gt;
&lt;td&gt;&amp;gt;64,000&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Microsoft IE 11&lt;/td&gt;
&lt;td&gt;4,043&lt;/td&gt;
&lt;td&gt;Will not show more than 2,083&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Microsoft Edge&lt;/td&gt;
&lt;td&gt;2,083&lt;/td&gt;
&lt;td&gt;Anything over 2083 will fail&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Android&lt;/td&gt;
&lt;td&gt;8,192&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safari&lt;/td&gt;
&lt;td&gt;Lots&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;And here are the link length limits on a few popular apps / sharing methods:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;App&lt;/th&gt;
&lt;th&gt;Max length&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Reddit&lt;/td&gt;
&lt;td&gt;10,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Twitter&lt;/td&gt;
&lt;td&gt;4,088&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Slack&lt;/td&gt;
&lt;td&gt;4,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;QR Code&lt;/td&gt;
&lt;td&gt;2,610&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bitly&lt;/td&gt;
&lt;td&gt;2,048&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h4&gt;
  
  
  You can embed NoPaste snippets in (some) websites
&lt;/h4&gt;

&lt;p&gt;Unfortunately, &lt;code&gt;dev.to&lt;/code&gt; is not one of them, but if you have a personal website, you can easily embed a NoPaste code snippet using the "Embed" button&lt;/p&gt;

&lt;p&gt;The text inside an embed can be highlighted and copied, but not directly edited, unless you click on the "Edit" button. Perfect for tutorials!&lt;/p&gt;

&lt;p&gt;Here is a preview made with jsFiddle:&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/ubhrpf5w/4/embedded/result//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Thanks for reading!
&lt;/h3&gt;

&lt;p&gt;Don't hesitate to star ⭐ my Github repository, and leave comments if you have suggestions or ideas of improvement&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bokub" rel="noopener noreferrer"&gt;
        bokub
      &lt;/a&gt; / &lt;a href="https://github.com/bokub/nopaste" rel="noopener noreferrer"&gt;
        nopaste
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      📋 Client-side paste service
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Thanks again 👍&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>privacy</category>
      <category>webdev</category>
      <category>html</category>
    </item>
  </channel>
</rss>
