This file contains hidden or 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
| // Quirked up matrix multiplication | |
| // This is stupid and suboptimal but appeared to me | |
| // in a dream and I wanted to code it out | |
| // | |
| // Matrices in all functions of this | |
| // package are assumed to be square | |
| package main | |
| import ( | |
| "math" |
This file contains hidden or 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
| package main | |
| import "fmt" | |
| // UpdateLogger is a concrete type which can observe | |
| // Observable and log their updates | |
| type UpdateLogger struct { | |
| message string | |
| } |
This file contains hidden or 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 useCanvas from "./useCanvas"; | |
| import { useWindowSize } from "@uidotdev/usehooks"; | |
| const App = () => { | |
| const { width, height } = useWindowSize(); | |
| const canvasRef = useCanvas( | |
| (ctx, frame) => { | |
| ctx.fillRect(100, 100 + frame, 100, 100); | |
| }, |