Skip to content

Instantly share code, notes, and snippets.

View rajatk16's full-sized avatar
🏠
Working from home

geekrajat rajatk16

🏠
Working from home
View GitHub Profile
@rajatk16
rajatk16 / TS_ESLINT_PRETTIER.md
Created June 23, 2020 04:46
Setup a TypeScript project with ESLint and Prettier

Project Setup

Setup ESLint to work with TypeScript

  1. Install the Dev Dependencies
yarn add eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin -D
@rajatk16
rajatk16 / ._Setup Javascript Project with ES6 + Babel 7 + ESLint + Airbnb + Prettier
Created March 16, 2020 15:11 — forked from vukhanhtruong/._README.md
Setup Javascript / Nodejs Project with ES6 + Babel 7 + ESLint + Airbnb + Prettier
# Project Setup
Create a directory and run the following command.
```sh
npm init
```
For this tutorial, I will be adding an index.js file to the `src` folder, and this will be our entry point.
Our file directory should look like this.
const data = {
"people":[
{
"f_name":"john",
"l_name":"doe",
"sequence":"0",
"title":"president",
"url":"google.com",
"color":"333333"
},
import React, {Component} from 'react';
import * as ml5 from 'ml5';
export default class App extends Component {
state={
buttonText: 'Click',
imageUrl: '',
ready: false,
predictionLabel: '',
predictionConfidence: '',
const template = document.createElement('template');
template.innerHTML = `
<style>
:host {
display: block;
}
button {
border: 1px solid black;
cursor: pointer;
}
const template = document.createElement('template');
template.innerHTML = `
<style>
:host {
display: block;
text-align: center;
}
button {
border: 2px solid blue;
cursor: pointer;
import {Component, OnInit, Input, Output, EventEmitter} from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
@Component({
selector: 'hero-form',
templateUrl: './hero-form.component.html',
styleUrls: ['./hero-form.component.css']
})
export class HeroFormComponent implements OnInit {
const fs = require('fs');
const requestHandler = (req, res) => {
const url = req.url;
const method = req.method;
if (url === '/') {
res.write('<html>');
res.write('<head><title>Enter Message</title></head>');
res.write(
'<body><form action="/message" method="POST"><input type="text" name="message"><button type="submit">Send</button></form></body>'
:root {
--timeout: 500ms;
--list-item-max-height: 30px;
}
ul {
margin: 0;
padding: 0 10px;
}
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import uuid from 'uuid';
import './index.css';
class App extends Component {
heroes = [
{
name: "Batman",
id: uuid(),