Search
podcast
@all
@jsxImportSource https://esm.sh/react
HTTP
"California: 200,000 homeless, 2 million unregistered citizens, 40% all financially burdened. 3.5 million homes needed by 2025",
function App() {
const [personality1, setPersonality1] = useState(PRESET_PODCASTS[0].personality1);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
client();
export default async function server(req: Request): Promise<Response> {
const url = new URL(req.url);
if (url.searchParams.has("nextMessage")) {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const { personality1, personality2, topic, conversation, currentSpeaker } = await req.json();
const currentPersonality = currentSpeaker === 1 ? personality1 : personality2;
const response = await openai.chat.completions.create({
messages: [
![colebemis avatar](https://images.clerk.dev/oauth_github/img_2SAfl8PcnKlw8fe22w3yS8SQ79C.jpeg)
myApi
@colebemis
An interactive, runnable TypeScript val by colebemis
Script
export function myApi(name) {
return "hi " + name;
myApi
@hovavo
An interactive, runnable TypeScript val by hovavo
HTTP
export function myApi(name) {
return "hi " + name;
myApi
@joshbeckman
An interactive, runnable TypeScript val by joshbeckman
Script
export function myApi(name) {
return "hi " + name;
apricotSloth
@tmcw
Usage curl https://karfau.web.val.run
Script
import { Core, core } from "npm:@google-labs/core-kit@0.5.0";
const { result } = core.runJavascript({
code: "function name() { return \"Hello\"; }",
"name": "name",
const output = base.output({});
cerebras_coder
@swethard
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";
function extractCodeFromFence(content: string): string {
const codeMatch = content.match(/```html\n([\s\S]*?)```/);
return codeMatch ? codeMatch[1].trim() : content;
async function generateCode(prompt: string, currentCode: string) {
const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
totalTokens: completion.usage?.completion_tokens || 1,
export default async function cerebras_coder(req: Request): Promise<Response> {
// Handle API requests for code generation
'Content-Type': 'text/html',
function App() {
const [prompt, setPrompt] = useState('');
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
![third774 avatar](https://images.clerk.dev/oauth_github/img_2SdK0sGf8isQzNVOoPW1izdeZJq.jpeg)
myApi
@third774
An interactive, runnable TypeScript val by third774
Script
export function myApi(name) {
return "hi " + name;
![dubinets avatar](https://secure.gravatar.com/avatar/9e1edcd9c2bc4184274267c05e7f1bea.jpg?s=200&d=identicon)
myApi
@dubinets
An interactive, runnable TypeScript val by dubinets
Script
export function myApi(name) {
return "hi " + name;
![qaispalekar avatar](https://images.clerk.dev/oauth_github/img_2TZPVKdAfXZPZ5Ot5PizMnzEQPM.jpeg)
myApi
@qaispalekar
An interactive, runnable TypeScript val by qaispalekar
Script
export function myApi(name) {
return "hi " + name;
val_sCetmNkuVK
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_sCetmNkuVK(req) {
try {
// Execute the code directly and capture its result
workers
@temptemp
@jsxImportSource npm:hono/jsx
HTTP
"Referrer-Policy": "strict-origin-when-cross-origin",
async function uuidGen() {
const randomBytes = CryptoJS.lib.WordArray.random(16);
return hex;
export async function boundGen() {
const randomBytes = CryptoJS.lib.WordArray.random(16);
return boundary;
async function formDataGen(files: File[]) {
const boundary = await boundGen();
body,
async function upload(formData: any, user: string) {
const _ = await fetch("https://workers.cloudflare.com/playground/api/worker", {
![saolsen avatar](https://images.clerk.dev/oauth_github/img_2QtXHzN3gDPhKsBOvKsst8LTxC5.png)
wabt_import
@saolsen
An interactive, runnable TypeScript val by saolsen
Script
const importObject = {};
WebAssembly.instantiate(module.toBinary({}).buffer, importObject).then(
function (res) {
console.log(res.instance.exports.add(5, 3));
![zpnichols avatar](https://images.clerk.dev/oauth_github/img_2TMmRc8r2wp50ClciBcPF9taIGL.jpeg)
myApi
@zpnichols
An interactive, runnable TypeScript val by zpnichols
Script
export function myApi(name) {
return "hi " + name;
sparql
@jdan
An interactive, runnable TypeScript val by jdan
Script
export async function sparql(query) {
const url = `https://query.wikidata.org/sparql?query=${encodeURIComponent(query)}`;
const res = await fetch(url, {
oss_pledge
@std
An interactive, runnable TypeScript val by std
HTTP
"name": "Val Town",
"urlSquareLogoWithBackground": "https://avatars.githubusercontent.com/u/114268765?s=200&v=4",
"description": "Val Town is a website to build apps, APIs, and scheduled functions.",
"urlLearnMore": "https://blog.val.town/blog/oss",
"annualReports": [
"monetaryValueOfTime": 0,
"monetaryValueOfMaterials": 0,
export default async function(req: Request): Promise<Response> {
return Response.json(data);