Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
| /* | |
| * Your program must print string with the number of years and months and the total number of days between the dates. | |
| * Dates are provided in dd.mm.yyyy format. | |
| * You are not allowed to plug in JS libraries such as moment.js or date-fns directly into the code. All code need to be written in this file. | |
| * | |
| * Result must be shown as a string in years, months and total days. If years or months are 0, then it should not be displayed in the output. | |
| * | |
| * Example: | |
| * Input: ['01.01.2000', '01.01.2016'] | |
| * Output: |
| |
| import React, { forwardRef } from 'react' | |
| import styled from 'styled-components' | |
| import css, { get } from '@styled-system/css' | |
| import { | |
| system, | |
| compose, | |
| space, | |
| color, | |
| typography, | |
| layout, |
| import axios from 'axios'; | |
| class Service { | |
| constructor() { | |
| let service = axios.create({ | |
| headers: {csrf: 'token'} | |
| }); | |
| service.interceptors.response.use(this.handleSuccess, this.handleError); | |
| this.service = service; | |
| } |
| ls -al ~/.ssh | |
| # | |
| # generate ssh key | |
| # | |
| ssh-keygen -t rsa -C "email@work_mail.com" -f "id_rsa_work_user1" | |
| # | |
| #Adding the new SSH key to the corresponding GitHub account | |
| # |
Add the new key to your GitHub/BitBucket account
| Credit to | |
| https://medium.com/javascript-in-plain-english/react-controlled-forms-with-hooks-538762aab935 | |
| import React, { ChangeEvent, FormEvent, useReducer } from "react"; | |
| const useForm = (initialState: any) => { | |
| const reducer = ( | |
| state: typeof initialState, | |
| payload: { field: string; value: string } | |
| ) => { |