This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx jsx */ | |
import { useState } from 'react' | |
import { css, jsx } from '@emotion/react' | |
import { Container, Row, Col, Form } from 'react-bootstrap' | |
const customers = ['Jack', 'Sally', 'Jane', 'Mark'] | |
const Invoice = () => { | |
const [customer, setCustomer] = useState('') | |
const [title, setTitle] = useState('') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require("puppeteer"); | |
const createCsvWriter = require("csv-writer").createArrayCsvWriter; | |
const csvWriter = createCsvWriter({ | |
header: [ | |
"Country", | |
"Total Cases", | |
"New Cases", | |
"Total Deaths", | |
"New Deaths", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const worldData = await page.evaluate(() => { | |
const tbody = document.querySelector( | |
"table#main_table_countries_today tbody" | |
); | |
const trs = Array.from( | |
tbody.querySelectorAll("tr:not(.total_row_world)") | |
); | |
const worldData = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await page.goto("https://www.worldometers.info/coronavirus/"); | |
await page.waitForSelector("table#main_table_countries_today"); | |
await page.evaluate(() => { | |
const tbody = document.querySelector( | |
"table#main_table_countries_today tbody" | |
); | |
const trs = Array.from( | |
tbody.querySelectorAll("tr:not(.total_row_world)") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await page.goto("https://www.worldometers.info/coronavirus/"); | |
await page.waitForSelector("table#main_table_countries_today"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require("puppeteer"); | |
const createCsvWriter = require("csv-writer").createArrayCsvWriter; | |
const csvWriter = createCsvWriter({ | |
header: [ | |
"Country", | |
"Total Cases", | |
"New Cases", | |
"Total Deaths", | |
"New Deaths", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id":1, | |
"value":"banana" | |
}, | |
{ | |
"id":2, | |
"value":"apple" | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"away": { | |
"stat_name": "wind speed", | |
"stat_value": 8, | |
"league_high": 13, | |
"team_rank": 15 | |
}, | |
"home": { | |
"stat_name": "wind speed", | |
"stat_value": 8, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
useEffect, | |
useState | |
} from "https://cdn.skypack.dev/[email protected]"; | |
import ReactDOM from "https://cdn.skypack.dev/[email protected]"; | |
import axios from "https://cdn.skypack.dev/[email protected]"; | |
const App = () => { | |
const [stats, setStats] = useState([]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SomeComponent = () => { | |
const { fields, success, errors, handleSubmit, setFields } = | |
useFormValidationHook(formData) | |
return ( | |
<div className="Form" css={CSS}> | |
<Form onSubmit={handleSubmit}> | |
{fields.map((field) => ( | |
<FormGroup key={field.name}> | |
<Form.Label>{field.name}</Form.Label> |