Search

Results include substring matches and semantically similar vals. Learn more
moe avatar
frameHtml
@moe
@jsxImportSource npm:hono@3/jsx
Script
/** @jsxImportSource npm:hono@3/jsx */
export const frameHtml = (frame, baseUrl = "") => {
const prefixUrl = url => baseUrl && url.startsWith("/") ? `${baseUrl}${url}` : url
const aspectRatio = frame.aspectRatio || "1.91:1"
return (
<meta property="fc:frame" content="vNext" />
<meta property="of:version" content="vNext" />
<meta property="of:accepts:lens" content="1.0.0" />
<meta property="of:accepts:xmtp" content="2024-02-09" />
<meta property="fc:frame:image" content={prefixUrl(frame.image)} />
iamseeley avatar
valPreview
@iamseeley
// Ensure the handler functions are accessible globally
Script
export async function fetchVal(valId: string) {
try {
const response = await fetch(`https://api.val.town/v1/vals/${valId}`);
if (!response.ok) {
console.error(`Error fetching val with ID ${valId}:`, response.statusText);
return null;
return await response.json();
} catch (fetchError) {
console.error(`Network error fetching val ${valId}:`, fetchError);
return null;
willthereader avatar
Bringing_My_OCD_Online
@willthereader
@jsxImportSource https://esm.sh/hono@latest/jsx
HTTP
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
export const Bringing_My_OCD_Online = (c: Context) => {
return c.html(
<html>
<head>
<title>Bringing My OCD Online</title>
<style
dangerouslySetInnerHTML={{
__html:
`:root{--slate1: hsl(200, 7%, 8.8%);--slate2: hsl(195, 7.1%, 11%);--slate3: hsl(197, 6.8%, 13.6%);--slate4: hsl
dhvanil avatar
val_48vpEOElB4
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_48vpEOElB4(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
// Create a fun ASCII art of a cat
const catArt = `
( o o )
// Create a simple ASCII art animation frames of a bouncing ball
const frame1 = `
o
iamseeley avatar
SubmitSignup
@iamseeley
An interactive, runnable TypeScript val by iamseeley
Script
/** @jsx jsx */
/** @jsxFrag Fragment */
const SubmitSignup = async (c) => {
const SECRET_KEY = Deno.env.get("JWT_SECRET_TOKEN");
try {
const body = await c.req.parseBody();
const username = body["username"];
const email = body["email"];
const password = body["password"];
const salt = await bcrypt.genSalt(10);
postpostscript avatar
authIdExampleComments
@postpostscript
An interactive, runnable TypeScript val by postpostscript
HTTP
authMiddlewareCookie,
type HonoEnvOptional,
userActionsDisplay,
} from "https://esm.town/v/postpostscript/authMiddleware";
const app = new Hono<HonoEnvOptional>();
app.use(
authMiddlewareCookie({
title: "Comments",
optional: true,
verify: {
stevekrouse avatar
tanLadybug
@stevekrouse
content-checker is designed to be a modern, open-source library for programmatic and AI content moderation. Currently content-checker supports image and text moderation. Thanks to LLMs in addition to detecting specific profane words, we can detect malicious intent in text. So, a user who tries to circumvent the AI profanity filter by using a variation of a profane word, or even just a malicious phrase without a specific word in the profanity list, will still be flagged. Image moderation is also supported, using the Inception V3 model of the NSFW JS library. Future features will include moderation tools (auto-ban, bots), more powerful models, and multimedia support for video and audio moderation. To get an API key for the AI endpoints sign up free at https://www.openmoderator.com To install content-checker do npm install content-checker and check out the README: https://github.com/utilityfueled/content-checker
HTTP
`content-checker` is designed to be a modern, open-source library for programmatic and AI content moderation. Currently conte
Thanks to LLMs in addition to detecting specific profane words, we can detect malicious **intent** in text.
So, a user who tries to circumvent the AI profanity filter by using a variation of a profane word, or even just a malicious p
without a specific word in the profanity list, will still be flagged. Image moderation is also supported, using the Inception
Future features will include moderation tools (auto-ban, bots), more powerful models, and multimedia support for video and au
To get an API key for the AI endpoints sign up free at https://www.openmoderator.com
/** @jsxImportSource npm:hono@3/jsx */
const app = new Hono();
const apiKey = Deno.env.get("OPEN_MODERATOR_API_KEY");
if (!apiKey) {
willthereader avatar
simplifiedProjectPage
@willthereader
@jsxImportSource https://esm.sh/hono@latest/jsx
HTTP
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
export const projects = (c: Context) => {
return c.html(
<html>
<body>
<div>
<a href="/projects/Debugging_Guide">
Debugging Guide
</a>
</div>
vawogbemi avatar
short
@vawogbemi
Short URLs A URL shortener in Val Town! This turns URLs into strings like https://vawogbemi-short.web.val.run/JK An implementation of https://www.val.town/v/tmcw/short It uses SQL instead of express persistent storage. Table Schema Short(id INT, url TEXT)
HTTP
# Short URLs
A URL shortener in Val Town! This turns URLs into strings like
```https://vawogbemi-short.web.val.run/JK```
An implementation of https://www.val.town/v/tmcw/short
It uses SQL instead of express persistent storage.
## Table Schema
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
const app = new Hono();
const sqids = new Sqids();
app.get("/", (c) => {
tmcw avatar
oldfashioned
@tmcw
@jsxImportSource npm:hono/jsx
HTTP
/** @jsxImportSource npm:hono/jsx */
// TODO: Deno doesn't have a pattern for this?
const app = new Hono();
const { styleRoute, StyleTag } = styleSystem();
function MaterialsList() {
const c = useContext(RequestContext);
const mats = getMaterialIds(c);
return (
<plank id="materials-list" hx-swap-oob="true">
<details open>
dhvanil avatar
web_Q99YAJsL65
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_Q99YAJsL65(req) {
return new Response(`<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>
<style>
body { font-family: sans-serif; margin: 2rem; }
</style>
dhvanil avatar
web_8g1k95HemV
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_8g1k95HemV(req) {
return new Response(`<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Retro Space Interface</title>
<style>
body {
margin: 0;
dhvanil avatar
web_xBDVCIfKtv
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_xBDVCIfKtv(req) {
return new Response(`<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Escape Plan Diagram</title>
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
<style>
body {
dhvanil avatar
web_2l64kXRF3P
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_2l64kXRF3P(req) {
return new Response(`<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Silent Syntax: How AI is Rewiring Human Communication</title>
<style>
body {
background-color: #0a0a0a;
reecer avatar
viewSource
@reecer
View source code Just like a right click + inspect on desktop, except available on mobile too! Just write the website after the / e.g. https://neverstew-viewSource.web.val.run/bbc.co.uk
HTTP
# View source code
Just like a right click + inspect on desktop, except available on mobile too! Just write the website after the `/`
e.g.
```https://neverstew-viewSource.web.val.run/bbc.co.uk```
export default async function viewSource(req: Request) {
const pathname = new URL(req.url).pathname;
const html = await fetchText(pathname === "/" ? "example.com" : pathname); // .then(prettifyHtml);
const body = `<html>
<head>
<script