Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanwahab committed Oct 15, 2024
1 parent 78d8094 commit f99a97b
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 16 deletions.
2 changes: 1 addition & 1 deletion data/odyssey/module_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
},
"Real World Applications": {
"pages": [
{ "name": "cat robot ", "path": "/applications/feeding-cats" },
{ "name": "cat robot ", "path": "/applications/feeding-cats" }

]
}
Expand Down
9 changes: 9 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,16 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CSS 3D Perspective Animation</title>
<style>
.rainbow-ify {
animation: rainbow 1s linear infinite;
}
@keyframes rainbow {
0% { filter: hue-rotate(0deg); }
100% { filter: hue-rotate(360deg); }
}

</style>
</head>
<body >

Expand Down
25 changes: 15 additions & 10 deletions infra/scripts/course_gen_step_2.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OpenAI } from 'openai';
import { join } from 'path';
import { existsSync, readdirSync } from 'fs';
import { existsSync, readdirSync, readFileSync } from 'fs';

const openai_api_key = process.env.OPENAI_KEY;

Expand Down Expand Up @@ -81,21 +81,26 @@ async function processChunk(folderName, index) {
// });
// const processed = parseGPT(chatCompletion);
const outputFilePath = join(input_dir, folderName, `${index}.md`);
let dummy_path = "data/course_intermediate/" + folderName + "/" + index + ".md";
await Bun.write(outputFilePath, processed);
}

async function processAllFilesInDirectory(directoryPath) {
const folders = readdirSync(directoryPath).filter(
(folder) => existsSync(join(directoryPath, folder)) &&
!existsSync(join(directoryPath, folder, 'index.md'))
);
const module_list = JSON.parse(readFileSync(join(directoryPath, 'module_list.json')));
console.log(JSON.stringify(module_list));
// const folders = readdirSync(directoryPath).filter(
// (folder) => existsSync(join(directoryPath, folder)) &&
// !existsSync(join(directoryPath, folder, 'index.md'))
// );
const startTime = Date.now();
for (const folder of folders) {
for (let index = 0; index < 10; index++) {
await processChunk(folder, index);
}
}
// for (const folder of folders) {
// for (let index = 0; index < 10; index++) {
// await processChunk(folder, index);
// }
// }
const endTime = Date.now();
const outputFilePath = join(directoryPath, 'output.json');
await Bun.write(outputFilePath, JSON.stringify(module_list));
console.log(`processing all files in directory took ${endTime - startTime} milliseconds`);
}

Expand Down
15 changes: 12 additions & 3 deletions views/odyssey/PowerPoints.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// import text from "./human_robot.txt"
// https://www.jasper.ai/

import reflectNotionHomage from '../../static/reflect_notion_homage.png';

//seuqelitis
//metal gear solid - explain war
// fallouit - war never changes -
Expand All @@ -9,7 +11,8 @@
// import Box from './Box';

function PowerPoint() {
return (
return ([
,
<iframe
width="560"
height="315"
Expand All @@ -18,8 +21,14 @@ function PowerPoint() {
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowFullScreen
></iframe>
);
></iframe>,
<iframe src="http://davidcole.me/mechanics-design.html"></iframe>,
<img

className="rainbow-ify"
src={reflectNotionHomage}></img>,

]);
// mega man x
// current status quo - founder of way mo - hoe noe robots will eat us - people are ivevil wow
// current status quo - raina borrows 5k - vote - sshould raina give eggnog his 5k back? she says "barf" and "i need space" --- her friends say "hes toxic ---- hes tocxic -" -- but sodiam and naicnin
Expand Down
54 changes: 54 additions & 0 deletions views/odyssey/TeleGuidance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,58 @@ function Livekit() {

// import notebook2 from "@roboticsuniversity/robotics-hardware";


function Whiteboard() {
const canvasRef = useRef(null);
const [isDrawing, setIsDrawing] = useState(false);

useEffect(() => {
const canvas = canvasRef.current;
const context = canvas.getContext("2d");

const startDrawing = ({ nativeEvent }) => {
const { offsetX, offsetY } = nativeEvent;
context.beginPath();
context.moveTo(offsetX, offsetY);
setIsDrawing(true);
};

const draw = ({ nativeEvent }) => {
if (!isDrawing) return;
const { offsetX, offsetY } = nativeEvent;
context.lineTo(offsetX, offsetY);
context.stroke();
};

const stopDrawing = () => {
context.closePath();
setIsDrawing(false);
};

canvas.addEventListener("mousedown", startDrawing);
canvas.addEventListener("mousemove", draw);
canvas.addEventListener("mouseup", stopDrawing);
canvas.addEventListener("mouseout", stopDrawing);

return () => {
canvas.removeEventListener("mousedown", startDrawing);
canvas.removeEventListener("mousemove", draw);
canvas.removeEventListener("mouseup", stopDrawing);
canvas.removeEventListener("mouseout", stopDrawing);
};
}, [isDrawing]);

return (
<canvas
ref={canvasRef}
width={800}
height={600}
style={{ border: "1px solid black" }}
/>
);
}


function RoboticsHardware() {
const viewofModuleNameRef = useRef();

Expand All @@ -66,6 +118,8 @@ function RoboticsHardware() {

return (
<>
<Whiteboard />

<div ref={viewofModuleNameRef} />
<p className="text-green-100">
Credit:{" "}
Expand Down
2 changes: 1 addition & 1 deletion views/odyssey/robotics-odyssey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function RoboticsOdyssey() {
{" "}
<DynamicHow />{" "}
</div>
{/* <PowerPoint /> */}
<PowerPoint />
<Footer />
</main>
</div>
Expand Down
5 changes: 4 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export default defineConfig({
plugins: [react()],
publicDir: 'static',
// root: '',
server: {
port: 8000, // You can specify the port here
Expand All @@ -20,4 +21,6 @@
// }
// }

})
})

// mexico +london + japan were fun -> (__inpso__, )

0 comments on commit f99a97b

Please sign in to comment.