Search

Results include substring matches and semantically similar vals. Learn more
stevekrouse avatar
valBeeExample
@stevekrouse
// Forked from @valbee.untitled_ftzdarmU
Script
import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
let { valbeeTest } = await import("https://esm.town/v/stevekrouse/valbeeTest");
export const valBeeExample = async () => {
return (valbeeTest = fetchText(
"http://numbersapi.com/random/math"
// Forked from @valbee.untitled_ftzdarmU
nbbaier avatar
codemirror_demo
@nbbaier
An interactive, runnable TypeScript val by nbbaier
HTTP (deprecated)
const body = `<html>
<head>
<script
type="module"
src="https://raw.esm.sh/code-mirror-web-component@0.0.20/dist/code-mirror.js"
></script>
<style>
.cm-editor {
height: 300px;
border: 1px solid #ddd;
stevekrouse avatar
dateme_browse
@stevekrouse
@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",
valTownTrpc avatar
autocompleteNpm
@valTownTrpc
An interactive, runnable TypeScript val by valTownTrpc
Script
import { getValTownTrpc } from "https://esm.town/v/easrng/getValTownTrpc?v=5";
export const autocompleteNpm = async ({ query }) => {
const trpc = await getValTownTrpc();
return await trpc.autocompleteNpm.query({
query,
janpaul123 avatar
valle_tmp_54185991019187464068579562776686
@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
greenCockroach
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
export async function up(db: Kysely<any>): Promise<void> {
await db.schema
.createTable("person")
.addColumn("id", "integer", (col) => col.primaryKey())
.addColumn("first_name", "text", (col) => col.notNull())
.addColumn("last_name", "text")
.addColumn("gender", "text", (col) => col.notNull())
.addColumn("created_at", "text", (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`).notNull())
.execute();
await db.schema
janpaul123 avatar
valle_tmp_87252716729376250552603497646944
@janpaul123
// Handle story submission
HTTP (deprecated)
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: faker.lorem.sentence(),
url: faker.internet.url(),
votes: faker.datatype.number({ min: 0, max: 100 }),
await blob.setJSON(SAMPLE_STORIES_KEY, sampleStories);
tempdev avatar
rabbitstream
@tempdev
// Full .ts implimentation of rabbitstream.net
HTTP
// Full .ts implimentation of rabbitstream.net
// Author : cool-dev-guy@github.com (cool-dev-guy)
// About : A one-file easy-deploy .ts code(specifically made for deno). for quick deployments.
// Thanks to :
// - ciarands@github.com (ciarands) [for payload script to extract variables]
// - drbgln@github.com (drbgln) [for reference script fordecryption]
const app = new Hono();
app.get("/:provider/:id", async (c) => {
try {
const { provider, id } = c.req.param();
jbwinters avatar
RefiComparison
@jbwinters
* This app creates a comprehensive mortgage refinance offer comparison tool. * It calculates monthly payments, total interest paid, and displays charts for visual comparison. * It uses React for the frontend, Chart.js for data visualization, and Val Town's blob storage for data persistence.
HTTP
* This app creates a comprehensive mortgage refinance offer comparison tool.
* It calculates monthly payments, total interest paid, and displays charts for visual comparison.
* It uses React for the frontend, Chart.js for data visualization, and Val Town's blob storage for data persistence.
/** @jsxImportSource https://esm.sh/react */
interface Offer {
id: string;
lender: string;
rate: number;
term: number;
closingCosts: number;
ejfox avatar
spotify
@ejfox
// Thank you for the feedback! You're right, we need to handle cases where playlist images might be missing.
HTTP
// Thank you for the feedback! You're right, we need to handle cases where playlist images might be missing.
// Let's update the code to handle this gracefully and provide a default image when necessary.
const app = new Hono();
const CLIENT_ID = "605b681271294a05ba5a574f790ac409";
const REDIRECT_URI = "https://ejfox-spotify.web.val.run/callback";
app.get("/", (c) => {
const html = `
<html lang="en">
<head>
<meta charset="UTF-8">
janpaul123 avatar
valle_tmp_610457425865436710444833460520275
@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 = `
janpaul123 avatar
valle_tmp_54846529024345792066850117206065
@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.
janpaul123 avatar
valle_tmp_1112761154422132706439156901497722
@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),
janpaul123 avatar
valle_tmp_62253074104033147819150473701293
@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.
stevekrouse avatar
grievingYellowAsp
@stevekrouse
Perf - a website performance tester I had Anthropic build this for me to show off the launch of HTTP (Preview) vals: https://blog.val.town/blog/http-preview/
HTTP
# Perf - a website performance tester
I had Anthropic build this for me to show off the launch of `HTTP (Preview)` vals: https://blog.val.town/blog/http-preview/
![Screenshot 2024-07-17 at 14.14.45@2x.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/b4cd5cc8-84f5-4c1a-1668-7e0abf90
/** @jsxImportSource https://esm.sh/react */
// Utility functions
const performSingleRequest = async (url) => {
const start = performance.now();
try {
await fetch(url);
const end = performance.now();