Search
val_5VEO1wb44f
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_5VEO1wb44f(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
// Test floating point arithmetic anomaly
const standardTest = () => {
const result1 = 0.1 + 0.2;
const result2 = 0.1 + 0.2 + 0.7;
const result3 = 0.3333333333333333 + 0.6666666666666666;
return {
YouTubeSubmissions
@mvmattgray
// This approach uses HTML for the form and Blob storage for persistence.
HTTP
// This approach uses HTML for the form and Blob storage for persistence.
// We'll use the built-in Request and Response objects for handling HTTP.
// The form fields are customized for video information collection.
// We'll add JSON API endpoints for Framer Fetch integration.
const KEY = new URL(import.meta.url).pathname;
export default async function main(req: Request): Promise<Response> {
const url = new URL(req.url);
// API endpoints for Framer Fetch
if (url.pathname === "/api/entries") {
if (req.method === "GET") {
val_PD4HJdJdVj
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_PD4HJdJdVj(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const testPrecision = (largeNum, smallNum, iterations) => {
let result = largeNum;
for (let i = 0; i < iterations; i++) {
result += smallNum;
return result;
const largeNumber = 1e20;
atlas
@jdan
An interactive, runnable TypeScript val by jdan
HTTP
const app = new Hono();
app.get("/", async (c) => {
const countries = await countryData();
console.log(countries);
return c.html(`
<ol>
countries.map(({ countryLabel }) => `
<li>
<a href="/${countryLabel}">${countryLabel}</a>
</li>
googleiframeembed
@yawnxyz
An interactive, runnable TypeScript val by yawnxyz
HTTP
export default async function (req: Request): Promise<Response> {
const html = `
<!DOCTYPE html>
<html>
<head>
<title>Example.com Frame</title>
</head>
<body>
<iframe
src="https://docs.google.com/viewer?url=https%3A%2F%2Fjournals.plos.org%2Fplosbiology%2Farticle%2Ffile%3Fid%3D10.1371%2Fjournal.pbio.3002119%26type%3Dprintable&embedded=true"
emailMeIfDynamiclandWebsiteHasUpdated
@janpaul123
An interactive, runnable TypeScript val by janpaul123
Cron
import { email } from "https://esm.town/v/std/email?v=12";
export default async function(interval: Interval) {
const dynamiclandWebsiteHash = await blob.getJSON("dynamiclandWebsiteHash");
const newHash = await getHashForUrl("https://dynamicland.org/");
if (newHash !== dynamiclandWebsiteHash) {
console.log("New hash found!", { dynamiclandWebsiteHash, newHash });
await blob.setJSON("dynamiclandWebsiteHash", newHash);
await email({ text: `Dynamicland website has changed! New hash: ${newHash}` });
} else {
console.log("Hash is the same, no email sent.", { dynamiclandWebsiteHash });
formStyles
@iamseeley
An interactive, runnable TypeScript val by iamseeley
Script
export const formStyles = `
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
background-color: #f8f9fa;
margin: auto;
padding: 20px;
color: #212529;
max-width: 624px;
header {
padding-top: .25rem;
HonoHTMX
@iamseeley
A list of all the vals used in my hono + htmx site ~ thanks to @mxdvl for making the val to show many vals
HTTP
A list of all the vals used in my hono + htmx site
~ thanks to @mxdvl for making the val to show many vals
const vals = await Promise.all(
"iamseeley/Server2",
"iamseeley/RootLayout",
"iamseeley/LandingPage",
"iamseeley/EditProfilePage",
"iamseeley/ProfilePage",
"iamseeley/SubmitSignup",
"iamseeley/SubmitLogin",
njuskaloIndex
@kajgod
Njuškalo Crawler Admin Admin frontend for Njuškalo Crawler
use + and ' to add/remove search strings enter password next to submit button check that you have set up your crawler correctly
Express (deprecated)
## Njuškalo Crawler Admin
Admin frontend for [Njuškalo Crawler](https://www.val.town/v/kajgod.njuskaloCrawl)
![Admin](https://i.imgur.com/koeBeYZ.png)
- use + and ' to add/remove search strings
- enter password next to submit button
- check that you have set up your [crawler](https://www.val.town/v/kajgod.njuskaloCrawl) correctly
export async function njuskaloIndex(req: express.Request, res: express.Response) {
let len = 3; // default number of elements, can be overrun on frontend
let keywords: string[] = [];
let { data, emptyDetails, fillEmpty, newKeywords, defaultData } =
val_WYIvLkEalH
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_WYIvLkEalH(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const balancedParenthesesRegex = /^\((?:[^()]*|(?R))*\)$/;
const validCases = [
const invalidCases = [
const testCases = (regex, cases) => {
return cases.map(testCase => ({
input: testCase,
windsurf_contextManager
@toowired
// Initialize SQLite database
Script
// Initialize SQLite database
const db = new DB();
db.execute(`
CREATE TABLE IF NOT EXISTS context (
id INTEGER PRIMARY KEY AUTOINCREMENT,
phase TEXT,
active_blocks TEXT,
pending_tasks TEXT,
recent_changes TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
val_Wn1wUAIHFR
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_Wn1wUAIHFR(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const calculatePi = (iterations) => {
let pi = 0;
let divisor = 1;
for (let i = 0; i < iterations; i++) {
pi += (i % 2 === 0 ? 1 : -1) / divisor;
divisor += 2;
handleDiscordInteraction
@meshack254
An interactive, runnable TypeScript val by meshack254
Script
export const handleDiscordInteraction = async (req: Request) => {
const body = await req.json();
const verified = await verify_discord_signature(
process.env.discordPublicKey,
JSON.stringify(body),
req.headers.get("X-Signature-Ed25519"),
req.headers.get("X-Signature-Timestamp"),
if (!verified)
return new Response("signature invalid", {
status: 401,
responsibleCyanCheetah
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP
export default async function(req: Request): Promise<Response> {
return Response.json({ ok: true });
valle_tmp_91627087308079262770766558032982
@janpaul123
An interactive, runnable TypeScript val by janpaul123
HTTP
export default async function main(req: Request): Promise<Response> {
// Return a basic HTML response with "Hello, World!" message
return new Response("<h1>Hello, World!</h1>", {
headers: { "Content-Type": "text/html" }