Avatar

vladimyr

Joined August 5, 2023
Likes
94
saolsen avatar
display_markdown
@saolsen
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
saolsen avatar
display_mermaid
@saolsen
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);
pomdtr avatar
http_client
@pomdtr
HTTP (deprecated)
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
pomdtr avatar
hydrate_island
@pomdtr
Script
An interactive, runnable TypeScript val by pomdtr
tmcw avatar
httpMockingExample
@tmcw
HTTP (deprecated)
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.
neverstew avatar
viewSource
@neverstew
HTTP (deprecated)
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
neverstew avatar
prettifyHtml
@neverstew
Script
An interactive, runnable TypeScript val by neverstew
pomdtr avatar
codemirror_demo
@pomdtr
HTTP
CodeMirror Web Component Available Attributes language readonly code theme API You can access the code using the code property: document.getElementById("editor").code
easrng avatar
resilientFetch
@easrng
Script
resilientFetch : faster @std/fetch Try to fetch unproxied first, and fall back to proxied fetch if that fails.
saolsen avatar
gltf_torus
@saolsen
HTTP (deprecated)
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
agmm avatar
sslCertificates
@agmm
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)
arrudaricardo avatar
ntfyReq
@arrudaricardo
Script
Export function to publish NTFY notification reference: https://docs.ntfy.sh/publish/#publish-as-json
stevekrouse avatar
insecureSSLCertExample
@stevekrouse
Script
This is an example call of @stevekrouse/insecureFetch
easrng avatar
upgradeExpress
@easrng
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.
pomdtr avatar
codemirror_web_component
@pomdtr
HTTP
An interactive, runnable TypeScript val by pomdtr
pomdtr avatar
leaderboard
@pomdtr
HTTP (deprecated)
User with Most Vals