Avatar

pomdtr

I mainly enjoy building dev tools: - VS Code integration: https://github.com/pomdtr/valtown-vscode - CLI: https://github.com/pomdtr/vt
Joined June 14, 2023
Public vals
317
pomdtr avatar
pomdtr
sunbeamValTownFn
HTTP
Sunbeam integration for Val Town Installation First, install sunbeam . Then create a new val referencing this val. const sunbeamValtown = @pomdtr.sunbeamValTownFn(@me.secrets.valtown) then switch it's visibility to unlisted. You can then install your val in sunbeam # install the extension sunbeam extension install --alias valtown val:<username>/sunbeamValtown Usage sunbeam valtown # list your vals sunbeam valtown --help # list available commands Demo
1
pomdtr avatar
pomdtr
listVals
Script
An interactive, runnable TypeScript val by pomdtr
0
pomdtr avatar
pomdtr
exampleTemplating
Script
An interactive, runnable TypeScript val by pomdtr
3
pomdtr avatar
pomdtr
vanPlate
HTTP
Van Plate
0
pomdtr avatar
pomdtr
vanPlateExample
HTTP
Van Plate Example of building html using the mini-van lib. Access it at https://pomdtr-vanPlateExample.web.val.run
3
pomdtr avatar
pomdtr
todosPlaceholder
Script
An interactive, runnable TypeScript val by pomdtr
0
pomdtr avatar
pomdtr
hnFollow
Script
// Forked from https://www.val.town/v/rodrigotello.hnFollow
0
pomdtr avatar
pomdtr
run
HTTP
Augmented run api This val is a wrapper on top of the val.town run api, improving it with additional features: basic auth content-type header in response based on url file extension Usage Custom Content-Type The content-type will be inferred from the filename using the mime-types library. If you use a .html extension, the response will be interpreted as text/html ~ $ curl -v 'https://pomdtr-run.web.val.run/pomdtr/helloWorld.html' HTTP/1.1 200 OK ... Content-Type: text/html; charset=utf-8 ... Hello, World! If you switch the extension to .txt , the content-type header switch to text/raw . ~ $ curl -v 'https://pomdtr-run.web.val.run/pomdtr/helloWorld.txt' HTTP/1.1 200 OK ... Content-Type: text/plain; charset=utf-8 ... Hello, World! Passing arguments The request is proxyed to the run api, so you can pass args to your vals via query params or body. See the run api docs for more details. ~ $ curl -X POST -d '{"args": ["pomdtr"]}' 'https://pomdtr-run.web.val.run/pomdtr/helloWorld.html' ... < content-type: text/html; charset=utf-8 ... Hello, pomdtr! Basic Authentication Just add your val town token as the username: curl 'https://<val-token>@pomdtr-run.web.val.run/pomdtr/privateVal.txt'
4
pomdtr avatar
pomdtr
openapi2TS
Script
An interactive, runnable TypeScript val by pomdtr
0
pomdtr avatar
pomdtr
prettifyTS
Script
Prettify Typescript code const pretty = await @pomdtr.prettifyTS("const hello='Hello world'")
2
pomdtr avatar
pomdtr
valtownOpenAPI
HTTP
Val Town Typescript Spec This val return an up-to-date typescript version of the val.town openapi spec for usage with a feTS client. Usage Deno script import { createClient, type NormalizeOAS } from "npm:fets"; import openapi from "https://pomdtr-valtownOpenAPI.web.val.run/openapi.ts"; export const client = createClient<NormalizeOAS<typeof openapi>>({ endpoint: openapi.servers[0].url, });
2
pomdtr avatar
pomdtr
testVtClient
Script
An interactive, runnable TypeScript val by pomdtr
0
pomdtr avatar
pomdtr
extractArgs
Script
An interactive, runnable TypeScript val by pomdtr
0
pomdtr avatar
pomdtr
add
Script
An interactive, runnable TypeScript val by pomdtr
0
pomdtr avatar
pomdtr
valToString
Script
An interactive, runnable TypeScript val by pomdtr
0
pomdtr avatar
pomdtr
extractValArgs
Script
Extract Args from a val await @pomdtr.extractValArgs("pomdtr.extractValArgs") // [{ "name": "val", "type": "string" }] Why ? Just an example of doing some static analysis. Using this approach to generate a json schema of a val input would be nice.
2