Search

Results include substring matches and semantically similar vals. Learn more
janpaul123 avatar
valle_tmp_63310026100017965110952142769065
@janpaul123
// This val will serve an HTML page emulating a Hacker News clone.
HTTP (deprecated)
// This val will serve an HTML page emulating a Hacker News clone.
// It uses plain HTML and CSS to create the frontend. Eventually,
// we can make it interactive with additional scripts.
export default async function(req: Request): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
zcribe avatar
sqliteExplorerApp
@zcribe
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,
movienerd avatar
AIMovie
@movienerd
* This program creates a movie recommendation system based on moods. * It uses OpenAI to generate movie recommendations based on the user's selected mood and feedback. * The program uses React for the frontend and handles state management for user interactions. * It uses the Val Town OpenAI proxy for backend API calls. * Movies are saved in SQLite to prevent recommending the same movie twice. * The SQLite schema version has been updated to fix the 404 error. * A dancing popcorn emoji has been added to the loading message. * The color scheme has been updated to a monochrome look with a modern style and a nice font. * The "More moods" button text has been changed to "Ask the AI for different moods". * The mood generation now keeps track of previously generated moods to avoid repetition. * A list of movies that have been liked, disliked, or not seen is displayed at the bottom of the page. * The JSON parsing has been made more robust to handle non-standard responses.
HTTP
* This program creates a movie recommendation system based on moods.
* It uses OpenAI to generate movie recommendations based on the user's selected mood and feedback.
* The program uses React for the frontend and handles state management for user interactions.
* It uses the Val Town OpenAI proxy for backend API calls.
* Movies are saved in SQLite to prevent recommending the same movie twice.
* The SQLite schema version has been updated to fix the 404 error.
* A dancing popcorn emoji has been added to the loading message.
* The color scheme has been updated to a monochrome look with a modern style and a nice font.
* The "More moods" button text has been changed to "Ask the AI for different moods".
* The mood generation now keeps track of previously generated moods to avoid repetition.
stevekrouse avatar
dot_com
@stevekrouse
stevekrouse.com - my personal website This val hosts my personal website. The view data is stored in Val Town SQLite - @std/sqlite. It used to live on Github Pages, which is why I proxy over requests to certain blog posts over to the Github Pages site still. Todos [ ] Speed up page load by loading sqlite data later like in @healeycodes/steve_web [ ] Store more (legally storable) analytics data, and maybe make a sparkline! [ ] Add some sort of way to contact me [ ] Move over all my blog posts from Github Pages (maybe into @std/blob as a CMS?)
HTTP
# stevekrouse.com - my personal website
This val hosts my personal website. The view data is stored in Val Town SQLite - @std/sqlite.
It used to live on Github Pages, which is why I proxy over requests to certain blog posts over to the Github Pages site still
## Todos
- [ ] Speed up page load by loading sqlite data later like in @healeycodes/steve_web
- [ ] Store more (legally storable) analytics data, and maybe make a sparkline!
/** @jsxImportSource https://esm.sh/react */
const linkClass = "text-blue-500 hover:underline";
const Link = (
{ children, href }: {
just_be avatar
switchbot_party
@just_be
Switchbot Party We hosted a party in the Val Town office and I texted a link to this site to all guests: You can see a demo here: https://x.com/stevekrouse/status/1819018859099132128 After the party was over, I commented out the lines that open the door so folks can't use it anymore.
HTTP
# Switchbot Party
We hosted a party in the Val Town office and I texted a link to this site to all guests:
![Screenshot 2024-08-05 at 12.30.16@2x.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/120a1c41-bedb-4bda-568d-2c0913d4
You can see a demo here: https://x.com/stevekrouse/status/1819018859099132128
After the party was over, I commented out the lines that open the door so folks can't use it anymore.
/** @jsxImportSource npm:hono/jsx */
const app = new Hono();
const ValTownGroundFloorDeviceId = "D2353438164D";
const ValTownOfficeDeviceId = "CD6F3A810848";
async function switchbotRequest(path, args) {
stevekrouse avatar
testPostgres
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import process from "node:process";
export let testPostgres = (async () => {
const postgres = await import("https://deno.land/x/postgres/mod.ts");
const client = new postgres.Client(process.env.neon);
await client.connect();
console.log(await client.queryObject`select CURRENT_TIME;`);
petermillspaugh avatar
growthMindset
@petermillspaugh
@jsxImportSource https://esm.sh/react
Script
/** @jsxImportSource https://esm.sh/react */
* Note: this lesson is a work in progress 👷‍♂️
const TITLE = "Growth mindset";
const FILL_BLANK = <>TODO</>;
const CONTENT = (
<blockquote>Whether you think you can or you think you can't, you're right.</blockquote>
<h2>Growth mindset</h2>
<p></p>
const QUIZ = [
question: "",
janpaul123 avatar
valle_tmp_4374095821764219776697402648626
@janpaul123
// To create a simple JavaScript formatter, we can utilize the Prettier library available in Deno.
HTTP (deprecated)
// To create a simple JavaScript formatter, we can utilize the Prettier library available in Deno.
// Prettier helps format and beautify JavaScript code.
// This val will take JavaScript code as input and format it using Prettier.
import { format } from "npm:prettier/standalone";
import parserBabel from "npm:prettier/parser-babel";
export default async function(req: Request): Promise<Response> {
const { code } = await req.json();
const formattedCode = format(code, {
parser: "babel",
plugins: [parserBabel],
return new Response(formattedCode, { headers: { "Content-Type": "text/plain" } });
stevekrouse avatar
demoSDK
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import ValTown from "npm:@valtown/sdk";
const vt = new ValTown({ bearerToken: Deno.env.get("valtown") });
console.log(await vt.me.profile.retrieve());
console.log(await vt.blobs.list());
console.log(await vt.vals.runAnonymous({ code: "export const x = 1+1" }));
iamseeley avatar
sqliteExplorerApp
@iamseeley
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,
janpaul123 avatar
valle_tmp_331733911360176721193636644811242
@janpaul123
// Initialize sample stories and store them in blob storage
HTTP (deprecated)
// Initialize sample stories and store them in blob storage
const SAMPLE_STORIES_KEY = "hn_sample_stories";
async function initializeSampleStories() {
const existingStories = await blob.getJSON(SAMPLE_STORIES_KEY);
if (!existingStories) {
const sampleStories = Array.from({ length: 30 }).map((_, idx) => ({
id: idx + 1,
title: `Sample Story ${idx + 1}`,
url: `https://example.com/story${idx + 1}`,
votes: Math.floor(Math.random() * 100),
dtkav avatar
sqliteExplorerApp
@dtkav
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,
yawnxyz avatar
translator
@yawnxyz
Press to talk, and get a translation! The app is set up so you can easily have a conversation between two people. The app will translate between the two selected languages, in each voice, as the speakers talk. Add your OpenAI API Key, and make sure to open in a separate window for Mic to work.
HTTP (deprecated)
Press to talk, and get a translation!
The app is set up so you can easily have a conversation between two people. The app will translate between the two selected l
Add your OpenAI API Key, and make sure to open in a separate window for Mic to work.
const app = new Hono();
const openai = new OpenAI(Deno.env.get("OPENAI_API_KEY_VOICE"));
class TranscriptionService {
async transcribeAudio(audioFile) {
try {
const transcription = await openai.audio.transcriptions.create({
file: audioFile,
liamdanielduffy avatar
serveReactDemo
@liamdanielduffy
An interactive, runnable TypeScript val by liamdanielduffy
Script
import { reactDemo } from "https://esm.town/v/liamdanielduffy/reactDemo";
import { serveAsHTML } from "https://esm.town/v/liamdanielduffy/serveAsHTML";
export function serveReactDemo(req, res) {
serveAsHTML(req, res, reactDemo());
pomdtr avatar
playground
@pomdtr
playground edit, run, and embed vals without requiring an account (or even js enabled!) caveats: logs don't stream I haven't set up codemirror only script vals supported everything else should be fully functional. you can prefill the editor with code: https://easrng-playground.web.val.run/?code=console.log(1) a val: https://easrng-playground.web.val.run/?load=easrng/playground some other url: https://easrng-playground.web.val.run/?load=https://any/other/url
Script
# playground
## edit, run, and embed vals without requiring an account (or even js enabled!)
[![open](https://easrng-button.express.val.run/open)](https://easrng-playground.web.val.run/)
caveats:
- logs don't stream
- I haven't set up codemirror
// (c) easrng 2024 all rights reserved
type Log = {
level: string;
args: unknown[];