teleren/devto huggingface dataset:
Use formatter-maven-plugin to format source code
Published: 2020-12-23 08:56:25

###Write first

&nbsp;&nbsp;I believe everyone must be familiar with the coding style. Everyone has their own coding style and follows certain specifications, which is undoubtedly a good thing for themselves; but it may be a big trouble for teamwork! Their different styles will lead to unnecessary conflicts and troubles when synchronizing code. Therefore, it is particularly important to unify the code style within the team. Today I recommend a plug-in, you only need to execute the maven command to format the code according to the established style.

###Official website

  &nbsp;&nbsp;<a href="https://code.revelc.net/formatter-maven-plugin/">https://code.revelc.net/formatter-maven-plugin/</a>

###Environmental

 + JDK 1.8+
 + Maven 3.3.9+

####pom.xml Configuration

```
<project>
    ...
    <plugins>
      <plugin>
        <groupId>net.revelc.code.formatter</groupId>
        <artifactId>formatter-maven-plugin</artifactId>
        <version>2.11.0</version>
      </plugin>
    </plugins>
    ...
</project>
```

Run the command: mvn formatter:format to perform formatting.

###How to format source files during build ?

```
<project>
    ...
    <plugins>
      <plugin>
        <groupId>net.revelc.code.formatter</groupId>
        <artifactId>formatter-maven-plugin</artifactId>
        <version>2.11.0</version>
        <executions>
          <execution>
            <goals>
              <goal>format</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    ...
</project>
```

```
<project>
    ...
    <plugins>
      <plugin>
        <groupId>net.revelc.code.formatter</groupId>
        <artifactId>formatter-maven-plugin</artifactId>
        <version>2.11.0</version>
        <executions>
          <execution>
            <goals>
              <goal>validate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    ...
</project>
```

+ <a href="https://www.jsonformatting.com/jsonformat">JSON FORMATTER</a>
UPSC 2021: Annual Calendar Regarding Job Dates, Information Released

Published: 2020-12-23 08:53:04

2021 has been issued by the Union Public Service Commission (UPSC). UPSC released the schedule on 17 August, https://www.examlabonline.com/a/upsc-2021-annual-calendar-regarding-job-dates-information-released 2020 on their official website. The Commission issues an annual calendar every year wherein all the important details and information regarding all the examinations has been mentioned. In order to check the exam schedule that has been released by UPSC, candidates are required to visit the online website of UPSC at upsc.gov.in. The Civil Services Preliminary examination which is one of the most prominent examinations in the country, is scheduled to be held on 27 June, 2021. It has also been reported that the notification for the same will be declared on 10 February, 2021 while the last date to complete the application forms is 2 March, 2021.
https://www.examlabonline.com/a/upcoming-bank-exams
The Combined Geo-Scientist Preliminary examination is scheduled to be held in the month of February in the upcoming year 2021 on 21 February, 2021. The notification for the same will be issued on 7 October, 2020. Apart from this, it has also been mentioned that the UPSC Civil Services (Main) examination, 2020 is scheduled to be conducted in the month of January 2021 on the following dates: 8, 9, 10, 16 and 17 January, 2021. Besides this, https://www.examlabonline.com/a/upcoming-government-jobs the interested and eligible candidates are suggested to check the UPSC exam schedule and annual calendar for the year 2021. Candidates are advised to regularly check the official website for important information and details. https://www.examlabonline.com/a/government-jobs-10th-12th-pass
SBI Clerk mock test || 
SBI PO mock test || 
IBPS Clerk mock test || 
IBPS PO mock test
Published: 2020-12-23 08:50:51

SBI PO 2021 Apply Online [Last Date to Apply Online] April 2021
RRB Group D 2021 PET Result Declaration will be April 2021
SSC Stenographer 2021 Result will be Out on April 2021
SBI Clerk 2021 Notification Out for 8653 Posts on April 2021
RRB ALP Stage 2 Result will be out on April 2021 https://www.examlabonline.com/exam/sbi-clerk-mock-test-series

