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'; | |
const TweetGenerator = () => { | |
const [words, setWords] = useState(''); | |
const [output, setOutput] = useState(''); | |
const wordToBinary = (word) => word | |
.split('') | |
.map((w) => w.charCodeAt(0).toString(2)) | |
.join(' '); |
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
<html> | |
<head> | |
<title>Canvas Wordle</title> | |
</head> | |
<body style="background-color: black; color: white;"> | |
<canvas id="canvas" width="250" height="250" style="border: 1px solid black;"></canvas><br /> | |
<input type="text" id="guess" name="guess" maxlength="5" /> | |
<button onClick="guess()">Guess</button><br /> | |
<div id="message"></div> | |
<script type="text/javascript"> |
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, useEffect} from 'react'; | |
const Checkbox = props => <input type='checkbox' {...props} /> | |
const List = props => <ul style={{listStyle: 'none', margin: 0, padding: 5}}>{props.children}</ul> | |
const CheckboxExpand = ({currentData, allData, getValue, getLabel, onChange}) => { | |
const [current, setCurrent] = useState(currentData); | |
const [matches, setMatches] = useState([]); | |
const [showAll, setShowAll] = useState(false); | |
const inCurrent = val => current.includes(val); |
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 from 'react'; | |
import ReactDOM from 'react-dom/client'; | |
import App from './App'; | |
import {BrowserRouter, Routes, Route} from 'react-router-dom'; | |
import TaskTable from './tasks'; | |
import Workspace from './workspace'; | |
import Home from './home'; | |
import Nav from './nav'; | |
import ProjectTable from './projects'; | |
import Project from './project'; |
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 PersistentJobs = require('./persistent_jobs'); | |
const schedule = require('node-schedule'); | |
const actions = { | |
test1: require('./actions/test1'), | |
test2: require('./actions/test2') | |
}; | |
async function scheduleJobs() { | |
const jobs = new PersistentJobs(); | |
await jobs.connect(); |
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
#nav { | |
list-style-type: none; | |
margin: 0; | |
padding: 0 0 10px 0; | |
} | |
#nav li { | |
display: inline; | |
margin-right: 10px | |
} |
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
#nav { | |
list-style-type: none; | |
margin: 0; | |
padding: 0 0 10px 0; | |
} | |
#nav li { | |
display: inline; | |
margin-right: 10px | |
} |
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 {useState} from 'react'; | |
const url = 'http://localhost:3001/api/task'; | |
const headers = { | |
'Content-Type': 'application/json' | |
}; | |
const API = { | |
async create(task, content) { | |
const res = await fetch(`${url}/${task}/notes`, { |
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 {useState, useEffect} from 'react'; | |
const url = 'http://localhost:3001/api/task'; | |
const headers = { | |
'Content-Type': 'application/json' | |
}; | |
const API = { | |
async update(id, body) { | |
const res = await fetch(`${url}/${id}`, {method: 'PUT', headers, body: JSON.stringify(body)}); |
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 from 'react'; | |
import ReactDOM from 'react-dom/client'; | |
import {BrowserRouter, Routes, Route} from 'react-router-dom'; | |
import App from './App'; | |
import TaskTable from './tasks'; | |
const root = ReactDOM.createRoot(document.getElementById('root')); | |
root.render( | |
<React.StrictMode> | |
<BrowserRouter> |
NewerOlder