Search

Results include substring matches and semantically similar vals. Learn more
guillermodoghel avatar
leaderboardApp
@guillermodoghel
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
function App() {
const [page, setPage] = useState("home");
const [showModal, setShowModal] = useState(false);
const [amount, setAmount] = useState("");
const [userEntry, setUserEntry] = useState(null);
const [leaderboard, setLeaderboard] = useState([
{ name: "Passenger #1", amount: 1000 },
{ name: "Passenger #2", amount: 950 },
{ name: "Passenger #3", amount: 900 },
tempdev avatar
srcbackend
@tempdev
// console.log(await doodstreamExtractor("9x3w3pu0xemy"));
Script
const nanoid = customAlphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", 10);
export interface DataSheet {
site: "dood" | "streamtape" | null;
siteSpecificId: string;
extractedURL: string;
accessHeaders: {};
fromCache: boolean;
subtitles?: {
language: string;
url: string;
rizoadev avatar
sqliteExplorerApp
@rizoadev
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
Script
# 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,
mjweaver01 avatar
TodoApp
@mjweaver01
SSR React Mini & SQLite Todo App This Todo App is server rendered and client-hydrated React. This architecture is a lightweight alternative to NextJS, RemixJS, or other React metaframeworks with no compile or build step. The data is saved server-side in Val Town SQLite . SSR React Mini Framework This "framework" is currently 44 lines of code, so it's obviously not a true replacement for NextJS or Remix. The trick is client-side importing the React component that you're server rendering . Val Town is uniquely suited for this trick because it both runs your code server-side and exposes vals as modules importable by the browser. The tricky part is making sure that server-only code doesn't run on the client and vice-versa. For example, because this val colocates the server-side loader and action with the React component we have to be careful to do all server-only imports (ie sqlite) dynamically inside the loader and action , so they only run server-side.
HTTP (deprecated)
# SSR React Mini & SQLite Todo App
This Todo App is server rendered *and* client-hydrated React. This architecture is a lightweight alternative to NextJS, Remix
![demo](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/3bbc3a39-9017-4a95-797b-2f205aa57f00/public)
## SSR React Mini Framework
This ["framework"](https://www.val.town/v/stevekrouse/ssr_react_mini) is currently 44 lines of code, so it's obviously not a
The trick is [client-side importing](https://www.val.town/v/stevekrouse/ssr_react_mini?v=53#L30) the React component that you
/** @jsxImportSource https://esm.sh/react */
export async function loader(req: Request) {
const { sqlite } = await import("https://esm.town/v/std/sqlite?v=4");
const [, { columns, rows }] = await sqlite.batch([
feb avatar
sqliteExplorerApp
@feb
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,
lejlot avatar
dateme_browse
@lejlot
@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",
pomdtr avatar
blob_admin_upload
@pomdtr
@jsxImportSource https://esm.sh/hono@4.0.8/jsx
Script
/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
const route = new Hono();
route.get("/", (c) => {
return c.render(
<form method="POST" enctype="multipart/form-data">
<input name="file" type="file" />
<input type="submit" value="Upload" />
</form>,
route.post("/", async (c) => {
const { file } = await c.req.parseBody();
maxm avatar
solidExample
@maxm
@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",
stevekrouse avatar
BIGweather
@stevekrouse
Big Weather Display Displays the current day's weather information BIG so you can see it from far away. Currently it's hardcoded for: prospect heights, brooklyn charts of the temp and % change of precipitation Probably easiest for you to fork it and change it to suit your needs vs making it customizable
HTTP (deprecated)
# Big Weather Display
Displays the current day's weather information BIG so you can see it from far away.
![Screenshot 2024-06-01 at 13.24.37@2x.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/941c58cd-f25c-4b6a-8864-e5974616
Currently it's hardcoded for:
- prospect heights, brooklyn
- charts of the temp and % change of precipitation
/** @jsxImportSource https://esm.sh/react */
// const lat = "40.682632";
// const lon = "-73.974231";
// let { properties: grid } = await weatherGovGrid({
mhalle avatar
solidExample
@mhalle
@jsxImportSource https://esm.sh/solid-jsx
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/solid-jsx */
import { renderToString } from "npm:solid-js/web";
function calc() {
return 4 + 5;
function getMarkup() {
return <div>Test {calc()}</div>;
export const solidExample = async () =>
new Response(await renderToString(() => getMarkup()), {
headers: {
"Content-Type": "text/html",
pomdtr avatar
blob_admin_delete
@pomdtr
@jsxImportSource https://esm.sh/hono@4.0.8/jsx
Script
/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
const route = new Hono();
route.get("/:key", (c) => {
const key = c.req.param("key");
return c.render(
<form method="POST">
<label>Are you sure you want to delete {key} ?</label>
<input type="submit" value="Delete Blob" />
</form>,
route.post("/:key", async (c) => {
mootari avatar
observable_esm
@mootari
Allows Observable notebooks to statically import ES modules as Runtime modules. See https://observablehq.com/d/1ff60814f0002dd5 for details and examples.
HTTP (deprecated)
Allows Observable notebooks to statically import ES modules as Runtime modules.
See https://observablehq.com/d/1ff60814f0002dd5 for details and examples.
export const observable_esm = async (request: Request): Promise<Response> => {
const url = new URL(request.url);
url.protocol = "https";
url.hostname = "esm.run";
const body = `
export default function define(runtime, observer) {
const main = runtime.module();
main.variable(observer("__module")).define("__module", () => module);
ychu avatar
aqi
@ychu
An interactive, runnable TypeScript val by ychu
Script
export let aqi = async () => {
let pm25 = (
await fetchJSON(
"https://api.openaq.org/v2/latest?" +
new URLSearchParams({
limit: "10",
page: "1",
location: "San Francisco",
offset: "0",
sort: "desc",
janpaul123 avatar
valle_tmp_56208884983514818093201845315532
@janpaul123
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
// Set these to your own
const username = "janpaul123";
const tempValsParentFolderId = "4bb7b010-4443-11ef-8642-de64eea55b61";
const valTownToken = Deno.env.get("valtown");
const vt = new ValTown({ bearerToken: valTownToken });
const app = new Hono();
const jsxResponse = (jsx) => {
return new Response(renderToString(jsx), { headers: { "Content-Type": "text/html" } });
const systemprompt = `The conversation below is your recent interaction with the user.
pomdtr avatar
hydrate_island
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
const island = document.querySelector("[data-hydration-src]");
if (!island) {
throw new Error("Could not find island");
const { hydrateRoot } = await import("https://esm.sh/react-dom@18.2.0/client");
const { jsx: _jsx } = await import("https://esm.sh/react@18.2.0/jsx-runtime");
const src = island.getAttribute("data-hydration-src");
console.log(`hydrating ${src}`);
const { Component } = await import(src);
const props = JSON.parse(island.getAttribute("data-hydration-props"));
hydrateRoot(island, _jsx(Component, props));