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 Markdown from "react-markdown" | |
import OpenAI from "openai" | |
import { OpenAIStream } from "ai" | |
async function Reader({ | |
reader, | |
accumulatedText = "", | |
}: { | |
reader: ReadableStreamDefaultReader<Uint8Array>; | |
accumulatedText?: string; |
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
name: End-to-end tests | |
on: [deployment_status] | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
containers: [1, 2, 3] | |
steps: |
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
// --- ✅ better caching | |
import imageSrc from '../public/images/image.png' | |
import Image from 'next/image' | |
return <Image src={imageSrc}/> | |
// --- ❌ worse caching | |
import Image from 'next/image' |
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
{ | |
"headers": [ | |
{ | |
"source": "/static/:slug*", | |
"headers": [ | |
{ | |
"key": "Cache-Control", | |
"value": "max-age=31536000" | |
} | |
] |
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
const stanzaOne = `First they came for the socialists, and I did not speak out— | |
Because I was not a socialist.` | |
const stanzaTwo = `Then they came for the trade unionists, and I did not speak out— | |
Because I was not a trade unionist.` | |
const stanzaThree = `Then they came for the Jews, and I did not speak out— | |
Because I was not a Jew.` | |
const stanzaFour = `Then they came for me—and there was no one left to speak for me.` |
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
{ | |
"name": "resolution-reminder", | |
"version": "0.1.0", | |
"private": true, | |
"scripts": { | |
"dev": "next dev", | |
"build": "next build", | |
"start": "next start" | |
}, | |
"dependencies": { |
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 { NextApiResponse, NextApiRequest } from "next"; | |
const twillio = require('twilio'); | |
const authToken = process.env.TWILIO_AUTH_TOKEN; | |
const accountSid = process.env.TWILIO_ACCOUNT_SID; | |
const myCellPhoneNumber = process.env.MY_NUMBER; | |
const superSecretAPIKey = 'ABCD1234'; | |
export default async (req: NextApiRequest, res: NextApiResponse) => { | |
const client = twillio(accountSid, authToken); | |
const auth = req.headers.authorization; |
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
//## Moment.JS Holiday Plugin | |
// | |
//Usage: | |
// Call .holiday() from any moment object. If date is a US Federal Holiday, name of the holiday will be returned. | |
// Otherwise, return nothing. | |
// | |
// Example: | |
// `moment('12/25/2013').holiday()` will return "Christmas Day" | |
// | |
//Holidays: |