<?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: john</title>
    <description>The latest articles on DEV Community by john (@johnbabu021).</description>
    <link>https://dev.to/johnbabu021</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%2F707525%2Fb041a3a1-973c-4e28-b4b5-2a2b0e4908da.jpeg</url>
      <title>DEV Community: john</title>
      <link>https://dev.to/johnbabu021</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/johnbabu021"/>
    <language>en</language>
    <item>
      <title>Rich Text Editor in React.js with more Powerful features</title>
      <dc:creator>john</dc:creator>
      <pubDate>Thu, 11 May 2023 03:41:58 +0000</pubDate>
      <link>https://dev.to/johnbabu021/rich-text-editor-in-reactjs-with-more-powerful-features-1oil</link>
      <guid>https://dev.to/johnbabu021/rich-text-editor-in-reactjs-with-more-powerful-features-1oil</guid>
      <description>&lt;p&gt;I was struggling to implement an editor in my blog Application i have tried ck editor and couple of other editors and most of them are buggy and not working properly and the interface was also not so much good&lt;/p&gt;

&lt;p&gt;Finally I found &lt;a href="https://editorjs.io/"&gt;editor.js&lt;/a&gt;&lt;br&gt;
The best Editor I found Ever&lt;/p&gt;

&lt;h2&gt;
  
  
  Editorjs
&lt;/h2&gt;

