Skip to content

Instantly share code, notes, and snippets.

View saratkumar17mss040's full-sized avatar
🎯
Focusing

sarath saratkumar17mss040

🎯
Focusing
View GitHub Profile
@saratkumar17mss040
saratkumar17mss040 / React-exercises-useReducer
Last active March 27, 2021 12:09
Simple react useReducer exercises.md
ex01 reduce() -
https://codesandbox.io/s/reduce-exercise-cemnj?file=/src/index.js,
https://codesandbox.io/s/use-reducer-type-owwc7?file=/src/App.js
ex02 the most basic reducer - https://codesandbox.io/s/interesting-booth-zplqw?file=/src/App.jsx
ex03 counter with reducer - https://codesandbox.io/s/wonderful-breeze-svpqc?file=/src/App.jsx
ex04 cart management with useReducer - https://codesandbox.io/s/use-reducer-cart-2rlfx?file=/src/App.js
ex06 the endgame - https://codesandbox.io/s/usereducer-eg-mqmi3
@saratkumar17mss040
saratkumar17mss040 / stringsToCharacters.js
Created July 9, 2020 15:50
5 Ways to Convert a String to Character Array in JavaScript
let quote = "It's not whether you get knocked down, it's whether you get up.";
console.log('Resource link!');
console.log('https://medium.com/dailyjs/4-ways-to-convert-string-to-character-array-in-javascript-994c7f73c89a');
console.log(Array.prototype.map.call('animal', (letter) => letter));
console.log(quote.split(''));
console.log([...quote]);
console.log(Array.from(quote));
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Loading animation</title>
<style>
.loading {
background: linear-gradient(
100deg,
@saratkumar17mss040
saratkumar17mss040 / pseudoElements.html
Created July 7, 2020 08:22
CSS Before and after pseudo elements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CSS Before and after pseudo elements</title>
<style>
p:before {
content: '* ';
}

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node