Search

Results include substring matches and semantically similar vals. Learn more
arifio avatar
gregariousPinkCat
@arifio
An interactive, runnable TypeScript val by arifio
HTTP
export default async function (req: Request): Promise<Response> {
return Response.json({ ok: true })
maxm avatar
unawaitedAsyncExample
@maxm
An interactive, runnable TypeScript val by maxm
HTTP
export async function handle() {
// Schedule work to do later
(async () => {
Blackhammer avatar
greatBlushLeopard
@Blackhammer
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
phone: string;
function CVBuilderApp() {
const [personalInfo, setPersonalInfo] = useState<PersonalInfo>({
level: 'Beginner'
// New function to add references
const addReference = () => {
cursor: 'pointer'
function client() {
createRoot(document.getElementById("root")).render(<CVBuilderApp />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(`
janpaul123 avatar
valle_tmp_37032806114103356497303187371446
@janpaul123
An interactive, runnable TypeScript val by janpaul123
HTTP
import { faker } from "npm:@faker-js/faker";
const SAMPLE_STORIES_KEY = "hn_realistic_sample_stories";
async function initializeSampleStories() {
const existingStories = await blob.getJSON(SAMPLE_STORIES_KEY);
if (!existingStories) {
seanyang0813 avatar
northernChocolateFish
@seanyang0813
An interactive, runnable TypeScript val by seanyang0813
Cron
import { email } from "https://esm.town/v/std/email";
export default async function(interval: Interval) {
await email({
subject: "This is your daily ping!",
vawogbemi avatar
TaylorSwiftMoments
@vawogbemi
@jsxImportSource https://esm.sh/react
HTTP
function Header({ logoUrl, themeColor1, themeColor2 }) {
function EraSelector({ activeEra, onSelectEra }) {
function truncatePrompt(prompt, maxLength = 50) {
function ImageGallery({ images, activeEra, onLike, onDelete }) {
function App() {
function client() {
export default async function server(req: Request): Promise<Response> {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const enhancedPromptResponse = await openai.chat.completions.create({
yawnxyz avatar
phagepapersCron
@yawnxyz
An interactive, runnable TypeScript val by yawnxyz
Cron
"phage biocontrol", "phage food safety", "phage agriculture",
"phage crop protection", "environmental phages", "phage biotechnology"
export async function run() {
const randomKeywords = phageKeywords.sort(() => 0.5 - Math.random()).slice(0, 1);
let searches = await getSearches({
console.log("results: ", result);
return result;
export default async function (interval: Interval) {
return await run();
arifio avatar
loanCalculator
@arifio
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import React, { useState } from "https://esm.sh/react@18.2.0";
function LoanCalculator() {
const [loanAmount, setLoanAmount] = useState(100000);
textDecoration: "none",
function client() {
createRoot(document.getElementById("root")).render(<LoanCalculator />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(
dhvanil avatar
web_mBvDDUywvr
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_mBvDDUywvr(req) {
return new Response(`<!DOCTYPE html>
<html lang="en">
adagradschool avatar
claude_fa6b572a_8ee1_47bc_bbcf_4c2f2a03d71e
@adagradschool
An interactive, runnable TypeScript val by adagradschool
HTTP
export default function handler(req) {
to expand on any of these features or show you how to implement a specific functionality?</div>\n </div>\n \n
headers: {
"Content-Type": "text/html",
amoeba avatar
aqi
@amoeba
AQI Alerts Get email alerts when AQI is unhealthy near you. Set up Click Fork Change location (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via nominatim's geocoder API . Click Run Background This val uses nominatim's geocoder to get your lat, lon, and air quality data from OpenAQ. It uses EPA's NowCast AQI Index calculation and severity levels. Learn more: https://www.val.town/v/stevekrouse.easyAQI
Cron
import { email } from "https://esm.town/v/std/email?v=9";
import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
export async function aqi(interval: Interval) {
const location = "seattle, wa"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
austinchappell avatar
myApi
@austinchappell
An interactive, runnable TypeScript val by austinchappell
Script
export function myApi(name) {
return "hi " + name;
janpaul123 avatar
valle_tmp_275862191060511468456294552341596
@janpaul123
// This val will respond with a simple HTML page saying "Hello, world!"
HTTP
// This val will respond with a simple HTML page saying "Hello, world!"
export default async function main(): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
aeaton avatar
companiesHousePublicData
@aeaton
An interactive, runnable TypeScript val by aeaton
HTTP
export default async function(req: Request): Promise<Response> {
const url = new URL(req.url);
const path = url.searchParams.get("path");
steveb1313 avatar
GetPelotonUser
@steveb1313
An interactive, runnable TypeScript val by steveb1313
Script
import { fetch } from "https://esm.town/v/std/fetch";
import process from "node:process";
export async function GetPelotonUser(
req: express.Request,
res: express.Response,