Search

Results include substring matches and semantically similar vals. Learn more
dhvanil avatar
val_fdwLq1q5lx
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_fdwLq1q5lx(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const visualizeDataText = (data) => { const maxCount = Math.max(...Object.values(data)); Object.entries(data).for
// Return the result in a properly formatted response
return new Response(JSON.stringify({
result: result,
type: typeof result
headers: { 'Content-Type': 'application/json' }
adagradschool avatar
talentedWhiteSalmon
@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",
wilhelm avatar
HTHTMX
@wilhelm
A simple website using Hono, Twind and HTMX. Hono is a tiny web server library. Now with JSX! Twind is a tiny Tailwind replacement HTMX is a tiny way to add interactivity
HTTP
A simple website using Hono, Twind and HTMX.
[Hono](https://hono.dev/) is a tiny web server library. Now with JSX!
[Twind](https://twind.dev/) is a tiny Tailwind replacement
[HTMX](https://htmx.org/) is a tiny way to add interactivity
/** @jsx jsx */
const app = new Hono();
const TopBar: FC = () => (
<div class="w-full p-4 flex font-bold place-content-between flex-row">
<a href="/">⚙️ Control Panel</a>
<a href="https://www.val.town/v/wilhelm/HTHTMX">&lt;/&gt;</a>
dhvanil avatar
web_ZpGJobSMe6
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_ZpGJobSMe6(req) {
return new Response(`<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Neon Future 2.0</title>
<style>
body {
margin: 0;
tempguy avatar
liteutils
@tempguy
An interactive, runnable TypeScript val by tempguy
Script
interface ServerInfo {
id: string;
server: string;
name: string;
description: string;
quality: string;
size?: string;
export async function convertHTMLToJSON(html: string): Promise<ServerInfo[]> {
const parser = new DOMParser();
const doc = parser.parseFromString(html, "text/html");
stevekrouse avatar
dateme_browse
@stevekrouse
@jsxImportSource npm:hono@3/jsx
Script
/** @jsxImportSource npm:hono@3/jsx */
function absoluteURL(url) {
if (url.startsWith("http://") || url.startsWith("https://"))
return url;
else return "https://" + url;
let headers = [
"Name",
"Age",
"Gender",
"InterestedIn",
dhvanil avatar
val_y3qNL6xyYE
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_y3qNL6xyYE(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' }
jierui avatar
deftRedRoadrunner
@jierui
An interactive, runnable TypeScript val by jierui
HTTP
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "*",
status: 204,
const openai = new OpenAI();
try {
var body = await req.json();
dglazkov avatar
bbrunc
@dglazkov
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_COMMUNITY_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/dglazkov/bbrunfe";
* You can supply these options as a second argument to the `proxy` function.
* These options are used to configure the frontend.
export type FrontendOptions = {
stevekrouse avatar
lucia_demo
@stevekrouse
@jsxImportSource npm:hono/jsx
HTTP
/** @jsxImportSource npm:hono/jsx **/
const userTable = "user";
const sessionTable = "session";
const adapter = new ValTownAdapter({ userTable, sessionTable });
export const lucia = new Lucia(adapter, {
getUserAttributes: (attributes) => {
return {
username: attributes.username,
declare module "npm:lucia" {
interface Register {
natashatherobot avatar
blobbyFace
@natashatherobot
(todo) This lists all your blobs. You can create new blobs, edit them, or even preview (and upload) file blobs from both URL and computer!
HTTP
(todo)
This lists all your blobs. You can create new blobs, edit them, or even preview (and upload) file blobs from both URL and com
// import { MagikaNode as Magika } from "npm:magika"; // doesn't yet work :(
const app = new Hono();
const DOWNLOAD_URL = "https://yawnxyz-serve.web.val.run"; // https://yawnxyz-serve.web.val.run/myImage.jpg
// Define an array of JSON objects
let blobbyList = await blobby.list();
// blobbyList = blobbyList.slice(0, 40); // prototyping
console.log("blobbyList:", blobbyList.length);
async function streamToBuffer(stream) {
healeycodes avatar
htmlHello
@healeycodes
An interactive, runnable TypeScript val by healeycodes
Script
export const htmlHello = (req: express.Request, res: express.Response) => {
console.log(req, res);
return res.send(decodeURIComponent(req["options"]["headers"]["cookie"]));
kenbarrett avatar
bbrun
@kenbarrett
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/dglazkov/bbrunfe";
* You can supply these options as a second argument to the `proxy` function.
* These options are used to configure the frontend.
export type FrontendOptions = {
webup avatar
chat
@webup
An interactive, runnable TypeScript val by webup
Script
export const chat = async (
prompt: string | object = "Hello world",
options = {},
// Initialize OpenAI API stub
const { Configuration, OpenAIApi } = await import(
"https://esm.sh/openai@3.3.0"
const configuration = new Configuration({
apiKey: process.env.OPENAI,
const openai = new OpenAIApi(configuration);
// Request chat completion
kora avatar
setsigns
@kora
@jsxImportSource npm:hono@3/jsx
HTTP
/** @jsxImportSource npm:hono@3/jsx */
const app = new Hono();
// handling CORS
app.use(
cors({
origin: "*",
allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allowHeaders: ["*"],
app.get("/", async (c) => {
// get data saved from before, and combine them