Search

Results include substring matches and semantically similar vals. Learn more
thomasorlita avatar
stevekrouseRSS
@thomasorlita
RSS feed of stevekrouse.com essays
HTTP (deprecated)
RSS feed of stevekrouse.com essays
export const stevekrouseRSS = async () => {
const response = await fetch("https://stevekrouse.com/");
const body = await response.text();
const $ = cheerio.load(body);
<li><span class="date">2022 Nov 08 - </span><a href="https://val-town.notion.site/End-programmer-Programming-a749beb4a9b143
<li><span class="date">2019 Apr 17 - </span><a href="https://futureofcoding.org/notes/alan-kay-lunch">Lunch with Alan Kay:
// parse this into a JSON array with date, link, title
const parsedItems = $("#page > div:nth-child(4) > ul > li").map((_, el) => {
const date = $(el).find(".date").text().trim().replace(" -", "");
namwen avatar
TravelApp
@namwen
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
Badge,
Box,
ChakraProvider,
Heading,
Link,
Text,
useColorModeValue,
VStack,
} from "https://esm.sh/@chakra-ui/react";
easrng avatar
preactWebApp
@easrng
@easrng.preactWebApp Make a web app on val.town with server-side rendered Preact components
Script
# @easrng.preactWebApp
[![Example](https://easrng-button.express.val.run/Example)](https://www.val.town/v/easrng.examplePreactWebApp/)
Make a web app on val.town with server-side rendered Preact components
export const preactWebApp = (function () {
type propType =
setHeaders: (headers: {
[key: string]: string | string[];
}) => void;
setStatus: (status: number) => void;
req: express.Request;
liamdanielduffy avatar
reactDemo
@liamdanielduffy
An interactive, runnable TypeScript val by liamdanielduffy
Script
import { addReactFromCDN } from "https://esm.town/v/liamdanielduffy/addReactFromCDN";
import { buildHtml } from "https://esm.town/v/liamdanielduffy/buildHtml";
export function reactDemo() {
return buildHtml(addReactFromCDN(), "");
janpaul123 avatar
valle_tmp_605448986086057210791953389018616
@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.
nbbaier avatar
ardent_astronomy
@nbbaier
Proof of concept for using Hono and remarkjs to create a slideshow. Slides here .
HTTP (deprecated)
Proof of concept for using Hono and [remarkjs](https://github.com/gnab/remark) to create a slideshow. [Slides here](https://n
/** @jsxImportSource npm:hono/jsx */
const app = new Hono();
const Style = () =>
html`<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body { font-family: 'Droid Serif'; }
h1, h2, h3 {
janpaul123 avatar
valle_tmp_60836902668989675457109372512279
@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.
maxm avatar
reactExample
@maxm
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export const reactExample = () =>
new Response(renderToString(<div>Test {1 + 1}</div>), {
headers: {
"Content-Type": "text/html",
git avatar
sparkle
@git
An interactive, runnable TypeScript val by git
HTTP (deprecated)
export default async (request: Request): Promise<Response> => {
return new Response(
/* html */ `<html>
<head>
<script type="module" src="https://esm.sh/@stefanjudis/sparkly-text"></script>
</head>
<body style="max-height:600px;max-width:475px;background-color:#f0f0f0;">
<sparkly-text
number-of-sparkles="5"
style="--sparkly-text-size: 2.5em"
janpaul123 avatar
getValsContextWindow
@janpaul123
An interactive, runnable TypeScript val by janpaul123
Script
const cacheBlobKey = "getValsContextWindowCache3";
export default async function getValsContextWindow(model: any) {
const fullCacheBlobKey = `${cacheBlobKey}-${model}`;
const cached = await blob.getJSON(fullCacheBlobKey);
if (cached) {
return cached;
const readmeVals: any = await blob.getJSON("readme-vals.json");
const API_URL = "https://api.val.town";
const sections = [
name: "Imports",
neverstew avatar
markdownExample
@neverstew
An interactive, runnable TypeScript val by neverstew
HTTP (deprecated)
export const markdownExample = async (req: Request) => {
const marked = await import("npm:marked");
return new Response(
marked.parse(`
Using Marked, a Markdown Parser
[Marked](https://marked.js.org) is a widely used markdown parser.
Here, we've imported it using \`const marked = await import("npm:marked");\`!
{ headers: { "Content-Type": "text/html" } },
stevekrouse avatar
similarSites
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
const exaSecret = Deno.env.get("EXA_API_KEY");
const exa = new Exa(exaSecret);
const similarSites = async function(url: string) {
const results = await exa.findSimilar(url);
if (results.results) {
let elements = results.results.map((el) => {
return {
"score": el.score,
"url": el.url,
elements.sort((a, b) => b.score - a.score);
stevekrouse avatar
valtownApiTypesImportTest
@stevekrouse
// Forked from @nbbaier.valtownApiTypesImportTest
Script
export let valtownApiTypesImportTest = (async () => {
const openapi = await import("https://esm.sh/valtown-api-types@0.1.1");
console.log(Object.keys(openapi));
// Forked from @nbbaier.valtownApiTypesImportTest
tmcw avatar
getDateMonth
@tmcw
An interactive, runnable TypeScript val by tmcw
Script
export const getDateMonth = (async () => {
// http://google.com/
const ss = await import("npm:simple-statistics");
return ss.min([1, 2, -10 * Math.random()]);
stevekrouse avatar
lucia_middleware_demo
@stevekrouse
Lucia Middleware Demo Import users. Backed by Val Town SQLite. Initially built by @pomdtr.
HTTP (deprecated)
# Lucia Middleware Demo
Import users. Backed by Val Town SQLite.
Initially built by @pomdtr.
/** @jsxImportSource npm:hono@3/jsx */
const app = new Hono();
app.get("/", (c) => {
const username = c.req.header("X-Lucia-Username");
if (username) {
return c.html(
<div>