Example
NameDescription |
import puppeteer from 'puppeteer' | |
import fs from 'fs' | |
async function buildPDF(htmlString) { | |
const browser = await puppeteer.launch({ headless: true }) | |
const page = await browser.newPage(); | |
await page.setContent(htmlString, { waitUntil: 'networkidle0' }) | |
const pdf = await page.pdf({ | |
format: 'A4', | |
displayHeaderFooter: false, |
NameDescription |
This is flow used by apps on Apple TV / Roku. However, it is also useful for CLIs.
Here is my rundown. Please correct me in comments if something is wrong or if there is a better way to do this.
Device pings the server to begin activation process
import {MDXProvider} from '@mdx-js/react'; | |
import {MDXComponents} from 'components/MDX/MDXComponents'; | |
import {Toc} from 'components/Toc/Toc'; | |
import * as React from 'react'; | |
export interface MarkdownProps<Frontmatter> { | |
meta: Frontmatter; | |
children?: React.ReactNode; | |
} |
import { crc32 } from 'common/components/Features/Experiment/crc32'; | |
import { Config } from 'common/api/models/Config'; | |
const sortBy = require('lodash.sortby'); | |
export interface Experiments { | |
[name: string]: Variant[]; | |
} | |
export interface Variant { | |
name: string; |
We're going to build a multi-step wizard for a jobs-to-be-done customer research questionaire from scratch.
In your command-line run the following commands:
brew doctor
brew update
// If the user has been on the page for over 12 hours, the next link | |
// click will do a full page transition to get new code | |
import React from "react"; | |
import { BrowserRouter, useLocation } from "react-router-dom"; | |
let hour = 3600000; | |
export default function StaleAppRouter(props) { | |
let [isStale, setIsStale] = useState(false); |
/* | |
* Copyright 2020 Adobe. All rights reserved. | |
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. You may obtain a copy | |
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under | |
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | |
* OF ANY KIND, either express or implied. See the License for the specific language | |
* governing permissions and limitations under the License. |
/** | |
* Return a copy of an object, but with values of a key replaced with value of provided key-value object. | |
* Useful for duplicating highly nested object, but generating new values for a key (e.g. `id`) | |
* | |
* | |
* @param obj An object | |
* @param keyToReplace The key of the values needed to be swapped | |
* @param mapOfOldToNewValues A key-value object with a keys of old values mapped to new ones (used for swapping) | |
* | |
* @example |