Avatar

vladimyr

Joined August 5, 2023
Likes
94
saolsen avatar
saolsen
display_markdown
Script
Display Markdown Takes a markdown document (as a string) and returns an http handler that renders it. Example https://www.val.town/v/saolsen/display_markdown_example
1
saolsen avatar
saolsen
display_mermaid
Script
Display Mermaid Takes a mermaid document (as a string) and returns an http handler that renders it. Example https://www.val.town/v/saolsen/display_mermaid_example import { displayMermaid } from "https://esm.town/v/saolsen/display_mermaid"; const mermaid = ` sequenceDiagram Alice->>John: Hello John, how are you? John-->>Alice: Great! Alice-)John: See you later! `; export default displayMermaid(mermaid);
1
pomdtr avatar
pomdtr
http_client
HTTP
HTTP Client Attach a postman-like http client to your vals, with bookmarks and history support Usage Wrap your http handler in an the httpClient middleware. import {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }) The http client will be shown on the root. Adding bookmarks You might want to bookmark some requests you need often. You can do it by passing a bookmark list as a middleware option: import {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }, { bookmarks: [ { "label": "Dummy Request", "request": new Request("https://dummyjson.com/products") } ]}) Customizing the client path import {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }, { path: "/http-client" }) TODO [ ] fix syntax highlighting on successive request [ ] allow to prefill the initial request
7
pomdtr avatar
pomdtr
hydrate_island
Script
An interactive, runnable TypeScript val by pomdtr
1
tmcw avatar
tmcw
httpMockingExample
HTTP
HTTP Val Mocking example This is an example of mocking an HTTP val. Let's say that you're developing a val that responds to a POST request. That's tricky to debug and develop in the Browser preview tab, which just shows a GET request. But you can do it, because with web-standard Request & Response objects, requests and responses are values, and we can create those values ourselves.
1
neverstew avatar
neverstew
viewSource
HTTP
View source code Just like a right click + inspect on desktop, except available on mobile too! Just write the website after the / e.g. https://neverstew-viewSource.web.val.run/bbc.co.uk
2
neverstew avatar
neverstew
prettifyHtml
Script
An interactive, runnable TypeScript val by neverstew
1
pomdtr avatar
pomdtr
codemirror_demo
HTTP
CodeMirror Web Component Available Attributes language readonly code theme API You can access the code using the code property: document.getElementById("editor").code
4
easrng avatar
easrng
resilientFetch
Script
resilientFetch : faster @std/fetch Try to fetch unproxied first, and fall back to proxied fetch if that fails.
2
saolsen avatar
saolsen
gltf_torus
HTTP
Builds a torus as a gltf file and displays it with https://modelviewer.dev/ based on https://www.donmccurdy.com/2023/08/01/generating-gltf/ https://github.com/mrdoob/three.js/tree/dev/src/geometries
2
agmm avatar
agmm
sslCertificates
Script
What is this for? To get a list of all the SSL certificates that have been issued for a particular domain. Usage import { getCertificates } from "https://esm.town/v/agmm/sslCertificates"; const results = await getCertificates("agmm.xyz"); console.log(results)
1
arrudaricardo avatar
arrudaricardo
ntfyReq
Script
Export function to publish NTFY notification reference: https://docs.ntfy.sh/publish/#publish-as-json
1
stevekrouse avatar
stevekrouse
insecureSSLCertExample
Script
This is an example call of @stevekrouse/insecureFetch
2
easrng avatar
easrng
upgradeExpress
Script
upgradeExpress Upgrade Express vals to the Web API without breaking existing consumers How it works upgradeExpress wraps a Web handler into a function that works as normal when called by the Web API, and redirects to the Web API when called by the Express API. Example I don't have an example for this per se but I used it to upgrade @easrng/button.
2
pomdtr avatar
pomdtr
codemirror_web_component
HTTP
An interactive, runnable TypeScript val by pomdtr
3
pomdtr avatar
pomdtr
leaderboard
HTTP
User with Most Vals
2