SSC CHSL 2021 Notification [Last Date to Apply Online] will be on April 2021
IBPS SO Result & Cut-Off 2021 will be released on 1st week of April 2021
SBI PO 2021 Notification will be out on 1st week of April 2021
IBPS PO Result will be released on 1st week of April 2021 https://www.examlabonline.com/a/upcoming-bank-exams

IBPS Clerk Result 2021 will be released on 1st week of April 2021
Government Exams in the month of May 2021:

SBI Clerk 2021 Prelims Admit Card Out is not decided yet.
AFCAT 2021 Notification will be out on 3rd week of May 2021
SSC CPO 2021 Result will be out on 3rd week of May 2021
LIC ADO 2021 Notification Out for 8581 Vacancies will be out on 3rd week of May 2021 https://www.examlabonline.com/a/upcoming-government-jobs

RRB JE 2021 CBT 1 Admit Card will release on May 2021
SBI PO 2021 Prelims Admit Card will be out on May 2021 https://www.examlabonline.com/a/government-jobs-10th-12th-pass

SBI Clerk 2021 PET Call Letter date will be 2nd week of May 2021
FCI 2021 Phase-I Admit Card will be released on May 2021
SSC CHSL Result 2021 Tier-II will be declared on May 2021
SSC CGL 2021 Tier-III Cut-Off will be declared on May 2021
CWC 2021 Admit Card date will be May 2021
SSC CGL Result 2021 Tier-III will be declared on May 2021
FCI 2021 Exam Date Out not decided yet https://www.examlabonline.com/exam/ibps-po-mock-test-series
LIC AAO 2021 Prelims Exam [Download Admit Card] on 1st week of May 2021
Last Day to Apply Online for SBI Clerk 2021 will be 1st week of May 2021
Government Jobs in the month of June 2021:

LIC ADO Admit Card 2021 is not decided yet.
EPFO SSA Recruitment Notification 2021 is not decided yet.
UPSSSC Junior Assistant Recruitment 2021 will be in June 2021
CWC Mains Admit Card 2021 will be on 3rd week of June 2021
Jobs in Haryana 2021 with 5000 and more vacancies
CTET 2021 Admit Card will be released on June 2021
SSC GD Constable 2021 Result will be declared on June 2021
SSC GD Constable 2021 Cut-Off will be released on June 2021
CWC Result & Cut-Off 2021 will be Out on June 2021
SSC CHSL 2021 Admit Card will be Out on June 2021
IBPS RRB 2021 Official Notification will be Out on 2nd week of June 2021
RRB NTPC 2021 Stage I Admit Card will be out on June 2021
LIC AAO Mains Admit Card 2021 is not released yet
How to deploy Docusaurus v2 on GitLab Pages
Tags: gitlab, javascript, react, documentation
Published: 2020-12-23 08:44:33

---
title: How to deploy Docusaurus v2 on GitLab Pages
published: true
description: Easily deploy your documentation using GitLab Pages
tags: gitlab, javascript, react, documentation,
//cover_image: https://direct_url_to_image.jpg
---

