Search

Results include substring matches and semantically similar vals. Learn more
temptemp avatar
scarletSole
@temptemp
An interactive, runnable TypeScript val by temptemp
HTTP
interface Context {
url: string;
const app = new Hono();
app.get("/dood/:dood", async (c) => {
const { dood } = c.req.param();
const ctx = { url: "https://d000d.com/e/" + dood };
return c.json(await doodstream(ctx));
app.get("/tape/:tape", async (c) => {
const { tape } = c.req.param();
const ctx = { url: "https://streamtape.com/e/" + tape };
ashokpds15 avatar
cerebrascoderWebApp
@ashokpds15
An interactive, runnable TypeScript val by ashokpds15
HTTP
export default async function server(request: Request): Promise<Response> {
return new Response(`
<!DOCTYPE html>
<html>
<head>
<title>Cerebrascoder</title>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-widt
<link rel="stylesheet" href="https://esm.sh/bootstrap@4.0.0/dist/css/bootstrap.min.css">
<style>
pomdtr avatar
lucia_demo
@pomdtr
@jsxImportSource npm:hono/jsx
HTTP
/** @jsxImportSource npm:hono/jsx **/
const userTable = "user";
const sessionTable = "session";
const adapter = new ValTownAdapter({
user: "user",
session: "session",
export const lucia = new Lucia(adapter, {
getUserAttributes: (attributes) => {
return {
username: attributes.username,
dhvanil avatar
web_mBvDDUywvr
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_mBvDDUywvr(req) {
return new Response(`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Awesome Website</title>
<style>
body {
font-family: 'Arial', sans-serif;
dhvanil avatar
web_QGLg8dmk1o
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_QGLg8dmk1o(req) {
return new Response(`<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Little Website</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; background-color: #f4f4f4; }
h1 { color: #333; }
stevekrouse avatar
dateme_home
@stevekrouse
@jsxImportSource npm:hono@3/jsx
Script
/** @jsxImportSource npm:hono@3/jsx */
export default function Home(c) {
return c.html(
<Layout activeTab={new URL(c.req.url).pathname}>
<div class="max-w-lg mx-auto p-10">
<div class="mb-10">
<div class="text-4xl font-bold mb-4">
Date thoughtfully
</div>
<div class="text-lg ">
gigmx avatar
compassionateBlackCatfish
@gigmx
// Add a separate API route handler for chat
HTTP
export default async function(req: Request): Promise<Response> {
const LEPTON_API_TOKEN = Deno.env.get('LEPTON_API_TOKEN') || '';
return new Response(
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quantum AI Interface</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2/dist/tailwind.min.css" rel="stylesheet">
yejun avatar
bbrun
@yejun
A simple chat app harness for your board Provides a very simple chat app UI for a Breadboard board. For now, requires you to be running a board server. This harness actually acts as a proxy to the board server run API endpoint , and puts a nice (well, somewhat nice) frontend on top of it. The frontend is somewhat limited in what it can show, currently supporting only LLMContent and array of LLMContent outputs, and only LLMContent array input. The script will look for the BB_LIVE_KEY in your Val Town environment, which must contain your board server API key. To use, create an HTTP val, then import the proxy function from this script and call it like this: import { proxy } from "https://esm.town/v/dglazkov/bbrun"; export default proxy( "url-to-the-board.bgl.json", );
Script
# A simple chat app harness for your board
Provides a very simple chat app UI for a [Breadboard](https://breadboard-ai.web.app/) board.
For now, requires you to be running a board server. This harness actually acts
as a proxy to the board server [run API endpoint](https://breadboard-ai.github.io/breadboard/docs/reference/board-run-api-end
and puts a nice (well, somewhat nice) frontend on top of it.
The frontend is somewhat limited in what it can show, currently supporting only
const DEFAULT_FRONTEND_MODULE = "https://esm.town/v/yejun/bbrun";
* You can supply these options as a second argument to the `proxy` function.
* These options are used to configure the frontend.
export type FrontendOptions = {
andreterron avatar
graffitiWebsite
@andreterron
// Forked from @andreterron.genval
HTTP
export let graffitiWebsite = async (req: express.Request, res: express.Response) => {
const { default: htm } = await import("npm:htm");
const { default: vhtml } = await import("npm:vhtml");
const html = htm.bind(vhtml);
const head = html`<head>
<title>Graffiti Wall</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/htmx.org@1.9.2"></script>
tr3ntg avatar
publicDocumentEditor
@tr3ntg
An interactive, runnable TypeScript val by tr3ntg
Script
export async function publicDocumentEditor(
req: express.Request,
res: express.Response,
let html =
`<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Editor.js ๐Ÿคฉ๐Ÿงฆ๐Ÿคจ example</title> <link href="https:/
res.send(html);
dhvanil avatar
web_vUijVegdsR
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_vUijVegdsR(req) {
return new Response(`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>๐Ÿงœโ€โ™€๏ธ Unhinged Mermaid Diagram Extravaganza ๐ŸŒŠ</title>
<style>
body {
font-family: 'Comic Sans MS', cursive;
iamseeley avatar
SubmitLogin
@iamseeley
An interactive, runnable TypeScript val by iamseeley
Script
/** @jsx jsx */
/** @jsxFrag Fragment */
const SubmitLogin = async (c) => {
try {
const body = await c.req.parseBody();
const username = body["username"];
const password = body["password"];
const checkUser = await sqlite.execute({
sql: `SELECT * FROM users WHERE username = ?`,
args: [username],
adagradschool avatar
claude_d482d9ee_eff3_42e6_9779_a012b1e1f7b4
@adagradschool
An interactive, runnable TypeScript val by adagradschool
HTTP
export default function handler(req) {
return new Response(`"\n <!DOCTYPE html>\n <html>\n <head>\n <title>Claude Chat Conversation</title
headers: {
"Content-Type": "text/html",
dhvanil avatar
val_Rb1F0hdOA9
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_Rb1F0hdOA9(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const visualizeData = (data) => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext(
// Return the result in a properly formatted response
return new Response(JSON.stringify({
result: result,
type: typeof result
headers: { 'Content-Type': 'application/json' }
ngmi avatar
humansnap
@ngmi
An interactive, runnable TypeScript val by ngmi
HTTP
const KEY = new URL(import.meta.url).pathname.split("/").at(-1);
const ADMIN_PASSWORD = Deno.env.get("ADMIN_PASSWORD") || "defaultpassword"; // Set this in your Val Town environment variable
async function initializeDatabase() {
await sqlite.execute(`
CREATE TABLE IF NOT EXISTS ${KEY}_emails (
id INTEGER PRIMARY KEY AUTOINCREMENT,
email TEXT NOT NULL UNIQUE,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
async function addEmail(email: string) {
await sqlite.execute(`INSERT OR IGNORE INTO ${KEY}_emails (email) VALUES (?)`, [email]);
โ€ฆ
123
โ€ฆ
Next