Sign in

Evolve Yourself — Anything you desire to be
Photo by Keith Hardy on Unsplash

Sankey Diagram

npm i @nivo/sankey
import React from "react";
import { ResponsiveSankey } from "@nivo/sankey";
const data = { nodes: [ { id: "John", color: "hsl(355, 70%, 50%)" }, { id: "Raoul", color: "hsl(276, 70%, 50%)" }, { id: "Jane", color: "hsl(331, 70%…



Photo by Josh Hild on Unsplash

Photo by Stewart MacLean on Unsplash

Photo by Harley-Davidson on Unsplash

Errors

const fastify = require('fastify')({})fastify.get('/' ,async () => { 
throw new Error('error')
})
const start = async () => {
try {
await fastify.listen(3000, '0.0.0.0')
} catch (err) {
fastify.log.error(err)
process.exit(1)
}
}
start()


Photo by Luca Campioni on Unsplash

Async-Await and Promises

const fastify = require('fastify')({})
const { promisify } = require('util');
const delay = promisify(setTimeout)
fastify.get('/', async function (request, reply) {
await delay(200)
return { hello: 'world' }
})
const start = async () => {
try {
await fastify.listen(3000, '0.0.0.0')
} catch (err) {
fastify.log.error(err)
process.exit(1)
}
}
start()


Best Online Businesses You Can Start in 2021
Best Online Businesses You Can Start in 2021
Photo by Bench Accounting on Unsplash

Photo by Alfons Morales on Unsplash

Bhagavad Gita API

British National Bibliography


Photo by Timon Klauser on Unsplash

Behance


Photo by NeONBRAND on Unsplash

Class Components

import { Component, render } from "preact";class Clock extends Component {
constructor() {
super();
this.state = { time: Date.now() };
}
componentDidMount() {
this.timer = setInterval(() => {
this.setState({ time: Date.now() });
}, 1000);
}
componentWillUnmount() {
clearInterval(this.timer);
}
render() { const time = new Date(this.state.time).toLocaleTimeString(); return <span>{time}</span>; }…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store