At [viafintech](https://viafintect.com), we use [docusaurus](https://v2.docusaurus.io/) for our internal documentation. We also use GitLab to host our code and to test it.

[GitLab pages](https://docs.gitlab.com/ee/user/project/pages/) is a feature (like Github pages) that allow us to publish a static website from a GitLab repository. You can host plenty of different static site generator like Gatsby, Hugo, Jekyll... 

[Docusaurus](https://v2.docusaurus.io/) is a documentation site generator created and maintained by Facebook Open Source. Using Markdown, it allowed us to write documentation faster and also to generate clean docs for our [RAML files](https://github.com/eleboucher/raml2docusaurus) that describe our endpoints.

To generate a docusaurus project, use the project generator: 


```console
npx @docusaurus/init@latest init [name] [template]
```

for my example I will use the classic template, but you can find more details [here](https://v2.docusaurus.io/docs/installation#scaffold-project-website)


```console
npx @docusaurus/init@latest init test-gitlab classic
```

Now, you should have the project properly generated in the test-gitlab/ folder.

## How to setup the gitlab ci

Once you messed up with the docs and you are ready to deploy it. 
Create a `.gitlab-ci.yml` file that will allow us to create an artifact containing the static resources to allow GitLab pages to render your website.

The content of the `.gitlab-ci.yml` file:
```yaml
image: node:latest

# allow caching for faster deployment
cache:
  paths:
    - node_modules/
    - public/
    - .cache/

pages:
  stage: deploy
  script:
    - yarn install
    - yarn build:gitlab
  artifacts:
      paths:
        - public
  only:
    - master
```

And add this script to the `package.json` to allow docusaurus to build the file into the `public/` folder:
```json
"build:gitlab": "docusaurus build --out-dir public",
```

## How to access it 


Now you are set to deploy your website, push your newly added stuff and your documentation site should be available. Go on GitLab > Settings > Pages and you will be able to see the link of your page, For me: https://eleboucher.gitlab.io/test-docs/

![Setting > pages](https://dev-to-uploads.s3.amazonaws.com/i/146uixovoaxone30846t.png)

Note: 
Make sure you set up correct the `baseURL` in `docusaurus.config.js` in case your link is not the root path.

If you have any questions, feel free to leave a comment!

Find me on:
- [Twitter](https://twitter.com/elebouch)
- [Github](https://github.com/eleboucher)

Happy coding!

We are hiring! => https://www.viafintech.com/op_software-engineer/
Creating A Button Library
Tags: css, html, codepen
Published: 2020-12-23 08:42:52

All websites need `<button>`s. With *CSS Custom Properties* it's easier than ever to maintain complex scenarios. 

Because a `<button>` can be rather complex.

First of all, it has 5 *states:*

![Button States](https://dev-to-uploads.s3.amazonaws.com/i/8hpykjfsk7hydm9uf2xw.png)

- Default
- Active
- Disabled
- Focus
- Hover

Each state can — or rather *should* — have different styling, for example:

- `background-color`
- `border-color`
- `box-shadow`
- `color`

You could also add `border-width` and many more, but with just these 4 properties, we already have 20 variants:

**5 states ✕ 4 properties**

Let's throw in "dark mode" as well, and we have 40 variants:

![Dark Mode](https://dev-to-uploads.s3.amazonaws.com/i/nhnge6lfne26xiq4vu1z.png)

Adding a simple *modifier* such as "outline", creates *another* 40 variants:

![Outline](https://dev-to-uploads.s3.amazonaws.com/i/slvt5hcdg1qjt15xl886.png)

So far we have **80 variants**, just for a "blue button".

With *CSS Custom Properties* we can simplify the amount of CSS-code needed to create all these variants.

To start with, we define the 4 properties like this:

```css
--btn-bdc: hsl(201, 79%, 46%);
--btn-bgc: hsl(201, 79%, 46%);
--btn-bxsh: transparent;
--btn-c: hsl(195, 100%, 100%);
```

And in the CSS for the button:

```css
.c-btn {
  /* Excerpt */
  background-color: var(--btn-bgc);
  border-color: var(--btn-bdc);
  box-shadow: var(--btn-bxsh--sz) var(--btn-bxsh);
  color: var(--btn-c);
}
```

The next step is to create CSS properties for all the other *states* — we need **20 properties** in total per button color:

```css
/* :active */
--btn-bdc--act: hsl(201, 79%, 46%);
--btn-bgc--act: hsl(201, 79%, 46%);
--btn-bxsh--act: hsl(197, 92%, 61%);
--btn-c--act: hsl(195, 100%, 100%);
```

We also need CSS for all the states, here's "active":

```css
.c-btn:active {
  background-color: var(--btn-bgc--act);
  border-color: var(--btn-bdc--act);
  box-shadow: var(--btn-bxsh--act);
  color: var(--btn-c--act);
}
```

Repeat these for `:disabled`, `:hover` and `:focus`.

---
## Putting it all together

Now to create — let's say — the 20 variants needed for a *green* button, all we have to do is add a *modifier-class* with updated properties:


![Green Button](https://dev-to-uploads.s3.amazonaws.com/i/ks3vacvra70rulwduq2d.png)
 
```css
.c-btn--green {
  --btn-bdc: hsl(162, 63%, 41%);
  --btn-bdc--act: hsl(162, 63%, 41%);
  --btn-bdc--foc: hsl(162, 63%, 41%);
  --btn-bgc: hsl(162, 63%, 41%);
  --btn-bgc--act: hsl(162, 63%, 41%);
  --btn-bgc--dis: hsl(162, 50%, 90%);
  --btn-bgc--foc: hsl(162, 63%, 41%);
  --btn-bgc--hov: hsl(168, 80%, 23%);
  --btn-bxsh--act: hsl(158, 58%, 62%);
  --btn-bxsh--foc: hsl(158, 58%, 62%);
  --btn-c: hsl(152, 68%, 100%);
  --btn-c--hov: hsl(152, 68%, 100%);
}
```

Here's a Codepen with all the variants:

{% codepen https://codepen.io/stoumann/pen/bGwooYW default-tab=result %}

Thanks for reading!
How to add dynamic colors in Chartjs
Tags: react, javascript, chartjs, dashboard
Published: 2020-12-23 08:40:45

If you are stuck in hardcoding color values for each dataset and whenever there is new entry in a dataset your code broke, if yes this article is for you...

Recently I was working with chartjs in React. Every time a new data was populated I had to add new color values for that label and data manually, after spending about 1.5 hours on the internet, I finally found  a solution to dynamically add colors in chartJS.

## Setting up project
You can use this [replit](https://replit.com/@Taimoorkhan1122/React-Dashboard) for your reference, just start the project and start playing.

## Explanation 
Following this amazing <a href="https://bit.ly/3haW2lg" target="_blank">article</a>, using D3's Chromatic color scale, we will be creating dynamic color ranges for our charts, D3's Scale Chromatic library provides many color scales, we have used their interpolate color scales. All of the interpolate color scales have a domain of [0, 1]. If you want to get deeper check out this amazing <a href="https://bit.ly/3haW2lg" target="_blank">article</a>. To simplify, I have created a function `chartData()` 


`chartData()` returns data object which we can then pass to any Chart component. This function accepts a data object which contains `labels`, `colorRangeInfo`, `scale` and `dataLabel`

    chartData({
        labels: ["China", "UAE", "Yemen", "Pakistan", "Saudia"],
        colorRangeInfo: {
        colorStart: 0,
        colorEnd: 1,
        useEndAsStart: false,
        },
        scale: d3.interpolateBlues,
        dataLabel: "data for doughnut chart",
    })
Labels : accepts list of data labels which will be displayed as labels.

`colorRangeInfo()` : accepts object containing d3 chromatic color range (0,1) useEndAsStart : true will reverse the color range.

    const colorRangeInfo = {
        colorStart: 0,
        colorEnd: 1,
        useEndAsStart: false,
    };

The scale property accepts `d3.interpolate` which gives you various combinations such:
**interpolateIferno**
<img src="https://raw.githubusercontent.com/d3/d3-scale-chromatic/master/img/inferno.png"/>

**interpolateCool**
<img src="https://raw.githubusercontent.com/d3/d3-scale-chromatic/master/img/cool.png"/>

You can play around with different variation by using different interpolate color scales.

Please share your thoughts if this article was useful for you. I would love hear back from you guys if you have any better solution for this.
SBI PO 2021 Important Dates || SBI PO 2021 Apply Online Application Form
Published: 2020-12-23 08:40:12

Events

Dates

Online Application Begins

Third week  of April 2021

Online Application Concludes

Second week of May 2021

Admit cards for Prelims Exam

Third week of June 2021

Prelims examination date

First week of July 2021

Declaration of Prelims result      

Second week of July 2021

Admit cards for the mains exam               

Third week of July 2021

SBI PO Mains Examination date

First week of August 2021

Declaration of  Mains result        

Third week of August 2021

Admit cards for interview

First week of September 2021

Announcement of final result   
SBI Clerk mock test	https://www.examlabonline.com/exam/sbi-clerk-mock-test-series
First week of November 2021

 

SBI PO 2021 Eligibility Criteria

It is necessary that the candidates confirm their eligibility before applying. However, aspiring candidates can check the information below:
SBI PO mock test	https://www.examlabonline.com/exam/sbi-po-mock-test-series
Nationality: Only Indian.

Age Limit: Candidates within 21 to 30 years of age can apply. However, a certain age relaxation is granted to candidates from reserved category.
Upcoming Bank Exams 2021, Important Details, Information
Published: 2020-12-23 08:37:34

To grab the opportunity of working in a bank, lakhs of students compete and work hard in order to clear the examinations set by the banks. Working in a bank is considered to be reputed and comes under the list of good jobs. Aspirations from all over the country dream to be a part of the banking industry because of the benefits and welfare attached to the job. During the bleak times amid the coronavirus pandemic, interested candidates have been awaiting notifications and information regarding upcoming bank jobs and upcoming bank exams 2021. https://www.examlabonline.com/a/upcoming-bank-exams || https://www.examlabonline.com/a/upcoming-government-jobs || https://www.examlabonline.com/a/government-jobs-10th-12th-pass
Essential Ingredients To Improve Your Website's User Experience [Must Read]
Tags: ux, uiweekly
Published: 2020-12-23 08:34:37

Hi everyone :wave:

I've recently been working on my [website](https://domain-monitor.io/) and have been trying to improve the user experience of the site...

I thought this might be a challenge **that you've come across before** so I wanted to share some tips for improving user experience!

If you're interested, it's a few minutes of content, so won't take up your whole day!

Here's [a link to the article :rocket:](https://domain-monitor.io/blog/how-to-improve-user-experience)
Proven Tactics to Attract More Social Media Followers
Published: 2020-12-23 08:33:22

In the event that you are new to the universe of social media, you are rapidly going to discover that Twitter is a site you must be a piece of as an entrepreneur. Not exclusively would you be able to get news out to your clients you are likewise going to think that its a simple route for you to converse with them when you would prefer not to post an enormous TV or other significant expense promotion, truth be told, Twitter is a free path for you to advertise and to converse with those you are attempting to contact as an entrepreneur. In this way, in the event that you are new to the site, you can purchase Twitter supporters, to develop your after. At the point when you do this, you will find that it is simpler for you to get all the more genuine adherents later on, when you have all the more new devotees from the beginning. At the point when you do decide to purchase adherents, you must be certain that you will get them from a source you can trust; so you do need to discover where to go to purchase, and where to go to purchase the genuine supporters you will post to on your site. The more genuine names and individuals you can connect with, the more you will develop as a business; yet, from the beginning, when you don't have the foggiest idea, the alternative to purchase new adherents is one that will interest many entrepreneurs who are attempting to develop. 

In this way, when you are new to the online social media world, you must discover where to go to purchase, and where to go to locate the genuine devotees you are attempting to speak to over the long run. At the point when you have a bigger after right off the bat it makes it a lot simpler for you to develop as a business; along these lines, when you are attempting to get that bigger after, you can utilize the alternative to purchase adherents, so you can engage more individuals not far off and connect with all the more genuine supporters later on. You need to realize where to shop and where you will get genuine adherents; since not all destinations sell genuine devotees, it is imperative to ensure you purchase from one that does, and one that will give you what you are searching for as an entrepreneur. There is so much you can do when you realize how to utilize and how to use [content marketing tool](https://socialplanner.io) as an entrepreneur. In this way, when you are different to it, and don't have the foggiest idea how to utilize it, you need to locate the correct assets to assist you with getting it from the get-go. You can purchase your adherents, you can engage more individuals, and you can contact a bigger crowd, when you realize where to go from the get-go, to develop your name and your business on the web.
Weekly web development update #56
Tags: weekly, webdev
Published: 2020-12-23 08:22:38



______

##[useAuth](https://useauth.dev/)
[![useAuth](https://wwebdev-images.s3.eu-central-1.amazonaws.com/content/weekly/56/useauth.jpg)](https://useauth.dev/)
A simple way to add authentication to your React app.

______

##[Polotno Studio](https://studio.polotno.dev/)
[![Polotno Studio](https://wwebdev-images.s3.eu-central-1.amazonaws.com/content/weekly/56/studio-polotno.jpg)](https://studio.polotno.dev/)
A free online editor to create images for social media, youtube previews, and facebook covers.

______

##[EStimator](https://estimator.dev/)
[![EStimator](https://wwebdev-images.s3.eu-central-1.amazonaws.com/content/weekly/56/estimator.jpg)](https://estimator.dev/)
Calculate the size and performance improvement a site could achieve by switching to modern JavaScript syntax.

______

##[Scrollytelling with React](https://varun.ca/scrollytelling/)
[![Scrollytelling with React](https://wwebdev-images.s3.eu-central-1.amazonaws.com/content/weekly/56/scrollytelling.jpg)](https://varun.ca/scrollytelling/)
An article about creating a visual and interactive form of storytelling.

______

##[Minimal CSS Loader Collection](https://dailydevlinks.com/minimal-css-loader-collection)
[![Minimal CSS Loader Collection](https://wwebdev-images.s3.eu-central-1.amazonaws.com/content/weekly/56/css-loader.jpg)](https://dailydevlinks.com/minimal-css-loader-collection)
A nice collection of Codepens for CSS loaders.

______

##[SuperTokens](https://supertokens.io/)
[![SuperTokens](https://wwebdev-images.s3.eu-central-1.amazonaws.com/content/weekly/56/supertokens.jpg)](https://supertokens.io/)
A simple email and password sign up functionality for your site or app.

______

##[Handling Short And Long Content In CSS](https://ishadeed.com/article/css-short-long-content/)
[![Handling Short And Long Content In CSS](https://wwebdev-images.s3.eu-central-1.amazonaws.com/content/weekly/56/css-long-short.jpg)](https://ishadeed.com/article/css-short-long-content/)
An in-depth article on how to handle short and long content in CSS.

______

##[Tiny-Swiper](https://tiny-swiper.joe223.com/)
[![Tiny-Swiper](https://wwebdev-images.s3.eu-central-1.amazonaws.com/content/weekly/56/tiny-swiper.jpg)](https://tiny-swiper.joe223.com/)
A lightweight and extensible JavaScript carousel with a native-like experience.

______

##[Owncast](https://owncast.online/)
[![Owncast](https://wwebdev-images.s3.eu-central-1.amazonaws.com/content/weekly/56/owncast.jpg)](https://owncast.online/)
A self-hosted live video and web chat server.

______

##[5 Years of Design](https://timetravel.pixelfika.com/)
[![5 Years of Design](https://wwebdev-images.s3.eu-central-1.amazonaws.com/content/weekly/56/years-design.jpg)](https://timetravel.pixelfika.com/)
A collection of beautiful designs ordered by month and year.

______

To see all the weeklies check: [wweb.dev/weekly](https://wweb.dev/weekly)