node getCoverage.js
=>
CoverageSummary {
data: {
lines: { total: 10, covered: 10, skipped: 0, pct: 10.0 },
#!/usr/bin/env node | |
const glob = require("glob"); | |
const yargs = require("yargs"); | |
const { hideBin } = require("yargs/helpers"); | |
const path = require("path"); | |
const fs = require("fs"); | |
const yaml = require("yaml"); | |
const lodash = require("lodash"); |
/* eslint-disable no-param-reassign */ | |
const fetch = require("node-fetch"); | |
const _ = require("lodash"); | |
const fs = require("fs"); | |
const { format } = require("util"); | |
const SOURCE_REDASH = "https://app.redash.io/domain"; | |
const SOURCE_REDASH_API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXX"; |
(async () => { | |
async function sleep(ms) { | |
return new Promise((resolve) => setTimeout(resolve, ms)); | |
} | |
let el = document.querySelector('[aria-label="My calendars"]').children[0]; | |
while (el) { | |
const label = el.querySelector("label"); | |
const checkbox = el.querySelector("[role=checkbox]"); |
node getCoverage.js
=>
CoverageSummary {
data: {
lines: { total: 10, covered: 10, skipped: 0, pct: 10.0 },
(?:^`{3})(?:(.*$\n)?((?:.|\n)*?))(?:`{3}$)
Run the script in docker runtime
chmod +x webenv.sh
# load global envrionments with filter
(env | grep ^REACT_APP_ | webenv.sh) > env.js
Include <script>
in index.html
WITH RECURSIVE doc_key_and_value_recursive ( | |
KEY, | |
value | |
) AS ( | |
SELECT | |
t.key, | |
t.value | |
FROM | |
stories_collection AS item, | |
json_each(item.data) AS t |
const path = require('path'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const TerserPlugin = require('terser-webpack-plugin'); | |
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |
const env = process.env.NODE_ENV; | |
const publicPath = process.env.PUBLIC_PATH ? `${process.env.PUBLIC_PATH}/` : process.env.PUBLIC_PATH; | |
if (!['development', 'production'].includes(env)) { | |
throw new Error('Invalid NODE_ENV'); |
import React, { useState, useRef, useCallback } from "react"; | |
import Button from "./Button"; | |
function App() { | |
const [state, setState] = useState(""); | |
const ref = useRef(state); | |
const handleChange = useCallback(event => { | |
ref.current = event.target.value; | |
setState(event.target.value); | |
}, []); |