&lt;p&gt;It is highly maintanable and you can customize every component inside each data you enter is parsed into json in a block of array each content has it's own type and id &lt;br&gt;
`&lt;br&gt;
[&lt;br&gt;
timestamp:3333,&lt;br&gt;
blocks:[{&lt;br&gt;
content:"This is a Heding",&lt;br&gt;
type:"Heading"&lt;br&gt;
...rest&lt;br&gt;
}]&lt;br&gt;
...rest&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
this is the sample format of data that is getting from the editor&lt;br&gt;
whenever you want to show data in an html page you have to use a parser which we will deeply in the following section&lt;br&gt;
the parser is not fully functional for table and button components this parser will not parse buttons and tables but it won't cause any errors while displaying in html&lt;br&gt;
instead you can create your custom parser i will write the code in the last section how to handle that&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;if the new version of editor.js is not working don't worry about that we will fix that&lt;br&gt;
here i am showing a screenshot of the blog&lt;/p&gt;
&lt;/blockquote&gt;

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

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

&lt;p&gt;This editor can be used to send For multiple purpose here i have created a blog application&lt;/p&gt;

&lt;p&gt;to upload image you must specify some configurations in the file&lt;/p&gt;

&lt;p&gt;`import Embed from "@editorjs/embed";&lt;br&gt;
import Table from "@editorjs/table";&lt;br&gt;
import List from "@editorjs/list";&lt;br&gt;
import Warning from "@editorjs/warning";&lt;br&gt;
import Code from "@editorjs/code";&lt;br&gt;
import LinkTool from "@editorjs/link";&lt;br&gt;
import Image from "@editorjs/image";&lt;br&gt;
import Raw from "@editorjs/raw";&lt;br&gt;
import Header from "@editorjs/header";&lt;br&gt;
import Quote from "@editorjs/quote";&lt;br&gt;
import Marker from "@editorjs/marker";&lt;br&gt;
import CheckList from "@editorjs/checklist";&lt;br&gt;
import Delimiter from "@editorjs/delimiter";&lt;br&gt;
import InlineCode from "@editorjs/inline-code";&lt;br&gt;
import SimpleImage from "@editorjs/simple-image";&lt;br&gt;
import AnyButton from "editorjs-button";&lt;br&gt;
let items;&lt;br&gt;
export const EDITOR_JS_TOOLS = {&lt;br&gt;
  embed: Embed,&lt;br&gt;
  table: Table,&lt;br&gt;
  marker: Marker,&lt;br&gt;
  list: List,&lt;br&gt;
  AnyButton: AnyButton,&lt;br&gt;
  warning: Warning,&lt;br&gt;
  code: Code,&lt;br&gt;
  linkTool: LinkTool,&lt;br&gt;
  image: {&lt;br&gt;
    class: Image,&lt;br&gt;
    config: {&lt;br&gt;
      uploader: {&lt;br&gt;
        uploadByFile(file) {&lt;br&gt;
//this is a custom method that will accept file in aws by 2 steps&lt;br&gt;
          const myJavs = {&lt;br&gt;
            upload: async function (data) {&lt;br&gt;
              console.log(data);&lt;br&gt;
              await fetch(&lt;br&gt;
                "&lt;a href="https://backend.yourDomain.com/aws_utils/pre_signed_url/"&gt;https://backend.yourDomain.com/aws_utils/pre_signed_url/&lt;/a&gt;",&lt;br&gt;
                {&lt;br&gt;
                  method: "POST",&lt;br&gt;
                  headers: {&lt;br&gt;
                    "Content-Type": "application/json",&lt;br&gt;
                    Authorization:&lt;br&gt;
                      "Bearer token",&lt;br&gt;
                  },&lt;br&gt;
                  body: JSON.stringify({&lt;br&gt;
                    content_type: data.type,&lt;br&gt;
                  }),&lt;br&gt;
                }&lt;br&gt;
              )&lt;br&gt;
                .then((req) =&amp;gt; {&lt;br&gt;
                  console.log(req);&lt;br&gt;
                  console.log("hello ");&lt;br&gt;
                  return req;&lt;br&gt;
                })&lt;br&gt;
                .then(async (req) =&amp;gt; {&lt;br&gt;
                  const response = await req.json();&lt;br&gt;
                  const raw = await req;&lt;br&gt;
                  await fetch(response.url, {&lt;br&gt;
                    method: "PUT",&lt;br&gt;
                    body: data,&lt;br&gt;
                  })&lt;br&gt;
                    .then((req) =&amp;gt; {&lt;br&gt;
                      return req;&lt;br&gt;
                    })&lt;br&gt;
                    .then(async (res) =&amp;gt; {&lt;br&gt;
                      console.log("hi how are you", &lt;br&gt;
                 response.url);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                  items = await response.url.split("?");
                  console.log(items);

                  return {
                    success: 1,
                    file: {
                      url: items[0],
                    },
                  };
                });
            });
        },
      };
      return myJavs.upload(file).then((data) =&amp;gt; {
        console.log(data);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;//common return that editor will only accept&lt;br&gt;
            return {&lt;br&gt;
              success: 1,&lt;br&gt;
              file: {&lt;br&gt;
                url: items[0],&lt;br&gt;
                              },&lt;br&gt;
            };&lt;br&gt;
          });&lt;/p&gt;

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

&lt;/div&gt;

&lt;p&gt;//only use this if you are using a backed that will instantly return an image as a common response for image upload&lt;br&gt;&lt;br&gt;
       //return {&lt;br&gt;
       //       success: 1,&lt;br&gt;
       //     file: {&lt;br&gt;
       //     url: 'url'&lt;br&gt;
       //                 },&lt;br&gt;
      //};&lt;br&gt;
       endpoints: {&lt;br&gt;
         byFile: "&lt;a href="http://localhost:8000/api/posts/post"&gt;http://localhost:8000/api/posts/post&lt;/a&gt;", // Your backend file uploader endpoint&lt;br&gt;
      byUrl: "&lt;a href="http://localhost:8008/fetchUrl"&gt;http://localhost:8008/fetchUrl&lt;/a&gt;", // Your endpoint that provides uploading by Url&lt;br&gt;
       },&lt;br&gt;
    },&lt;br&gt;
  },&lt;br&gt;
  raw: Raw,&lt;br&gt;
  header: Header,&lt;br&gt;
  quote: Quote,&lt;br&gt;
  checklist: CheckList,&lt;br&gt;
  delimiter: Delimiter,&lt;br&gt;
  inlineCode: InlineCode,&lt;br&gt;
  simpleImage: SimpleImage,&lt;br&gt;
};&lt;br&gt;
`&lt;/p&gt;

</description>
      <category>react</category>
      <category>blog</category>
      <category>edit</category>
      <category>javascript</category>
    </item>
    <item>
      <title>I created Quiz-app a quiz game ecosystem</title>
      <dc:creator>john</dc:creator>
      <pubDate>Sun, 16 Jan 2022 18:14:19 +0000</pubDate>
      <link>https://dev.to/johnbabu021/i-created-quiz-app-a-quiz-game-ecosystem-2kn2</link>
      <guid>https://dev.to/johnbabu021/i-created-quiz-app-a-quiz-game-ecosystem-2kn2</guid>
      <description>&lt;p&gt;I have created a quiz-app with Html and Javascript 4 months ago which i used to learn javascript intermediately it uses basic javascript queries &lt;br&gt;
This Application is best for beginners and Intermediate Javascript Learners&lt;/p&gt;

&lt;p&gt;Story so far&lt;br&gt;
when i was thinking to create a Quiz-app for students who can take excerises from an application i didn't found a free Application that's why i created this project&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Open sourced&lt;/li&gt;
&lt;li&gt;Runs online&lt;/li&gt;
&lt;li&gt;Have Multi-platform support&lt;/li&gt;
&lt;li&gt;Have Multi-device support&lt;/li&gt;
&lt;li&gt;Accesibility from anywhere&lt;/li&gt;
&lt;li&gt;Dark and Light Themes&lt;/li&gt;
&lt;li&gt;13 Contributors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;feel free to contribute on💚&lt;br&gt;
 &lt;a href="https://github.com/johnbabu021/quiz-app"&gt;Github&lt;/a&gt; 👩‍💻&lt;br&gt;
Please star this project &lt;a href="https://github.com/johnbabu021/quiz-app"&gt;Github&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Light mode:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZzMcPNo5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/58719884/135747992-942328a0-3cf4-45eb-906e-d862d2b98c09.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZzMcPNo5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/58719884/135747992-942328a0-3cf4-45eb-906e-d862d2b98c09.png" alt="Screenshot from 2021-10-03 14-59-41" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Dark mode:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bFi5mCrH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/58719884/135747965-89c60f7b-0cb7-400f-9775-54e6f899b8b2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bFi5mCrH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/58719884/135747965-89c60f7b-0cb7-400f-9775-54e6f899b8b2.png" alt="Screenshot from 2021-10-03 14-58-42" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Running Live &lt;a href="https://johnbabu021.github.io/quiz-app/"&gt;Demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel Free to Contribute on [Github]💚(&lt;a href="https://github.com/johnbabu021/quiz-app"&gt;https://github.com/johnbabu021/quiz-app&lt;/a&gt;) 👩‍💻&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>css</category>
      <category>beginners</category>
    </item>
    <item>
      <title>I created Sweetgradients a Color gradient Ecosystem 🧠 🧠</title>
      <dc:creator>john</dc:creator>
      <pubDate>Sun, 16 Jan 2022 18:13:17 +0000</pubDate>
      <link>https://dev.to/johnbabu021/i-created-sweetgradients-a-color-gradient-ecosystem-4jh9</link>
      <guid>https://dev.to/johnbabu021/i-created-sweetgradients-a-color-gradient-ecosystem-4jh9</guid>
      <description>&lt;h2&gt;
  
  
  &lt;a href="https://sweetgradients.vercel.app/"&gt;SweetGradients&lt;/a&gt; -A Platform where you can find out color graidents easily
&lt;/h2&gt;

&lt;p&gt;Story behind SweetGradients -When i was looking for gradients to be used in a project i didn't find anything but finally i findout a web app called Uigradients built with Vue.js.So i created a React.js version of that&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/johnbabu021/sweetgradients"&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sweetgradients.vercel.app/"&gt;demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel Free to contribute on this project &lt;br&gt;
&lt;a href="https://github.com/johnbabu021/sweetgradients"&gt;Github&lt;/a&gt;&lt;br&gt;
Made with  🥳&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>html</category>
      <category>webdev</category>
    </item>
    <item>
      <title>(function(){....})() Did you Know what is this</title>
      <dc:creator>john</dc:creator>
      <pubDate>Sun, 16 Jan 2022 18:04:17 +0000</pubDate>
      <link>https://dev.to/johnbabu021/function-did-you-know-what-is-this-6n3</link>
      <guid>https://dev.to/johnbabu021/function-did-you-know-what-is-this-6n3</guid>
      <description>&lt;p&gt;this function is called Immediately Invoked Function Expression(IIFE) &lt;br&gt;
what's the use of this function&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;well this function get invoked itself at the time of load and we can do any ui process at that time let's say if i want to get data from     localstorge at the time of load to find the theme used by the user let's take this eg.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(function () {
    const value = localStorage.getItem('theme')
    if (value === 'Dark Mode') {
        darkMode()
//darkMode is outside IIFE
    }
    else if (value === 'Light Mode') {
        return null
    }
    else {
        localStorage.setItem('theme', 'Light Mode')
    }
})()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this code initially check theme and if it is dark calls another function in the script if it is light it returns null and if value is not present then create a theme useful in next load&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>functional</category>
    </item>
    <item>
      <title>reusing css color attributes</title>
      <dc:creator>john</dc:creator>
      <pubDate>Sun, 16 Jan 2022 17:52:24 +0000</pubDate>
      <link>https://dev.to/johnbabu021/reusing-css-color-attributes-4m20</link>
      <guid>https://dev.to/johnbabu021/reusing-css-color-attributes-4m20</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root{
--primary-color:red;
--secondary-color:blue;

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

&lt;/div&gt;



&lt;p&gt;root element match the top most element in a web document(tree structure) so when creating variables in root it can be accessed anywhere inside the dom(Document Object Model)&lt;br&gt;
--primary-color,--secondary-color are variablels.We can reuse this elements by the following code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div{
color:var(--primary-color);
background-color:var(--secondary-color);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this selects --primary-color to all elements with a div parent and background-color to --secondary-color&lt;/p&gt;

</description>
      <category>css</category>
      <category>design</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>What is the use of UseMemo</title>
      <dc:creator>john</dc:creator>
      <pubDate>Sat, 15 Jan 2022 17:18:05 +0000</pubDate>
      <link>https://dev.to/johnbabu021/what-is-the-use-of-usememo-4aee</link>
      <guid>https://dev.to/johnbabu021/what-is-the-use-of-usememo-4aee</guid>
      <description>&lt;p&gt;useMemo is a memorise hook that avoid rendering  a Component if there is no change in props &lt;br&gt;
let's take an example when a parent child renders all of it's children component will render but we can avoid rendering of children if there is no change in the props by wrapping &lt;br&gt;
it with a React.useMemo hook&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>webpack</category>
    </item>
    <item>
      <title>What is React must be in scope??</title>
      <dc:creator>john</dc:creator>
      <pubDate>Sat, 15 Jan 2022 16:20:38 +0000</pubDate>
      <link>https://dev.to/johnbabu021/what-is-react-must-be-in-scope-56fd</link>
      <guid>https://dev.to/johnbabu021/what-is-react-must-be-in-scope-56fd</guid>
      <description>&lt;h2&gt;
  
  
  what is the use of import React from 'react'
&lt;/h2&gt;

&lt;p&gt;Every React component is compiled into React.createElement('tagName',{props},value)&lt;br&gt;
if React is not imported then it will show an error 'React must be in scope'&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>wwebdev</category>
      <category>node</category>
    </item>
    <item>
      <title>How to start with Open Source</title>
      <dc:creator>john</dc:creator>
      <pubDate>Mon, 03 Jan 2022 15:43:51 +0000</pubDate>
      <link>https://dev.to/johnbabu021/how-to-start-with-open-source-m6e</link>
      <guid>https://dev.to/johnbabu021/how-to-start-with-open-source-m6e</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Is opensourcing means coding&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Absolutely not, anyone want to contribute to an       open source project can change documentation and learn how to opensource &lt;br&gt;
allmost 28 percent of contriubtions are of docs change and updation not related to programming &lt;/p&gt;

&lt;h2&gt;
  
  
  How  to start opensourcing
&lt;/h2&gt;

&lt;p&gt;let's take a look at &lt;a href="https://github.com/firstcontributions/first-contributions"&gt;firstcontributions/first-contributions&lt;/a&gt; this project just adds your profile to contributors list when you make a pr for that carefully read README.md in the project section&lt;/p&gt;

&lt;h2&gt;
  
  
  FILES
&lt;/h2&gt;

&lt;p&gt;always when contributing to a project read the&lt;br&gt;&lt;br&gt;
README.md file , CONTRIBUTING_GUIDLINES ,CODE_OF_CONDUCT if available&lt;br&gt;
this pops some idea about the project in your mind&lt;br&gt;
that's all you can contribute to opensource&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
