Search

Results include substring matches and semantically similar vals. Learn more
timlin avatar
html
@timlin
An interactive, runnable TypeScript val by timlin
Script
export let html = (content, options = {}) =>
new Response(content, {
headers: {
"Content-Type": "text/html",
...(options.headers ?? {}),
janpaul123 avatar
valle_tmp_5930671456461067316376022226166
@janpaul123
// This val will respond to HTTP requests with "Hello, World!"
HTTP
// This val will respond to HTTP requests with "Hello, World!"
export default async function (req: Request): Promise<Response> {
return new Response("Hello, World!", { headers: { "Content-Type": "text/plain" } });
neverstew avatar
userVals
@neverstew
An interactive, runnable TypeScript val by neverstew
Script
export function userVals({ token, id }: {
token?: string;
id: string;
}): Promise<{
data: {
id: string;
author: {
id: string;
username: string;
name: string;
mttlws avatar
TodayForTyler
@mttlws
An interactive, runnable TypeScript val by mttlws
Express (deprecated)
export async function TodayForTyler(req: express.Request, res: express.Response) {
const { activity } = await fetchJSON(
"https://www.boredapi.com/api/activity",
return res.send(`
<html>
<head>
<title>Today for Tyler 🥹</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.
<meta name="description" content="Today for Tyler 🥹" />
<meta name="description" content="Today for Tyler 🥹" />
rodrigotello avatar
airquality
@rodrigotello
// Forked from @stevekrouse.aqi
Script
export async function airquality(interval: Interval) {
const location = "brooklyn navy yard"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
if (!interval.lastRunAt) {
console.email(
`You will now get Air Quality alerts for ${location} if it's unhealthy. It is now ${data.aqi} which is ${data.severity}
`AQI Alerts for ${location} setup!`,
if (data.severity.includes("Unhealthy")) {
console.email(
"Air Quality: " + data.severity,
tmcw avatar
tProxy
@tmcw
An interactive, runnable TypeScript val by tmcw
Script
export const tProxy = () => {
const t = t2;
return new Proxy(
get: (target, prop: string) =>
prop in target
? target[prop]
: prop === "then"
? undefined // to avoid ValTown unwrapping the promise, caused the script to hang
: typeof prop !== "string"
? undefined // something is autocalling it with symbol
janpaul123 avatar
valle_tmp_92279164241240222981465199368394
@janpaul123
An interactive, runnable TypeScript val by janpaul123
HTTP
const app = new Hono();
app.get("/", (c) => {
return c.html(`<!DOCTYPE html>
<html>
<head>
<title>Wordle Game</title>
<style>
body {
font-family: 'Comic Sans MS', cursive, sans-serif;
background: linear-gradient(45deg, #ff6ec4, #7873f5);
stevekrouse avatar
webassemblyExample
@stevekrouse
// Forked from @mkeller7.webassemblyExample
Script
export let webassemblyExample = (async () => {
(module
(func (export let "addTwo") (param i32 i32) (result i32)
local.get 0
local.get 1
i32.add))
const source = new Uint8Array([
0, 97, 115, 109, 1, 0, 0, 0, 1, 7, 1, 96, 2, 127, 127, 1, 127, 3, 2, 1, 0,
7, 10, 1, 6, 97, 100, 100, 84, 119, 111, 0, 0, 10, 9, 1, 7, 0, 32, 0, 32, 1,
106, 11, 0, 10, 4, 110, 97, 109, 101, 2, 3, 1, 0, 0,
stevekrouse avatar
rimeExampleUI
@stevekrouse
// https://stevekrouse-rimeExampleUI.express.val.run
Express (deprecated)
import { rimeExample } from "https://esm.town/v/stevekrouse/rimeExample";
// https://stevekrouse-rimeExampleUI.express.val.run
export function rimeExampleUI(req, res) {
res.send(
`<audio controls src="data:audio/ogg;base64,${rimeExample.audioContent}" />`,
pomdtr avatar
html
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
export let html = (content, options = {}) =>
new Response(content, {
headers: {
"Content-Type": "text/html; charset=utf-8",
...(options.headers ?? {}),
cyrilos avatar
tronpickLoop
@cyrilos
// handle incoming requests
Script
const DEFAULT_BETAMOUNT = 0.0002000;
const DEFAULT_MULTIPLIER = 1.01;
const DEFAULT_OPTION = "higher";
const DEFAULT_INCREASE = 100;
const VAL_URL = "https://cyrilos-tronpickloop.web.val.run";
// handle incoming requests
export default async function(req) {
const PLATFORM = "polpick.io";
// const cookies = await blob.getJSON("platforms");
const COOKIES =
janpaul123 avatar
valle_tmp_685210711636907459921294004623906
@janpaul123
// This val will respond to all HTTP requests with "Hello world"
HTTP
// This val will respond to all HTTP requests with "Hello world"
export default async function(req: Request): Promise<Response> {
return new Response("Hello world", {
headers: { "Content-Type": "text/plain" },
gtrufitt avatar
handleChatGPTRequest
@gtrufitt
An interactive, runnable TypeScript val by gtrufitt
Script
export async function handleChatGPTRequest(req: express.Request, res) {
console.log(req.body);
console.email("Ran");
res.end("Success");
janpaul123 avatar
valle_tmp_927670008317521815777284598519392
@janpaul123
// This val responds with "Hello world" to all incoming HTTP requests
HTTP
// This val responds with "Hello world" to all incoming HTTP requests
export default async function main(req: Request): Promise<Response> {
return new Response("Hello world");
jshawl avatar
demo
@jshawl
An interactive, runnable TypeScript val by jshawl
Script
export let demo = (arg) => {
console.log(arg);