Search
valle_tmp_02528498064862305709681305839658072
@janpaul123
// This val will respond with a simple "Hello World" HTML page with fun CSS
HTTP
// This val will respond with a simple "Hello World" HTML page with fun CSS
export default async function(req: Request): Promise<Response> {
// HTML content with style tag for fun CSS
const htmlContent = `
<html>
<head>
<style>
body {
background-color: #f0f0f0;
font-family: Arial, sans-serif;
md2html
@nilslice
An interactive, runnable TypeScript val by nilslice
HTTP
import createPlugin from "https://esm.sh/@extism/extism";
export default async function(req: Request): Promise<Response> {
const plugin = await createPlugin(
"https://cdn.modsurfer.dylibso.com/api/v1/module/ec17c9afde08aa9e7fa857fe2c9cbb9206e3a3dbec98429ceebd3421de7070da.wasm",
{ useWasi: false },
const data = {
event_file_name: "input.md",
event_file_data: btoa(await req.text()),
let out = await plugin.call("on_file_write", JSON.stringify(data));
return Response.json(out.json());
blurbs
@yawnxyz
Blurbs Generator Give it a link (article, Science paper, or a PDF link), get a blurb and a bunch of tags. Built for Capsid & Tail but you can obviously use it for whatever
HTTP
# Blurbs Generator
Give it a link (article, Science paper, or a PDF link), get a blurb and a bunch of tags.
Built for [Capsid & Tail](https://phage.directory/capsid) but you can obviously use it for whatever
/** @jsx jsx */
const app = new Hono();
const Layout = ({ children, title = "Content Summary and Tagging" }) => (
<html lang="en">
<head>
<title>{title}</title>
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
valle_tmp_272229477861650756686636317711954
@janpaul123
// Initialize sample stories and store them in blob storage
HTTP
const SAMPLE_STORIES_KEY = "hn_realistic_sample_stories";
// Initialize sample stories and store them in blob storage
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.company.catchPhrase(),
url: faker.internet.url(),
votes: Math.floor(Math.random() * 100),
valle_tmp_3661823205745988729784285117582465
@janpaul123
// This val responds with "Hello World" styled with crazy gradients using CSS
HTTP
// This val responds with "Hello World" styled with crazy gradients using CSS
export default async function main(req: Request): Promise<Response> {
const html = `
<html>
<head>
<style>
body {
background: linear-gradient(to right, violet, indigo, blue, green, yellow, orange, red);
text-align: center;
padding: 20px;
hootsuiteNasa
@stevekrouse
This uses the now-deprecated express handler. Comment on this val if you'd like me to update it. Or send me a PR :)
Script
This uses the now-deprecated express handler. Comment on this val if you'd like me to update it. Or send me a PR :)
export async function hootsuiteNasa(req: express.Request, res: express.Response) {
const NASA_ROOT = "https://images-api.nasa.gov";
const alphaNumericSpaces = new RegExp("^[a-zA-Z0-9\\s-_]+$");
const acceptableRedirectUri = new RegExp(
"^https:\/\/api-auth.hootsuite.com\/app-directory\/apps\/[0-9]+\/oauth2\/callback$",
if (req.path === "/v1/media") {
var data = [];
var query = req.query.query || "africa";
if (!alphaNumericSpaces.test(query)) { // special chars in search
valle_tmp_00064030846966756093391421685546172
@janpaul123
// This val serves an HTML page with an input field to enter a name and greets the user when the form is submitted.
HTTP
// This val serves an HTML page with an input field to enter a name and greets the user when the form is submitted.
export default async function(req: Request): Promise<Response> {
const decoder = new TextDecoder();
const formData = new URLSearchParams(decoder.decode(await req.arrayBuffer()));
let name = formData.get("name") || "Guest";
const html = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
sauron
@agmm
An interactive, runnable TypeScript val by agmm
HTTP
const app = new Hono();
const count = await blob.getJSON("count") as number || 0;
app.get("/", async (c) => {
await blob.setJSON("count", count + 1);
const eyes = new Array(count).fill("šļø").join("");
return c.text(`Every visit adds an eye.\n\n${eyes}`);
app.get("/reset", async (c) => {
const { key } = c.req.query();
if (key !== Deno.env.get("EYE_KEY")) {
c.status(401);
pinkEgret
@maxm
// import { Request, Response } from "./node_modules/express/index.js";
HTTP
// import { Request, Response } from "./node_modules/express/index.js";
export default async function(req: Request): Promise<Response> {
console.log("Request received:", req);
try {
// Your code logic here'
return Response.json({ ok: true });
} catch (error) {
console.error("Error:", error);
return Response.json({ error: "Internal Server Error" }, { status: 500 });
val_EzhMBKOVWM
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_EzhMBKOVWM(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
// Let's explore how complexity and meaning can emerge from simplicity
// This time modeling the concept of interconnectedness and growth
function createFractalTree(depth) {
if (depth === 0) return ['|'];
const patterns = [];
const previousLevel = createFractalTree(depth - 1);
ExportToDataLakeIsDying
@nicosql
An interactive, runnable TypeScript val by nicosql
HTTP
export default async function(req: Request): Promise<Response> {
const url = "https://get.conduitbi.com/conduitbi--5933c";
// Generate QR code as SVG
const qr = await QRCode.toString(url, {
type: "svg",
width: 512, // High resolution
margin: 4,
color: {
dark: "#000000",
light: "#ffffff",
valle_tmp_59911482378691447005033175563414
@janpaul123
// This val will serve an HTML page emulating a Hacker News clone.
HTTP
// This val will serve an HTML page emulating a Hacker News clone.
// It uses plain HTML and CSS to create the frontend. Eventually,
// we can make it interactive with additional scripts.
export default async function(req: Request): Promise<Response> {
const url = new URL(req.url);
const pathname = url.pathname;
// If the user navigates to a specific story page
if (pathname.startsWith("/story/")) {
const storyId = pathname.split("/")[2];
return new Response(renderStoryPage(storyId), {
html
@chilly
An interactive, runnable TypeScript val by chilly
Script
export const html = () => {
return `<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"></head><body><div>111111</div></body></html>`;
glifJson
@cjpais
// Forked from @jamiedubs.glifJson
Script
export const glifJson = async (id: string) => {
const getRandom = (list) => {
const shuffledList = list.sort(function () {
return 0.5 - Math.random();
const numToPick = Math.min(20, shuffledList.length);
var randomItems = [];
for (let i = 0; i < numToPick; i++)
randomItems.push(shuffledList[i]);
return randomItems;
const url = `https://alpha.glif.xyz/api/glifs?id=${id}`;
decentauthhandler
@apitman
An interactive, runnable TypeScript val by apitman
HTTP
await sqlite.execute(`create table if not exists kv(
key text unique,
value text
class ValKv {
async get(key: string) {
const results = await sqlite.execute({
sql: `SELECT value FROM kv WHERE key = :key`,
args: { key },
if (results.rows.length === 0) {
return null;