Search
web_sirdp0W9N6
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_sirdp0W9N6(req) {
return new Response(`<!DOCTYPE html>
<html>
myApi
@herveDarritchon
An interactive, runnable TypeScript val by herveDarritchon
Script
export function myApi(name) {
return "hi " + name;
falDemoApp
@mda1125
@jsxImportSource https://esm.sh/react
HTTP
import { falProxyRequest } from "https://esm.town/v/stevekrouse/falProxyRequest";
function App() {
const [prompt, setPrompt] = useState("");
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(req: Request): Promise<Response> {
const url = new URL(req.url);
web_LNXn0B7C9x
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_LNXn0B7C9x(req) {
return new Response(`<!DOCTYPE html>
<html>
kindApricotAnglerfish
@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>\n <meta charset=\"UTF-8\">\n <style>\n body {\n font-family: system-ui, -apple-system, sans-serif;\n line-height: 1.5;\n max-width: 800px;\n margin: 0 auto;\n padding: 20px;\n background: #f9fafb;\n }\n .message {\n margin: 20px 0;\n padding: 15px;\n border-radius: 8px;\n }\n .human {\n background: #e5e7eb;\n }\n .assistant {\n background: #dbeafe;\n }\n .role {\n font-weight: bold;\n margin-bottom: 8px;\n }\n </style>\n </head>\n <body>\n \n <div class=\"message human\">\n <div class=\"role\">Human</div>\n <div class=\"content\">export default function handler(req) {\n return new Response(\n <!DOCTYPE html>\n <html>\n <head>\n <title>Claude Chat Conversation</title>\n <meta charset="UTF-8">\n <style>\n body {\n font-family: system-ui, -apple-system, sans-serif;\n line-height: 1.5;\n max-width: 800px;\n margin: 0 auto;\n padding: 20px;\n background: #f9fafb;\n }\n .message {\n margin: 20px 0;\n padding: 15px;\n border-radius: 8px;\n }\n .human {\n background: #e5e7eb;\n }\n .assistant {\n background: #dbeafe;\n }\n .role {\n font-weight: bold;\n margin-bottom: 8px;\n }\n </style>\n </head>\n <body> <div class="message human">\n <div class="role">Human</div>\n <div class="content">so, how was your day</div>\n </div> <div class="message assistant">\n <div class="role">Claude</div>\n <div class="content">I aim to have authentic conversations while being direct about my nature as an AI. While I appreciate the friendly question, I should note that I don't actually experience days in the way humans do. I'd be happy to hear about your day though, or to help you with any questions or tasks you might have.</div>\n </div> </body>\n, {\n headers: {\n \"Content-Type\": \"text/html\",\n },\n });\n }What is the issue with this?</div>\n </div>\n \n <div class=\"message assistant\">\n <div class=\"role\">Claude</div>\n <div class=\"content\">Let me help you fix this code. There are a few syntax issues with the current implementation.\nFixed Next.js API HandlerClick to open code\nThe main issues with the original code were:\n\nThe HTML string was not properly formatted - it was directly inserted after the Response( without being enclosed in quotes or backticks\nHTML entities were escaped (<, >, ") when they should have been regular characters (<, >, \")\nNo proper string formatting was used (should use template literals with backticks for multiline strings in JavaScript)\n\nThe fixed version:\n\nUses a template literal (backticks) to properly contain the multiline HTML string\nUses proper HTML syntax without escaped entities\nProperly separates the HTML string from the Response constructor\nMaintains proper indentation for readability\nKeeps the same functionality but in a syntactically correct way\n\nThis should now work correctly as a Next.js API route handler that returns an HTML page.</div>\n </div>\n \n <div class=\"message assistant\">\n <div class=\"role\">Claude</div>\n <div class=\"content\">Looking at the JSON object, the endpoint URL can be found at obj.val.links.endpoint, which is:\nhttps://adagradschool-claude_d482d9ee_eff3_42e6_9779_a012b1e1f7b4.web.val.run</div>\n </div>\n \n </body>\n </html>\n"`, {
headers: {
"Content-Type": "text/html",
![morten_holm avatar](https://images.clerk.dev/oauth_github/img_2RST6Eqe5JYBzFuo67Mpi1CSjHC.png)
myApi
@morten_holm
An interactive, runnable TypeScript val by morten_holm
Script
export function myApi(name) {
return "hi " + name;
![liyipoe avatar](https://images.clerk.dev/oauth_github/img_2QxPGNUMoQbuHoPJOT4M0dCB6Zq.jpeg)
myApi
@liyipoe
An interactive, runnable TypeScript val by liyipoe
Script
export function myApi(name) {
return "hi " + name;
cerebras_coder
@shyaankhan
This is an AI code assistant powered by Cerebras , running llama3.3-70b. Inspired by Hassan's Llama Coder . Setup Sign up for Cerebras Get a Cerebras API Key Save it in a Val Town environment variable called CEREBRAS_API_KEY Todos I'm looking for collaborators to help. Fork & send me PRs! [ ] Experiment with two prompt chain (started here )
HTTP
import { STARTER_PROMPTS } from "https://esm.town/v/stevekrouse/cerebras_coder_prompts";
// All previous client-side code remains the same...
export default async function cerebras_coder(req: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
const url = new URL(req.url);
![rodrigotello avatar](https://images.clerk.dev/uploaded/img_2Q1sy7hYih37Ssro2ac4uxgyWtH.png)
welcomeEmail
@rodrigotello
An interactive, runnable TypeScript val by rodrigotello
Script
<h3>What is a val?</h3>
<p>A val is small JavaScript or TypeScript snippet of code, written in the browser and run in our servers.
Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.<p>
</li>
<li style="margin-bottom:32px">
<li style="margin-bottom:6px">Reference your vals: <div style="${CSScodeStyling};">@me.fizz.split('buzz').length</div></li>
<li style="margin-bottom:6px">Reference others' vals: <div style="${CSScodeStyling};">@stevekrouse.moreBuzz()</div></li>
<li style="margin-bottom:6px">Reference personal secrets: <div style="${CSScodeStyling};">@me.secrets.openai</div></li>
<li style="margin-bottom:6px">Import from npm: <div style="${CSScodeStyling};">const _ = await import("npm:lodash-es")</div></li>
<li>Run keyboard shortcut: <div style="${CSScodeStyling};">cmd+enter</div></li>
foo
@tmm
An interactive, runnable TypeScript val by tmm
Script
export async function foo() {
const { createPublicClient, http } = await import("npm:viem");
const { mainnet } = await import("npm:viem/chains");
myApi
@norkin
An interactive, runnable TypeScript val by norkin
Script
export function myApi(name) {
return "hi " + name;
LetMeIntoLinear
@jxxe
An interactive, runnable TypeScript val by jxxe
Cron
import { email } from "https://esm.town/v/std/email";
export default async function(interval: Interval) {
const course = "MATH 0520";
const term = "202420";
val_b1fGFNEZW2
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_b1fGFNEZW2(req) {
try {
// Execute the code directly and capture its result
// Exploit combining precision and temporal glitches
const temporalPrecisionExploit = () => {
// Create a function that forces temporal quantum snapping
const forceTimeSnap = (timestamp) => {
const quantum = 100; // Observed quantum size