Search

Results include substring matches and semantically similar vals. Learn more
alp avatar
kyDoesNotWorkDemo
@alp
An interactive, runnable TypeScript val by alp
Script
export const kyDoesNotWorkDemo = (async () => {
const ky = await import("npm:ky");
console.log("has get method:", ky.get === undefined ? "❌" : "✅");
console.log("has post method:", ky.get === undefined ? "❌" : "✅");
console.log(`available methods: [${Object.keys(ky).join(",")}]`);
const { post } = await import("npm:ky");
console.log(
"has post method if imported directly:",
post === undefined ? "❌" : "✅"
vawogbemi avatar
dateme_home
@vawogbemi
@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">
I'm looking for a Man In Finance.
</div>
<div class="text-lg ">
stevekrouse avatar
tableify
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export const tableify = async (data: any) => {
var { default: tableify } = await import("npm:tableify");
return tableify(data);
liamdanielduffy avatar
REACT_MINIFIED
@liamdanielduffy
// set by liamdanielduffy.buildReactMinified at 2023-06-01T12:15:21.371Z
Script
// set by liamdanielduffy.buildReactMinified at 2023-06-01T12:15:21.371Z
export let REACT_MINIFIED = "/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its
kuomory avatar
violetWarbler
@kuomory
An interactive, runnable TypeScript val by kuomory
HTTP (deprecated)
import Koa from "npm:koa";
const app = new Koa();
app.use((ctx: Koa.Context) => {
ctx.body = "Hello, Koa!";
app.listen(3000);
anthonyec avatar
spotify
@anthonyec
// Uncomment this line for one run of the Val to create the DB lol
HTTP (deprecated)
// Uncomment this line for one run of the Val to create the DB lol
// await sqlite.execute(`create table if not exists SPOTIFY_AUTH_2(id text primary key, data text)`);
export const db = drizzle(sqlite as any);
export const table = sqliteTable("SPOTIFY_AUTH_2", {
id: text("id").primaryKey(),
data: text("data"),
const thisURL = thisWebURL();
const redirect_uri = thisURL + "/callback";
export let spotifyRequestToken = ({ client_id, client_secret, code, redirect_uri }) =>
fetchJSON("https://accounts.spotify.com/api/token", {
breeze4 avatar
bigFuchsiaHalibut
@breeze4
* This React app creates a search interface with a navbar and two equal-width panels. * It includes a search input on the left and displays search results as cards on the right. * The search functionality is simulated with a static list of items.
HTTP
* This React app creates a search interface with a navbar and two equal-width panels.
* It includes a search input on the left and displays search results as cards on the right.
* The search functionality is simulated with a static list of items.
/** @jsxImportSource https://esm.sh/react */
// Simulated data for search results
const items = [
{ id: 1, title: "Apple", body: "A sweet, edible fruit produced by an apple tree.", footer: "Fruit" },
{ id: 2, title: "Banana", body: "An elongated, edible fruit produced by several kinds of large herbaceous flowering plants.
{ id: 3, title: "Cherry", body: "A fruit of many plants of the genus Prunus, and is a fleshy drupe (stone fruit).", footer:
{ id: 4, title: "Date", body: "The fruit of the date palm tree, which is cultivated for its sweet fruit.", footer: "Fruit"
yawnxyz avatar
htmxGenFormsExample
@yawnxyz
An interactive, runnable TypeScript val by yawnxyz
HTTP (deprecated)
/** @jsx jsx **/
const app = new Hono();
const assets = {
emailForm: `
<form id="emailForm" class="space-y-4">
<label for="email" class="block text-sm font-medium text-gray-700">Email:</label>
<input type="email" id="email" name="email" required class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-
<button type="submit" class="mt-3 inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium roun
</form>
// Add more HTML assets here if needed
ejfox avatar
extremePlumCaribou
@ejfox
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
function App() {
const [vals, setVals] = useState([]);
const [error, setError] = useState(null);
const [loading, setLoading] = useState(true);
const [debugInfo, setDebugInfo] = useState([]);
const [username, setUsername] = useState("");
const handleValClick = (valId) => {
window.open(`https://val.town/v/${valId}`, '_blank');
useEffect(() => {
janpaul123 avatar
valle_tmp_069034869725444597641897580363524
@janpaul123
// Define the key for blob storage
HTTP (deprecated)
// Define the key for blob storage
const STORIES_KEY = "hn_stories";
const INITIAL_STORIES = 30;
// Generate some sample stories to start with
async function initStories() {
const stories = [];
for (let i = 1; i <= INITIAL_STORIES; i++) {
stories.push({
id: i,
title: `Sample Story ${i}`,
rei avatar
notif
@rei
An interactive, runnable TypeScript val by rei
Script
export let notif = () => {
console.email("hello mario!");
stevekrouse avatar
lastlogin_demo
@stevekrouse
HTTP (deprecated)
![Screenshot 2024-08-08 at 08.48.41.gif](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7442086d-36b2-454d-bd5f-3c28615e900
/** @jsxImportSource npm:hono@3/jsx */
const app = new Hono();
app.get("/", (c) => {
const email = c.req.header("X-LastLogin-Email");
if (email) {
return c.html(
<div>
<h1>Welcome, {email}!</h1>
<a href="/auth/logout">Logout</a>
stevekrouse avatar
valwriter
@stevekrouse
[ ] streaming [ ] send the code of the valwriter back to gpt (only if it's related, might need some threads, maybe a custom gpt would be a better fix, of course, could do it as a proxy...) [ ] make it easy to send errors back to gpt [ ] make it easy to get screenshots of the output back to gpt
HTTP (deprecated)
- [ ] streaming
- [ ] send the code of the valwriter back to gpt (only if it's related, might need some threads, maybe a custom gpt would be
- [ ] make it easy to send errors back to gpt
- [ ] make it easy to get screenshots of the output back to gpt
/** @jsxImportSource npm:hono@3/jsx */
const examples = [
user: "website that shows the current time",
content: `/** @jsxImportSource npm:react */
export default function() {
return <h1>{new Date().toLocaleTimeString()}</h1>;
stwind avatar
penrose
@stwind
Example from Using Penrose with Vanilla JS | Penrose
HTTP (deprecated)
Example from [Using Penrose with Vanilla JS | Penrose](https://penrose.cs.cmu.edu/docs/ref/vanilla-js)
const trio = {
substance: `
Set A
Label A $e=mc^2$
style: `
canvas {
width = 150
height = 150
forall Set A {
vawogbemi avatar
short
@vawogbemi
Short URLs A URL shortener in Val Town! This turns URLs into strings like https://vawogbemi-short.web.val.run/JK An implementation of https://www.val.town/v/tmcw/short It uses SQL instead of express persistent storage. Table Schema Short(id INT, url TEXT)
HTTP
# Short URLs
A URL shortener in Val Town! This turns URLs into strings like
```https://vawogbemi-short.web.val.run/JK```
An implementation of https://www.val.town/v/tmcw/short
It uses SQL instead of express persistent storage.
## Table Schema
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
const app = new Hono();
const sqids = new Sqids();
app.get("/", (c) => {