Search

Results include substring matches and semantically similar vals. Learn more
liamdanielduffy avatar
addReactFromCDN
@liamdanielduffy
An interactive, runnable TypeScript val by liamdanielduffy
Script
import { scriptTag } from "https://esm.town/v/liamdanielduffy/scriptTag";
export function addReactFromCDN(): string {
const reactDom = scriptTag({
src: "https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js",
const react = scriptTag({
src: "https://unpkg.com/react@18/umd/react.production.min.js",
return [react, reactDom].join(" ");
kora avatar
lmsys
@kora
// { RepoFullName: "spaces/lmsys/chatbot-arena-leaderboard" };
Script
import type { Credentials, RepoDesignation } from "npm:@huggingface/hub";
const repo: RepoDesignation = { name: "lmsys/chatbot-arena-leaderboard", type: "space" };
// { RepoFullName: "spaces/lmsys/chatbot-arena-leaderboard" };
const credentials: Credentials = { accessToken: Deno.env.get("HF_TOKEN") };
// const { name: username } = await whoAmI({ credentials });
for await (const fileInfo of listFiles({ repo })) {
console.log(fileInfo);
stevekrouse avatar
browserbase
@stevekrouse
@jsxImportSource npm:hono@3/jsx
HTTP (deprecated)
/** @jsxImportSource npm:hono@3/jsx */
const app = new Hono();
const browserbase = new Browserbase();
function duration(session) {
const startedAt = new Date(session.startedAt).getTime();
if (session.status === "RUNNING") {
return (Date.now() - startedAt) / 1000;
const endedAt = new Date(session.endedAt).getTime();
return (endedAt - startedAt) / 1000;
// Route to list all sessions
liamdanielduffy avatar
buildReactDomMinified
@liamdanielduffy
An interactive, runnable TypeScript val by liamdanielduffy
Script
let { REACT_DOM_MINIFIED_PT4 } = await import("https://esm.town/v/liamdanielduffy/REACT_DOM_MINIFIED_PT4");
let { REACT_DOM_MINIFIED_PT3 } = await import("https://esm.town/v/liamdanielduffy/REACT_DOM_MINIFIED_PT3");
let { REACT_DOM_MINIFIED_PT2 } = await import("https://esm.town/v/liamdanielduffy/REACT_DOM_MINIFIED_PT2");
let { REACT_DOM_MINIFIED_PT1 } = await import("https://esm.town/v/liamdanielduffy/REACT_DOM_MINIFIED_PT1");
export async function buildReactDomMinified() {
const res = await fetch(
"https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js",
const src = await res.text();
const pt1End = src.length / 4;
const pt2End = 2 * pt1End;
nbbaier avatar
honoZodSwaggerUi
@nbbaier
// The OpenAPI documentation will be available at /doc
HTTP (deprecated)
const ParamsSchema = z.object({
id: z
.string()
.min(3)
.openapi({
param: {
name: "id",
in: "path",
example: "1212121",
const UserSchema = z
weaverwhale avatar
FindTrendsUsingGPT
@weaverwhale
An interactive, runnable TypeScript val by weaverwhale
HTTP (deprecated)
const trendGPT = async (data, onData) => {
const openai = new OpenAI();
// Start the OpenAI stream
const chatStream = await openai.chat.completions.create({
messages: [
role: "system",
content: `
You are a helpful assistant for a data analysis.
I have a JSON file with merchant information such as their payment processor, currency, and all associated transactions
The transaction data has the order time, status (fulfilled, pending, declined/refunded), and country/region of origin.
jxnblk avatar
JxnblkApp
@jxnblk
React components for https://val.town/v/jxnblk/dotcom – https://jxnblk.com
Script
React components for <https://val.town/v/jxnblk/dotcom><https://jxnblk.com>
// core react component for jxnblkio
/** @jsxImportSource https://esm.sh/react */
const OGIMAGE = "https://jxnblk-blogogimage.web.val.run/";
const URL = "https://jxnblk.com";
const DESCRIPTION = "Design engineer and aspiring indie game dev based in Brooklyn, NY";
type PostData = {
path: string;
slug: string;
title: string;
pomdtr avatar
guest
@pomdtr
An interactive, runnable TypeScript val by pomdtr
HTTP (deprecated)
export default function() {
return fetch("file:///opt/render/project/src/guest/index.ts");
pablopunk avatar
latestVersion
@pablopunk
An interactive, runnable TypeScript val by pablopunk
Script
export const latestVersion = async (v) => {
const { default: whatVersion } = await import("npm:what-version");
const nodeVersions = await whatVersion("node", v);
return nodeVersions?.[0];
vladimyr avatar
pinkGuanaco
@vladimyr
An interactive, runnable TypeScript val by vladimyr
Script
const { greet } = await import(jsm`
export function greet(name) {
console.log(\`Hello \${name}!\`);
greet("val.town");
const { sum } = await import(tsm`
export function sum(a: number, b: number): number {
return a + b;
console.log(sum(2, 3));
const { shout } = await import(createModuleURL(
`export function shout(name: string) {
all avatar
Countdown
@all
doesn't work, cool css
HTTP (deprecated)
# doesn't work, cool css
// This approach enhances the previous countdown timer by adding a start button and date entry.
// It uses Hono for routing and JSX rendering, and creates a visually appealing countdown timer
// with customizable target date. The design features a circular layout with cool CSS effects.
// The countdown functionality has been fixed to properly update the numbers.
/** @jsxImportSource npm:hono/jsx */
const app = new Hono();
app.get("/", (c) => {
const html = (
<html lang="en">
gunnnnii avatar
caniuse_notifier
@gunnnnii
@jsxImportSource npm:react
Cron
/** @jsxImportSource npm:react **/
const updatedKey = "caniuse-updated-at";
const dataKey = "caniuse-data";
function Feature({ feature }: any) {
const links = feature.links ?? [];
return (
<h2>{feature.title}</h2>
<p>{feature.description}</p>
<p>Full support: {feature.usage_perc_y}%</p>
{feature.usage_perc_a > 0 ? <p>Partial support: {feature.usage_perc_a}%</p> : null}
nbbaier avatar
sqlite_explorer
@nbbaier
An interactive, runnable TypeScript val by nbbaier
HTTP (deprecated)
export { default } from "https://esm.town/v/nbbaier/sqliteExplorerApp?v=86";
pomdtr avatar
invoice_basic_theme
@pomdtr
@jsxImportSource npm:preact
Script
/** @jsxImportSource npm:preact */
export const render: RenderFunc = ({ title, table, to, from, details }) => {
return preactRender(
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{title}</title>
<link rel="icon" href="https://fav.farm/📃" />
<script src="https://cdn.tailwindcss.com"></script>
scio avatar
fooify
@scio
An interactive, runnable TypeScript val by scio
Script
let { foo } = await import("https://esm.town/v/scio/foo");
export let fooify = (value) => {
foo = value;