Avatar

neverstew

Twice called wise. 🧐 Building a better world at https://equalcare.coop.
Joined January 12, 2023
Public vals
91
neverstew avatar
neverstew
discordActivityClient
Script
// Once setupDiscordSdk is complete, we can assert that "auth" is initialized
0
neverstew avatar
neverstew
superchargedQueryParams
Script
⚡ Supercharge your query params Tired of the old x=y query param limitations? Ever wished you could say x>y or x!=y as well? Now you can! Parse query params with superchargedQueryParams and you get an array of operations for each parameter instead: import { superchargeQueryParams } from "https://esm.town/v/neverstew/superchargeQueryParams"; console.log(superchargeQueryParams(new URL("https://example.com?a=b&c>d&e!=f&e>=g"))) // {"a":[{"eq":"b"}],"c":[{"gt":"d"}],"e":[{"ne":"f"},{"gte":"g"}]}
1
neverstew avatar
neverstew
ivoryPorpoise
HTTP
@jsxImportSource https://esm.sh/preact
0
neverstew avatar
neverstew
setCorsHeaders
Script
An interactive, runnable TypeScript val by neverstew
0
neverstew avatar
neverstew
discordEventReceiver
HTTP
An interactive, runnable TypeScript val by neverstew
0
neverstew avatar
neverstew
vtApiExample
Script
An interactive, runnable TypeScript val by neverstew
0
neverstew avatar
neverstew
vtApiTypes
Script
* This file was auto-generated by openapi-typescript. * Do not make direct changes to the file.
0
neverstew avatar
neverstew
updateVtApiTypes
Cron
An interactive, runnable TypeScript val by neverstew
0
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
neverstew avatar
neverstew
sleep
Script
An interactive, runnable TypeScript val by neverstew
1
neverstew avatar
neverstew
inTheBackgroundExample
HTTP
inTheBackground With the addition of the "early return" feature of web handlers, you can now process short background tasks in vals. This can be really useful for occasions where an immediate response is required, with a subsequent update a few seconds later e.g. a Discord bot that calls ChatGPT needs to respond within a few seconds, which can be too fast for the AI to generate a response. We can instead reply immediately and then update that message later, inTheBackground Simply wrap something in inTheBackground and it will do just that! In this example, we log something a few seconds later than the web response is sent back.
1
neverstew avatar
neverstew
inTheBackground
Script
An interactive, runnable TypeScript val by neverstew
0
neverstew avatar
neverstew
earlyWebReturn
HTTP
This val demonstrates the early response return feature of web vals. It produces two timestamps: one in the response JSON, which returns pretty much straight away one in the logs, three seconds after the response is returned
0
neverstew avatar
neverstew
html
Script
@jsxImportSource npm:preact
0
neverstew avatar
neverstew
htmlResponse
Script
An interactive, runnable TypeScript val by neverstew
0