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 React, { useState } from 'react'; | |
import Sentiment from 'sentiment'; | |
import 'bootstrap/dist/css/bootstrap.min.css'; | |
const sentiment = new Sentiment(); | |
function TodoApp() { | |
const [todos, setTodos] = useState([]); | |
const [input, setInput] = useState(''); |
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
function addNumbers(numbers) { | |
let sum = 0; | |
for (let i = 0; i < numbers.length; i++) { | |
sum += numbers[i]; | |
} | |
return sum; | |
} | |
let numbers = [1, 2, 3, 4, 5]; | |
console.log(addNumbers(numbers)); // Output: 15 |
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
`Write an informal email to ${destination}, ${topic}, my name is ${name}` | |
`Write an email to ${destination}, ${topic}, make sure they understand it's important and that my name is ${name}` | |
`Write a corporate-sounding email to ${destination}, ${topic}, my name is ${name}` | |
`Write a formal email to my boss, ${destination}, about ${topic}, and sign it as ${name}` |
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 { Configuration, OpenAIApi } = require("openai"); | |
require('dotenv').config() | |
const readline = require('node:readline/promises').createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
const configuration = new Configuration({ |
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
async function getActivity() { | |
let result = await fetch("https://www.boredapi.com/api/activity?type=recreational") | |
const obj = await result.json() | |
return { activity: obj.activity } | |
} | |
export default async function Bored () { | |
let activity = await getActivity(); |
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
<script > | |
import { getVersionFromURL } from "~/util"; | |
//code to update the links inside the documents to make sure they link to the right | |
//version | |
let links = document.getElementsByTagName("a") | |
let version = getVersionFromURL(window.location.href) | |
const host = import.meta.env.PUBLIC_SITE_URL ? import.meta.env.PUBLIC_SITE_URL : "" | |
let urlParts = ["docs"] |
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 VERSIONS = [ | |
{title: "2.6.0", url: "/v2.6.0"}, | |
{title: "2.7.0", url: "/v2.7.0"}, | |
{title: "3.0.0", url: "/v3.0.0"}, | |
{title: "3.1.1", url: ""} | |
] | |
--- |