Search

Results include substring matches and semantically similar vals. Learn more
g avatar
pjsSearchUI
@g
* Repo Search Page * A modern, dark-mode search interface with a minimalist design * Focuses on clean, streamlined layout with AI-generated illustration
HTTP
* Repo Search Page
* A modern, dark-mode search interface with a minimalist design
* Focuses on clean, streamlined layout with AI-generated illustration
function html() {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="/favicon.svg">
dhvanil avatar
val_8kG24m9t0L
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_8kG24m9t0L(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const multiply = (a, b) => a * b; return multiply(4, 7);
// Return the result in a properly formatted response
return new Response(JSON.stringify({
result: result,
type: typeof result
headers: { 'Content-Type': 'application/json' }
brianleroux avatar
auth
@brianleroux
An interactive, runnable TypeScript val by brianleroux
Script
export async function login(c) {
const body = await c.req.formData();
const loggedIn = body.get("password") === Deno.env.get("PASSWORD");
await setSignedCookie(c, "loggedIn", loggedIn + "", Deno.env.get("SECRET"));
export async function logout(c) {
await setSignedCookie(c, "loggedIn", "false", Deno.env.get("SECRET"));
export async function isLoggedIn(c) {
const { loggedIn } = await getSignedCookie(c, Deno.env.get("SECRET"));
console.log("loggedIn", loggedIn);
return loggedIn === "true";
dhvanil avatar
web_cgvolHK08C
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_cgvolHK08C(req) {
return new Response(`<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quantum Grid Analysis - CLASSIFIED</title>
<style>
body {
font-family: monospace;
dhvanil avatar
val_Fc67MCb2Qk
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_Fc67MCb2Qk(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
// Test 1: Precision and floating point arithmetic
function testMathPrecision() {
const pi = Math.PI;
let sum = 0;
// Add tiny amounts and check if precision holds
for(let i = 0; i < 1000000; i++) {
janpaul123 avatar
valle_tmp_1205944128668687835247208564817623
@janpaul123
// This val will respond with a fun HTML page with crazy fonts and gradients
HTTP
// This val will respond with a fun HTML page with crazy fonts and gradients
export default async function main(): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello World</title>
<style>
body {
vlad avatar
blocks_inner
@vlad
// Forked from @tmcw.blocks_inner
Express (deprecated)
export let blocks_inner = async (req, res) => {
const [_, user, id, ...file] = req.path.split("/");
const gist = await fetch(`https://api.github.com/gists/${id}`).then((r) => r.json());
res.set("Cache-Control", "public,max-age=64800");
if (file.filter(Boolean).length) {
if (gist.files[file.filter(Boolean).join("/")].raw_url.endsWith(".js")) {
res.set("Content-Type", "application/javascript");
return res.send(
await fetch(gist.files[file.filter(Boolean).join("/")].raw_url).then((
r,
Daniel avatar
blob_admin
@Daniel
Blob Admin This is a lightweight Blob Admin interface to view and debug your Blob data. Use this button to install the val: It uses basic authentication with your Val Town API Token as the password (leave the username field blank). TODO [x] /new - render a page to write a new blob key and value [x] /edit/:blob - render a page to edit a blob (prefilled with the existing content) [x] /delete/:blob - delete a blob and render success [x] add upload/download buttons [ ] Use modals for create/upload/edit/view/delete page (htmx ?) [ ] handle non-textual blobs properly [ ] use codemirror instead of a textarea for editing text blobs
HTTP
# Blob Admin
This is a lightweight Blob Admin interface to view and debug your Blob data.
![b7321ca2cd80899250589b9aa08bc3cae9c7cea276282561194e7fc537259b46.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/311a
Use this button to install the val:
[![](https://stevekrouse-button.express.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/s
/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
const app = new Hono();
app.use(
jsxRenderer(({ children }) => {
llqhyk777 avatar
worthyChocolateDog
@llqhyk777
An interactive, runnable TypeScript val by llqhyk777
HTTP
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "*",
status: 204,
const openai = new OpenAI();
try {
var body = await req.json();
dhvanil avatar
val_6WXnVNyeHQ
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_6WXnVNyeHQ(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const divide = (a, b) => a / b; return divide(20, 5);
// Return the result in a properly formatted response
return new Response(JSON.stringify({
result: result,
type: typeof result
headers: { 'Content-Type': 'application/json' }
janpaul123 avatar
valle_tmp_066236646798213175732405021232028
@janpaul123
// This val creates a simple Hacker News clone with clickable story titles.
HTTP
// This val creates a simple Hacker News clone with clickable story titles.
// Each story title links to a separate page that displays some fake story content.
const app = new Hono();
const stories = [
{ id: 1, title: "First Fake Story", content: "Content of the first fake story.", details: "100 points by user1 1 hour ago |
{ id: 2, title: "Second Fake Story", content: "Content of the second fake story.", details: "150 points by user2 2 hours ag
{ id: 3, title: "Third Fake Story", content: "Content of the third fake story.", details: "200 points by user3 3 hours ago
app.get("/", (c) => {
const storyList = stories.map(story => `
<div class="story">
pomdtr avatar
chill
@pomdtr
@jsxImportSource https://esm.sh/hono/jsx
Script
/** @jsxImportSource https://esm.sh/hono/jsx */
type HandlerItem = (ctx: Context) => Response | JSX.Element | Promise<Response> | Promise<JSX.Element>;
type Handler = HandlerItem | {
[method: string]: HandlerItem;
export function createRoute(handler: Handler) {
return async (ctx: Context) => {
if (typeof handler == "object") {
const method = ctx.req.method;
if (!(method in handler)) {
throw new HTTPException(405);
pomdtr avatar
blob_editor
@pomdtr
Preview and edit blobs Usage: import blobEditor from "https://esm.town/v/pomdtr/blob_editor" export default blobEditor("article.md") You can easily protect your val behind @pomdtr/password_auth or @pomdtr/email_auth
HTTP
# Preview and edit blobs
Usage:
```ts
export default blobEditor("article.md")
You can easily protect your val behind @pomdtr/password_auth or @pomdtr/email_auth
/** @jsxImportSource https://esm.sh/hono/jsx **/
export function BlobEditor(props: { blob: { language?: string; text: string } }) {
const ref = useRef();
const saveBlob = async () => {
const resp = await fetch("/edit", {
janpaul123 avatar
valle_tmp_660134706381738209052157288478879
@janpaul123
// This val responds with an HTML page styled with funky CSS gradients
HTTP
// This val responds with an HTML page styled with funky CSS gradients
export default async function main(req: Request): Promise<Response> {
const html = `
<html>
<head>
<style>
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #ff4e50, #f9d423);
color: #333;
liamdanielduffy avatar
serveAsHTML
@liamdanielduffy
An interactive, runnable TypeScript val by liamdanielduffy
Script
export function serveAsHTML(req, res, contents) {
res.set("Content-Type", "text/html");
res.send(contents);