Search

Results include substring matches and semantically similar vals. Learn more
jbwinters avatar
ForestryFinancialModel
@jbwinters
// Interactive forestry financial model simulator.
HTTP
// Interactive forestry financial model simulator.
// It will use React for the UI, recharts for data visualization, and custom slider components.
// The server will render the initial HTML, and the client-side JavaScript will handle the interactivity.
/** @jsxImportSource https://esm.sh/react */
// Custom Slider component
const Slider = ({ value, onChange, min, max, step }) => (
<input
type="range"
min={min}
max={max}
stevekrouse avatar
solidExample
@stevekrouse
@jsxImportSource https://esm.sh/solid-jsx
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/solid-jsx */
import { renderToString } from "npm:solid-js/web";
export const solidExample = async () =>
new Response(await renderToString(() => <div>Test {1 + 1}</div>), {
headers: {
"Content-Type": "text/html",
movienerd avatar
clickerGame
@movienerd
* This clicker game allows users to earn virtual money by clicking. * It includes an upgrade system where users can purchase multiple auto-clickers, dime-smithers, quarter-makers, dollar-mills, twoonie-transformers, fiver-factories, ten-trackers, twenty-detectors, fifty-forgers, and hundred-hewers. * Each upgrade adds to the overall effect, increasing earnings per second. * Upgrades are hidden until they are unlocked for the first time. * The game state is stored client-side using localStorage for persistence. * React is used for the UI, and setInterval for the auto-upgrade functionality.
HTTP
* This clicker game allows users to earn virtual money by clicking.
* It includes an upgrade system where users can purchase multiple auto-clickers, dime-smithers, quarter-makers, dollar-mills
* Each upgrade adds to the overall effect, increasing earnings per second.
* Upgrades are hidden until they are unlocked for the first time.
* The game state is stored client-side using localStorage for persistence.
* React is used for the UI, and setInterval for the auto-upgrade functionality.
/** @jsxImportSource https://esm.sh/react */
function App() {
const [money, setMoney] = useState(() => {
const saved = localStorage.getItem('money');
nbbaier avatar
sqliteExplorerApp_DEV
@nbbaier
SQLite Explorer (Dev Branch) View and interact with your Val Town SQLite data. It's based off Steve's excellent SQLite Admin val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by LibSQL Studio by invisal . This is now more an SPA, with tables, queries and results showing up on the same page. Install Install the latest stable version (v66) by forking this val: Authentication Login to your SQLite Explorer with password authentication with your Val Town API Token as the password. Todos / Plans [ ] improve error handling [ ] improve table formatting [ ] sticky table headers [x] add codemirror [ ] add loading indication to the run button (initial version shipped) [ ] add ability to favorite queries [ ] add saving of last query run for a table (started) [ ] add visible output for non-query statements [ ] add schema viewing [ ] add refresh to table list sidebar after CREATE/DROP/ALTER statements [ ] add automatic execution of initial select query on double click [x] add views to the sidebar [ ] add triggers to sidebar [ ] add upload from SQL, CSV and JSON [ ] add ability to connect to a non-val town Turso database [x] fix wonky sidebar separator height problem (thanks to @stevekrouse) [x] make result tables scrollable [x] add export to CSV, and JSON (CSV and JSON helper functions written in this val . Thanks to @pomdtr for merging the initial version!) [x] add listener for cmd+enter to submit query
HTTP (deprecated)
# SQLite Explorer (Dev Branch)
View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stev
![image.webp](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/c8e102fd-39ca-4bfb-372a-8d36daf43900/public)
## Install
Install the latest stable version (v66) by forking this val:
[![Install v66](https://stevekrouse-button.express.val.run/Install%20v66)](https://www.val.town/v/stevekrouse/sqlite_explorer
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
EditorSection,
MockTable,
Separator,
stevekrouse avatar
zodUnserializable
@stevekrouse
// Forked from @tmcw.zodExample
Script
export const zodUnserializable = (async () => {
const z = await import("npm:zod");
await setTimeout(() => {}, 100);
const x = z.object({ test: z.string() }); // type .object after z
return x;
// Forked from @tmcw.zodExample
neverstew avatar
readable
@neverstew
Readable Make any website instantly readable!
HTTP (deprecated)
# Readable
Make any website instantly readable!
export default async function(req: Request) {
let resp = await fetch(`https://${new URL(req.url).pathname}`, req);
let body = await resp.text();
let doc = new JSDOM(body);
let reader = new Readability(doc.window.document.cloneNode(true));
let article = reader.parse();
console.log(article.content);
return new Response(
diminutivesloop avatar
hello
@diminutivesloop
An interactive, runnable TypeScript val by diminutivesloop
Script
export const hello = (name) => `Hello ${name}`;
kora avatar
redis
@kora
Upstash Redis For more methods, see Upstash Docs
Script
# Upstash Redis
For more methods, see [Upstash Docs](https://upstash.com/docs/oss/sdks/ts/redis/getstarted)
const redis = new Redis({
url: Deno.env.get("upstashURL"),
token: Deno.env.get("upstashToken"),
// Just string
// console.log(await redis.set("foo", "bar")); // OK
// console.log(await redis.get("foo")); // bar
// JSON
await redis.set("json-ex-1", { a: { b: "nested json" } });
stevekrouse avatar
whiteThrush
@stevekrouse
SQLite Explorer View and interact with your Val Town SQLite data. It's based off Steve's excellent SQLite Admin val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by LibSQL Studio by invisal . This is now more an SPA, with tables, queries and results showing up on the same page. Install Install the latest stable version (v64) by forking this val that imports & exports it in your account: Authentication Login to your SQLite Explorer with password authentication with your Val Town API Token as the password. Todos / Plans [x] fix wonky sidebar separator height problem (thanks to @stevekrouse) [ ] improve error handling [ ] improve table formatting [x] make result tables scrollable [ ] sticky table headers [ ] add codemirror [ ] add loading indication to the run button (initial version shipped) [ ] add ability to favorite queries [ ] add saving of last query run for a table (started) [ ] add visible output for non-query statements [ ] add schema viewing [x] add export to CSV, and JSON (CSV and JSON helper functions written in this val . Thanks to @pomdtr for merging the initial version!) [ ] add refresh to table list sidebar after CREATE/DROP/ALTER statements [ ] add automatic execution of initial select query on double click [x] add listener for cmd+enter to submit query [ ] add views to the sidebar [ ] add triggers to sidebar [ ] add upload from SQL, CSV and JSON [ ] add ability to connect to a non-val town Turso database
HTTP (deprecated)
# SQLite Explorer
View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stev
![image.webp](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/c8e102fd-39ca-4bfb-372a-8d36daf43900/public)
## Install
Install the latest stable version (v64) by forking this val that imports & exports it in your account:
[![Install v64](https://stevekrouse-button.express.val.run/Install%20v64)](https://www.val.town/v/stevekrouse/sqlite_explorer
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
EditorSection,
MockTable,
Separator,
maxjoygit avatar
tell2
@maxjoygit
// Store messages via SQLite
Script
let { messages2 } = await import("https://esm.town/v/stevekrouse/messages2");
// Store messages via SQLite
// (stores at @me.messages2 in the current version)
// like `https://www.val.town/@stevekrouse.tell` but cooler!
export const tell2 = async (msg) => {
const { DB } = await import("https://deno.land/x/sqlite/mod.ts");
const db = new DB();
// Get existing messages (if any)
if (messages2 !== undefined) {
db.deserialize(messages2);
neverstew avatar
helloWorldPDF
@neverstew
// View me at https://neverstew-helloWorldPDF.web.val.run
HTTP (deprecated)
// View me at https://neverstew-helloWorldPDF.web.val.run
export const helloWorldPDF = async (req: Request) => {
const { jsPDF } = await import("npm:jspdf");
const doc = new jsPDF();
doc.text("Hello world!", 10, 10);
return new Response(doc.output(), {
headers: { "Content-Type": "application/pdf" },
nico avatar
heyo
@nico
An interactive, runnable TypeScript val by nico
Script
export let heyo = "heyoo!";
isidentical avatar
fluxImageGenerator
@isidentical
Sign in to fal.ai, generate an API key, and set it as FAL_KEY for your account.
HTTP
Sign in to fal.ai, generate an API key, and set it as `FAL_KEY` for your account.
// This app uses the fal.ai API to generate images based on user prompts.
// It features a clean UI with an input field for the prompt and a button to generate the image.
// The generated image is displayed below the input field.
// React is used for the UI and the fal.ai serverless client for image generation.
// The app measures and displays the latency for each image generation.
// The background features randomly placed pixelart lightning bolts in neon yellow.
/** @jsxImportSource https://esm.sh/react */
// Constants for background
const GRID_SIZE = 100; // Size of each grid cell
sharanbabu avatar
knowledgeExplorer
@sharanbabu
* This val creates a modern, stylish knowledge explorer using the Cerebras LLM API. * It allows users to enter a topic or select from suggestions, displays information in a centered card, * and enables exploration of related topics or deeper dives using arrow keys or buttons.
HTTP
* This val creates a modern, stylish knowledge explorer using the Cerebras LLM API.
* It allows users to enter a topic or select from suggestions, displays information in a centered card,
* and enables exploration of related topics or deeper dives using arrow keys or buttons.
/** @jsxImportSource https://esm.sh/react@18.2.0 */
const SUGGESTIONS = ["Quantum Computing", "Renaissance Art", "Climate Change", "Artificial Intelligence", "Space Exploration"
function App() {
const [topic, setTopic] = useState("");
const [content, setContent] = useState("");
const [title, setTitle] = useState("");
const [loading, setLoading] = useState(false);
jdan avatar
infoboxCrawler
@jdan
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
cytoscape.use(dagre);
const TITLE_SELECTOR = "#firstHeading > span";
function labelPredicate(label) {
return label === "Father" || label === "Mother" || /^Parent/.test(label);
async function* crawlWikipedia(
url: string,
generation: number = 0,
visited: Set<string> = new Set(),
): AsyncGenerator<[string, string, string[], number], void, unknown> {