Search

Results include substring matches and semantically similar vals. Learn more
iamseeley avatar
webPerformance
@iamseeley
An interactive, runnable TypeScript val by iamseeley
HTTP (deprecated)
const websites = [
{ name: 'React-Client', url: 'https://iamseeley-reactserver.web.val.run/' },
{ name: 'React-Client-CDN', url: 'https://iamseeley-clientmultiroutereact.web.val.run/' },
{ name: 'Vue', url: 'https://iamseeley-multiroutevue.web.val.run/' },
{ name: 'Svelte', url: 'https://iamseeley-multiroutesvelte.web.val.run/' },
{ name: 'Preact', url: 'https://iamseeley-multiroutepreact.web.val.run/' },
{ name: 'React', url: 'https://iamseeley-multiroutereact.web.val.run/' },
{ name: 'Hono', url: 'https://iamseeley-multiroutehono.web.val.run/' },
yawnxyz avatar
turnitdown
@yawnxyz
HTML to Markdown Converter This is a simple web application that converts HTML to Markdown. It provides a clean and efficient way to transform HTML content into Markdown format, which is widely used for documentation and content creation. Features Easy-to-use Interface : Simple textarea inputs for HTML and Markdown output. Real-time Conversion : Converts HTML to Markdown instantly upon clicking the convert button. Clean Output : Removes scripts, styles, and other non-content elements from the HTML before conversion. Copy to Clipboard : One-click copying of the converted Markdown text. How It Works The application uses the Hono framework to create a simple web server. HTMX is used for handling AJAX requests without writing JavaScript. Alpine.js provides reactivity for the clipboard functionality. The Turndown library is used to convert HTML to Markdown. Usage Paste your HTML content into the "HTML Input" textarea. Click the "Convert to Markdown" button. The converted Markdown will appear in the "Markdown Output" textarea. Use the "Copy to Clipboard" button to easily copy the result. Technical Details The server removes <script> , <style> , and other non-content tags before conversion. HTML comments are also stripped out. The Markdown output is cleaned to remove excessive whitespace and newlines. View Source You can view the source code of this application by clicking the "View Source" link at the bottom of the page. Limitations The converter may not handle extremely complex HTML structures perfectly. Some HTML elements might not have a direct Markdown equivalent. Future Improvements Add options for customizing the Markdown output format. Implement file upload for HTML conversion. Add support for converting Markdown back to HTML. Feel free to use and modify this converter for your HTML to Markdown conversion needs!
HTTP
2. HTMX is used for handling AJAX requests without writing JavaScript.
3. Alpine.js provides reactivity for the clipboard functionality.
4. The Turndown library is used to convert HTML to Markdown.
* This val creates a simple web interface using Hono framework to convert HTML to Markdown.
* It uses HTMX for dynamic updates and Alpine.js for reactivity.
* The Turndown library is used for HTML to Markdown conversion.
* The interface includes two text areas (input and output) and buttons for conversion and copying.
moe avatar
ogImage
@moe
@jsxImportSource https://esm.sh/react
Script
/** @jsxImportSource https://esm.sh/react */
import { render } from "https://deno.land/x/resvg_wasm/mod.ts"
import satori from "npm:satori"
vhugoobject avatar
linkInBioTemplate
@vhugoobject
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
const itemStyle = {
padding: "10px",
vawogbemi avatar
whoIsHiringAbout
@vawogbemi
@jsxImportSource https://esm.sh/react
Script
/** @jsxImportSource https://esm.sh/react */
export default function About() {
const linkClass = "text-sky-600 hover:text-sky-500";
ff6347 avatar
sketch
@ff6347
P5 sketch Easily turn a p5.js sketch into a val. See https://www.val.town/v/saolsen/p5_sketch for an example. Usage Make a p5 sketch, you can import the p5 types to make it easier. import type * as p5 from "npm:@types/p5"; Export any "global" p5 functions. These are functions like setup and draw that p5 will call. Set the val type to http and default export the result of sketch , passing in import.meta.url . A full example looks like this. import type * as p5 from "npm:@types/p5"; export function setup() { createCanvas(400, 400); } export function draw() { if (mouseIsPressed) { fill(0); } else { fill(255); } ellipse(mouseX, mouseY, 80, 80); } import { sketch } from "https://esm.town/v/saolsen/p5"; export default sketch(import.meta.url); How it works The sketch function returns an http handler that sets up a basic page with p5.js added. It then imports your module from the browser and wires up all the exports so p5.js can see them. All the code in your val will run in the browser (except for the default sketch export) so you can't call any Deno functions, environment variables, or other server side apis.
Script
## How it works
so you can't call any Deno functions, environment variables, or other server side apis.
athyuttamre avatar
digitalYellowRoadrunner
@athyuttamre
An interactive, runnable TypeScript val by athyuttamre
Script
state: z.string(),
country: z.string(),
const client = new OpenAI({ apiKey: Deno.env.get("OPENAI_API_KEY") });
async function main() {
const stream = client.beta.chat.completions.stream({
model: "gpt-4o-mini",
messages: [{
smca avatar
stitchVal
@smca
inspired by https://x.com/dankuntz/status/1813283813881225625 written by Sonnet-3.5 with ~12 prompts and some final manual tweaks
HTTP (deprecated)
window.addEventListener('resize', onWindowResize);
function onMouseMove(event) {
currentPoint.set(event.clientX, window.innerHeight - event.clientY);
if (isPressed) {
dragVector.subVectors(currentPoint, clickPoint);
function onMouseDown(event) {
isPressed = true;
clickPoint.set(event.clientX, window.innerHeight - event.clientY);
currentPoint.copy(clickPoint);
dragVector.set(0, 0);
opeala avatar
linkInBioTemplate
@opeala
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
// import { faCoffee } from "npm:@fortawesome/free-solid-svg-icons";
} from "npm:@fortawesome/free-brands-svg-icons";
import { FontAwesomeIcon } from "npm:@fortawesome/react-fontawesome";
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request) {
d17e avatar
status
@d17e
Uptime Status Page This is the status page for the data generated by this uptime cron: @stevekrouse/uptime
HTTP
/** @jsxImportSource https://esm.sh/react */
import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
import { html } from "https://esm.town/v/stevekrouse/html";
import { SparklineSVG } from "https://esm.town/v/stevekrouse/sparklineSVGReact";
import { renderToString } from "npm:react-dom/server";
function StatusRow({ rows }) {
stevekrouse avatar
purpleMagpie
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP (deprecated)
import { httpClient } from "https://esm.town/v/pomdtr/http_client";
export default httpClient((req) => {
return new Response("Hello World!");
bookmarks: [
mschleske avatar
authenticateReddit
@mschleske
An interactive, runnable TypeScript val by mschleske
Script
export const authenticateReddit = async (
CLIENT_ID,
CLIENT_SECRET,
ACCESS_CODE,
Buffer.from(
`${CLIENT_ID}:${CLIENT_SECRET}`,
).toString("base64")
pomdtr avatar
webdavServer
@pomdtr
Webdav Manage your vals from a webdav client (ex: https://cyberduck.io/) ⚠️ some webdav operations are not supported, so support can vary between clients. Installation Click "Create Val" on the code block, and change it's type to http. import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth"; import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken"; import { serveVals } from "https://esm.town/v/pomdtr/webdavServer"; export default basicAuth(serveVals, { verifyUser: (user) => { return verifyToken(user); }, }); Use a val town token as the username, and keep the password blank to authenticate.
Script
# Webdav
Manage your vals from a webdav client (ex: https://cyberduck.io/)
![image.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/18b895c5-f38b-42ad-321f-47e3c67c2f00/public)
> ⚠️ some webdav operations are not supported, so support can vary between clients.
## Installation
michaelmang avatar
bookmark
@michaelmang
A minimal bookmarking tool This allows you to bookmark links and view them later. Completely powered by ValTown and SQLite. To set this up for yourself Fork the val From your ValTown settings page, add an environment variable named bookmarks_client_id and give it a value (you will be using this for saving) Add another environment variable named bookmarks_client_secret and give it a value (you will also be using this for saving) At first, the "bookmarks" table will not exist, so we need to save an article first, which will create the "bookmarks" table To do this, add a bookmarklet to your browser with this value (replace BOOKMARKS-CLIENT-ID and BOOKMARKS-CLIENT-SECRET with the values you added to the environment variables, and replace BOOKMARKS-URL with your VAL's URL): javascript:void(open('BOOKMARKS-URL/save?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title)+'&id=BOOKMARKS-CLIENT-ID&secret=BOOKMARKS-CLIENT-SECRET', 'Bookmark a link', 'width=400,height=450')) Click this bookmarklet to bookmark the URL of the current active tab Go to your VAL URL homepage to see the bookmark Demo Here are my bookmarks: https://ramkarthik-bookmark.web.val.run/ Note Make sure you don't share bookmarks_client_id and bookmarks_client_secret . It is used for authentication before saving a bookmark.
HTTP (deprecated)
1. Fork the val
rom your ValTown settings page, add an environment variable named `bookmarks_client_id` and give it a value (you will be usin
3. Add another environment variable named `bookmarks_client_secret` and give it a value (you will also be using this for savi
4. At first, the "bookmarks" table will not exist, so we need to save an article first, which will create the "bookmarks" tab
this, add a bookmarklet to your browser with this value (replace `BOOKMARKS-CLIENT-ID` and `BOOKMARKS-CLIENT-SECRET` with th
onent(location.href)+'&t='+encodeURIComponent(document.title)+'&id=BOOKMARKS-CLIENT-ID&secret=BOOKMARKS-CLIENT-SECRET', 'Book
6. Click this bookmarklet to bookmark the URL of the current active tab
### Note
Make sure you don't share `bookmarks_client_id` and `bookmarks_client_secret`. It is used for authentication before saving a
return c.text("Authentication details (ID/Secret) missing!");
if (id != Deno.env.get("bookmarks_client_id") || secret != Deno.env.get("bookmarks_client_secret")) {
return c.text("Unauthorized!");
roadlabs avatar
valleGetValsContextWindow
@roadlabs
An interactive, runnable TypeScript val by roadlabs
Script
type: "http",
prompt: "Generate a val that uses React to render HTML",
code: `/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export const reactExample = (request: Request) =>
new Response(renderToString(<div>Test {1 + 1}</div>), {
prompt: null,
code: `/** @jsxImportSource https://esm.sh/preact */
import { render } from "npm:preact-render-to-string";
export const preactExample = (request: Request) =>
new Response(render(<div>Test {1 + 1}</div>), {
type: "http",
code: `/** @jsxImportSource https://esm.sh/preact */
import { render } from "npm:preact-render-to-string";
export default async function(req: Request) {