Search

Results include substring matches and semantically similar vals. Learn more
pomdtr avatar
telegramWelcome
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
export async function telegramWelcome(req: express.Request, res: express.Response) {
const { message } = req.body;
let secret: string;
// check if the secret is already set
for (
const [key, chatID] of Object.entries(
secretToTelegramChat,
if (chatID == message.from.id) {
secret = key;
break;
curtcox avatar
QRCodeScanner
@curtcox
* This val creates a QR code scanner using the device's camera. * It uses the jsQR library to decode QR codes from video frames. * The app displays the scanned QR code content and additional information. * * We'll use the following approach: * 1. Set up a video element to capture camera feed * 2. Use canvas to process video frames * 3. Use jsQR to decode QR codes from the frames * 4. Display the QR code content and additional information * 5. Add extensive debugging to identify issues
HTTP
* This val creates a QR code scanner using the device's camera.
* It uses the jsQR library to decode QR codes from video frames.
* The app displays the scanned QR code content and additional information.
* We'll use the following approach:
* 1. Set up a video element to capture camera feed
* 2. Use canvas to process video frames
* 3. Use jsQR to decode QR codes from the frames
* 4. Display the QR code content and additional information
* 5. Add extensive debugging to identify issues
/** @jsxImportSource https://esm.sh/react */
janpaul123 avatar
valle_tmp_32286234407113518840440547453902
@janpaul123
// Respond with a HTML page with silly gradients and crazy CSS
HTTP (deprecated)
// Respond with a HTML page with silly gradients and crazy CSS
export default async function (req: Request): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
<html>
<head>
<style>
body {
background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
text-align: center;
pomdtr avatar
publicBlushSnipe
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
const demoFunction = () => {
const result = Math.random();
if (result > 0.5)
return Failure(
"Math. random produced too high a number",
return Success(result);
const res = demoFunction();
if (res.success) {
console.log(res.data);
} else {
daveliepmann avatar
helloFriend
@daveliepmann
An interactive, runnable TypeScript val by daveliepmann
Script
import { myName } from "https://esm.town/v/rodrigotello/myName?v=1";
export let helloFriend = "Hello, " + myName;
zsj1zsj avatar
zsjtest
@zsj1zsj
An interactive, runnable TypeScript val by zsj1zsj
Script
import { consoleTest } from "https://esm.town/v/xuer/consoleTest?v=1";
export let zsjtest = consoleTest();
bpietroniro avatar
messWithTopSecretInfo
@bpietroniro
An interactive, runnable TypeScript val by bpietroniro
Script
let { topSecretInfo } = await import("https://esm.town/v/bpietroniro/topSecretInfo");
export let messWithTopSecretInfo = () => {
topSecretInfo += 1;
return topSecretInfo;
webup avatar
pipeSampleLLMBind
@webup
An interactive, runnable TypeScript val by webup
Script
export const pipeSampleLLMBind = (async () => {
const { PromptTemplate } = await import("npm:langchain/prompts");
const prompt = PromptTemplate.fromTemplate(`Tell me a joke about {subject}`);
const mb = await getModelBuilder({
type: "chat",
provider: "openai",
const model = await mb();
const tb = await getLangSmithBuilder();
const tracer = await tb();
const functionSchema = [
rchasman avatar
sqliteExplorerApp
@rchasman
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 (v86) 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
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 (v86) by forking this val:
[![Install Stable Release (v86)](https://stevekrouse-button.express.val.run/Install%20Stable%20Release%20(v81))](https://www.
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
EditorSection,
MockTable,
Separator,
adrianmg avatar
sqliteExplorerApp
@adrianmg
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 (v81) 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
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 (v81) by forking this val:
[![Install Stable Release (v81)](https://stevekrouse-button.express.val.run/Install%20Stable%20Release%20(v81))](https://www.
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
EditorSection,
MockTable,
Separator,
pomdtr avatar
tinybase_example_client
@pomdtr
@jsxImportSource https://esm.sh/react
Script
/** @jsxImportSource https://esm.sh/react */
// The store is automatically persisted on the remote server
const store = createStore();
const persister = createRemotePersister(store, `${window.location.origin}/load`, `${window.location.origin}/save`);
await persister.startAutoLoad({}, {
count: 0,
await persister.startAutoSave();
function App() {
// The component will be refreshed each time the store is updated
const count = useValue("count", store);
xpapla avatar
windowsXpSimulator
@xpapla
// This approach creates a Windows 98-style simulator using React for the UI and CSS for styling.
HTTP
// This approach creates a Windows 98-style simulator using React for the UI and CSS for styling.
// We'll implement a desktop with icons, a start menu, and multiple application windows including
// My Computer, Notepad, and Paint (using jspaint.app).
/** @jsxImportSource https://esm.sh/react */
function App() {
const [startMenuOpen, setStartMenuOpen] = useState(false);
const [windows, setWindows] = useState([]);
const [showRedirectPrompt, setShowRedirectPrompt] = useState(false);
const [activeWindow, setActiveWindow] = useState(null);
const [minimizedWindows, setMinimizedWindows] = useState([]);
iamseeley avatar
multiroutePreact
@iamseeley
🌐 Multi-Route Website with Preact
HTTP (deprecated)
🌐 Multi-Route Website with Preact
* @title Multi-Route Website with Preact
* @description Create a personal portfolio website with multiple pages using Preact and server-side rendering.
/** @jsxImportSource npm:preact */
// Navigation component
const Navigation = ({ currentPath }) => (
<nav>
{ path: '/', text: 'Home' },
{ path: '/about', text: 'About' },
{ path: '/projects', text: 'Projects' }
mattrw2 avatar
bookTheSperryChalet
@mattrw2
A val that emails you when the Sperry Chalet in Glacier National Park has open vacancies
Cron
A val that emails you when the Sperry Chalet in Glacier National Park has open vacancies
const datePattern = /\b[A-Za-z]{3}\s\d{1,2}\b/;
export default async function(interval: Interval) {
const response = await fetch("https://www.sperrychalet.com/vacancy_s.html");
const body = await response.text();
const $ = cheerio.load(body);
const table = $("#availability");
if (table.length === 0) return;
const availableDays = [];
const unavailableDays = [];
hyperglitch avatar
chorus_get_all_data
@hyperglitch
An interactive, runnable TypeScript val by hyperglitch
Script
import process from "node:process";
export async function chorus_get_all_data(auth, cached) {
// check auth
if (auth != process.env.chorus_access) {
return "";
if (cached)
return chorus_stored_data;
else
return await chorus_get_mag_data();