Avatar

maxm

🕳️
Joined January 12, 2023
Public vals
88
maxm avatar
sqlite_explorer
@maxm
HTTP
An interactive, runnable TypeScript val by maxm
maxm avatar
infiniteSVGGraph
@maxm
HTTP (preview)
// app.get("/update/:id", async (c) => {
maxm avatar
pinkEgret
@maxm
HTTP (preview)
// import { Request, Response } from "./node_modules/express/index.js";
maxm avatar
azureDinosaur
@maxm
Script
An interactive, runnable TypeScript val by maxm
maxm avatar
URLSearchParamsPuzzle
@maxm
Script
// Create a test URLSearchParams object
maxm avatar
fetchJSON
@maxm
Script
An interactive, runnable TypeScript val by maxm
maxm avatar
router
@maxm
Script
@jsxImportSource npm:hono/jsx
maxm avatar
example_test
@maxm
Script
An interactive, runnable TypeScript val by maxm
maxm avatar
test_explorer_router
@maxm
Script
@jsxImportSource npm:hono/jsx
maxm avatar
test_explorer
@maxm
HTTP
Test Explorer Click on the play button next to list items to run them. Usage Fork this val Create new tests in any of vals (and export them) (see @pomdtr/example_test) import { assertEquals } from "https://deno.land/std@0.216.0/assert/mod.ts"; import { Test } from "https://esm.town/v/<account>/test_explorer"; export const exampleTestSuccess = new Test(() => { assertEquals(1 + 1, 2); }); export const exampleTestFailure = new Test(() => { assertEquals(1 + 1, 3); }); Go to https://<account>-test_explorer.web.val.run to run your test click on the val name to go to the val the tests are originating from click on the test name to run it ℹ️ You probably want to protect your test explorer behind an authentication middleware like @pomdtr/basicAuth Discovery mechanism In order to define a test, the user need to import the Test class from https://val.town/v/<account>/Test . So we can use the api to search for vals containing the https://val.town/v/<account>/Test string to locate the vals containing tests. Next, we need to extract the tests from the val exports. We use exported instanceof Test to filter them (at some point we will probably use static analysis for this). TODO [x] persist test results in sqlite [x] Improve styling (help welcome ❤️) [ ] View logs in a modal [ ] Batch http requests
maxm avatar
mootex
@maxm
HTTP
maxm avatar
imageMagickWasmExample
@maxm
Script
Val Town implementation of the magick-wasm demo: https://github.com/dlemstra/magick-wasm/blob/main/demo/demo.ts Outputs: ImageMagick 7.1.1-30 Q8 x86_64 dd459b01f:20240407 https://imagemagick.org Delegates: freetype heic jng jp2 jpeg jxl lcms lqr openexr png raw tiff webp xml zlib Features: Cipher Quantum: 8 GIF 100x75 8-bit sRGB 2679
maxm avatar
openAIStreamingExample
@maxm
HTTP
An interactive, runnable TypeScript val by maxm
maxm avatar
reportBodySize
@maxm
HTTP
An interactive, runnable TypeScript val by maxm
maxm avatar
jamesWebbImageProxy
@maxm
HTTP
An interactive, runnable TypeScript val by maxm
maxm avatar
amaranthSquirrel
@maxm
HTTP
ASCII NYC Traffic Cameras All of NYC's traffic cameras available as streaming ASCII images: https://maxm-asciinyccameras.web.val.run/ NYC has a bunch of traffic cameras and makes them available through static images like this one . If you refresh the page you'll see the image update every 2 seconds or so. I thought it might be fun to make these cameras viewable as ASCII images. I made a small library that takes most of its logic from this repo . You can see a basic example of how to convert any image to ASCII here . I pull in NYC GeoJSON from here and then hook up a Server-Sent Events endpoint to stream the ASCII updates to the browser. (Polling would work just as well, I've just been on a bit of a SSE kick lately.) Hilariously (and expectedly) The ASCII representation is about 4x the size of the the source jpeg and harder to see, but it has a retro-nostalgia look to it that is cool to me :)