Search
valle_tmp_55200782960721338274733449192118
@janpaul123
// This val responds with an HTML form styled with fun CSS to input the user's name and greets them upon form submission
HTTP
// This val responds with an HTML form styled with fun CSS to input the user's name and greets them upon form submission
export default async function(req: Request): Promise<Response> {
if (req.method === "POST") {
const formData = new URLSearchParams(await req.text());
hackerNewsSearch
@alexdphan
An interactive, runnable TypeScript val by alexdphan
HTTP
date_published: string;
export async function hackerNewsSearch({
query = "Artificial Intelligence",
await browser.close();
async function scrapePageThreads(page) {
const scrollToBottom = async () => {
await scrollToBottom();
return page.evaluate(async (dateConverterFunctionString) => {
const convertDateInBrowser = async (relativeDate) => {
try {
// Reconstruct the date converter function from its string representation
const dateConverterFunction = eval(`(${dateConverterFunctionString})`);
const result = await dateConverterFunction({ relativeDate });
// Check if the result is a Response object (from a potential fetch call)
return threads;
}, convertRelativeDateToString.toString()); // Pass the string representation of the original function
async function goToNextPage(page, currentPage) {
// Scroll to the bottom of the page

vtApiTypes
@neverstew
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
Script
query?: {
/** @description The args query parameter can provide arguments to the given val. The parameter needs to be a JSON-encoded array, in which each item in the array is passed to the val as a function parameter. */
args?: string;
val_name: components["parameters"]["val_name"];
/** @description Provide arguments to the given val function by including a post body with your request. */
requestBody?: {
* @description Runs `@{username}.{val_name}` as an Express handler.
* `@{username}.{val_name}` must be a function. It is passed the Express [`req`](https://expressjs.com/en/4x/api.html#req) and [`res`](https://expressjs.com/en/4x/api.html#res) objects as its arguments. You can use `req` to pull out request data, and `res` to respond with any valid Express response. Learn more at the [Express docs](https://expressjs.com/en/4x/api.html).
* Unlike the other two APIs, the Express API is specified via subdomain and runs at `https://{username}-{val_name}.express.val.run`.
responses: {
/** @description Function executed successfully */
200: {
* @description Runs `@{username}.{val_name}` as an Express handler.
* `@{username}.{val_name}` must be a function. It is passed the Express [`req`](https://expressjs.com/en/4x/api.html#req) and [`res`](https://expressjs.com/en/4x/api.html#res) objects as its arguments. You can use `req` to pull out request data, and `res` to respond with any valid Express response. Learn more at the [Express docs](https://expressjs.com/en/4x/api.html).
* ### Unauthenticated
responses: {
/** @description Function executed successfully */
200: {
* @description The JavaScript or TypeScript expression to be evaluated.
* This should be a single expression, like a single function
* call, assignment operation, or calculation. If you need
* to execute multiple expressions, wrap them in a function.
expression: string;

prism_feature_notifications
@stevekrouse
Sparse autoencoder feature of the day email This Val sends a daily notification email at the start of every day with a random high confidence (> 0.8) feature drawn from my sparse autoencoders project that tries to find interpretable directions in the latent space of embedding models. It sends you an email with a brief description of the feature and a link to view more. Here's an example email from this Val:
Every time you run it, you'll get a different feature. By default, this uses the lg-v3-x1 model, which I think is a good one to start with, but this may change in the future as I train better feature dictionaries!
Cron
const confidenceThreshold = 0.8;
function randomlyPickFeature(featuresAboveConfidenceThreshold) {
return featuresAboveConfidenceThreshold[Math.floor(Math.random() * featuresAboveConfidenceThreshold.length)];
function getFeatureLink(feature) {
const { index } = feature;
return `https://thesephist--prism-start-app.modal.run/f/${modelName}/${index}?layout=2`;
export default async function(interval: Interval) {
const response = await fetch(dictionaryUrl);

testSecret
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import process from "node:process";
export function testSecret() {
const a = process.env.test;
return "can you guess my secret?";
rootValRef
@andreterron
An interactive, runnable TypeScript val by andreterron
Script
import { rootRef } from "https://esm.town/v/andreterron/rootRef?v=2";
import { ValRef } from "https://esm.town/v/andreterron/ValRef?v=1";
export function rootValRef(): ValRef | undefined {
const val = rootRef();
return val
val_zfIPxdNj1i
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
function isPrime(num) {
if (num <= 1) return false;
return true;
function findLowestThreeDigitPrime() {
for (let num = 100; num < 1000; num++) {
fascinatingAmaranthStingray
@oke_oma
@jsxImportSource https://esm.sh/react@18.2.0
Script
childrenIds: number[];
function App() {
const [view, setView] = useState<"teachers" | "pupils" | "parents">("teachers");
}, [view]);
async function fetchPeople() {
try {
console.error(`Error fetching ${view}:`, error);
function renderPeopleTable() {
return (
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
val_5jRwwTodiK
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
function isPrime(num) {
if (num <= 1) return false;
return true;
function findLowestThreeDigitPrime() {
for (let num = 100; num < 1000; num++) {

dateme_home
@vawogbemi
@jsxImportSource npm:hono@3/jsx
Script
import date_me_doc_locations from "https://esm.town/v/stevekrouse/date_me_doc_locations";
import Layout from "https://esm.town/v/vawogbemi/dateme_layout";
export default function Home(c) {
return c.html(
<Layout activeTab={new URL(c.req.url).pathname}>
pyodideDataVis
@iamseeley
An interactive, runnable TypeScript val by iamseeley
HTTP
<div id="plotContainer"></div>
<script>
async function main() {
let pyodide = await loadPyodide();
await pyodide.loadPackage('numpy');
fetchNewPublicGitHubRepos
@toowired
An interactive, runnable TypeScript val by toowired
Script
export default async function fetchNewPublicGitHubRepos() {
// Generate today's date in YYYY-MM-DD format
const today = new Date().toISOString().split("T")[0];
valle_tmp_90775096713594030038814365860220246
@janpaul123
// Define interface for Story object
HTTP
const BLOB_KEY = "hacker_news_stories";
// Add 30 fake sample stories
async function initializeStories() {
let stories: Story[] = [];
for (let i = 1; i <= 30; i++) {

handleOnboardingReferral
@stevekrouse
// Triggered when someone tells us how they hear about VT on onboarding
RPC (deprecated)
import process from "node:process";
// Triggered when someone tells us how they hear about VT on onboarding
export async function handleOnboardingReferral({ auth, referral, handle }: {
auth: string;
referral: string;