Description |
This file contains 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
// TODO: make `pages` optional and measure the div when unspecified, this will | |
// allow more normal document flow and make it easier to do both mobile and | |
// desktop. | |
import { | |
createContext, | |
useCallback, | |
useContext, | |
useEffect, | |
useMemo, | |
useRef, |
This file contains 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
// app/api/chat/route.ts | |
import Replicate from 'replicate' | |
const replicate = new Replicate({ | |
auth: process.env.REPLICATE_API_KEY!, | |
}) | |
export const runtime = 'edge' |
This file contains 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 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, |
This file contains 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 {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; | |
} |
This file contains 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 { 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.
- Installation
- What we're building
- Getting help
In your command-line run the following commands:
brew doctor
brew update
This file contains 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
// 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); |
NewerOlder