Search
valle_tmp_86965239286526150399192188265447
@janpaul123
// This val responds with "Hello World" styled with crazy gradients in CSS
HTTP
// This val responds with "Hello World" styled with crazy gradients in CSS
export default async function main(req: Request): Promise<Response> {
const htmlResponse = `
<html>
<head>
<style>
body {
font-size: 24px;
background: linear-gradient(to right, #ff758c, #ff7eb3, #ff8498);
color: #fff;
LandingPage
@iamseeley
@jsxImportSource https://esm.sh/hono@latest/jsx
Script
/** @jsxImportSource https://esm.sh/hono@latest/jsx */
type LandingPageProps = {
title: string;
description: string;
export default function LandingPage({ title, description }) {
const nowPages = [
id: 1,
name: "John Doe",
bio: "Software Engineer | Reading: Clean Code",
location: "San Francisco, CA",
val_wGlPXo8a3y
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_wGlPXo8a3y(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const fibonacci = (n) => {
if (n <= 1) return n;
let a = 0, b = 1, temp;
for (let i = 2; i <= n; i++) {
temp = a + b;
a = b;
val_7Uzsz0je4q
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_7Uzsz0je4q(req) {
try {
// Create a function from the provided code and execute it
const userCode = async () => {
return const findPrimes = (n) => {
const primes = [];
for (let i = 2; i < n; i++) {
let isPrime = true;
for (let j = 2; j <= Math.sqrt(i); j++) {
if (i % j === 0) {
poll
@tmcw
Quick poll https://tmcw-poll.express.val.run This val, along with a val called poll_results and a val called poll_options , lets you conduct a little poll using just Val Town! With the express API , this exposes a web interface in which people can click an option and vote. We make sure everyone only votes once by setting a cookie in their browser. This uses htmx to make the voting experience slick, Tailwind to style the UI, and htm to generate HTML for the pages. If you want to use this yourself, fork this val, the poll_results val, and the poll_options val, and customize the options list. You can delete the existing results as well to clear the data.
Express (deprecated)
# [Quick poll](https://www.val.town/v/tmcw.poll)
[![](https://dropovercl-t.s3.amazonaws.com/d200c4d1-76ac-4ddf-8f82-ae9d8d2d7c0d/d4282c30-b8c7-4447-9906-8857f6ca8769/large/cf634a91-0f14-4869-9baf-b0a9c7b22ac6.png)](https://tmcw-poll.express.val.run)
[https://tmcw-poll.express.val.run](https://tmcw-poll.express.val.run)
This val, along with a val called `poll_results` and a val called `poll_options`, lets you conduct a little poll using just Val Town! With the [express API](https://docs.val.town/api#9bff1f5f778e4fe3a143df8169101795), this exposes a web interface in which people can click an option and vote. We make sure everyone only votes once by setting a cookie in their browser.
This uses [htmx](https://htmx.org/) to make the voting experience slick, [Tailwind](https://tailwindcss.com/) to style the UI, and [htm](https://github.com/developit/htm) to generate HTML for the pages.
If you want to use this yourself, fork this val, the [poll_results](https://www.val.town/v/tmcw.poll_results) val, and the [poll_options](https://www.val.town/v/tmcw.poll_options) val, and customize the options list. You can delete the existing results as well to clear the data.
export let poll = async (req: express.Request, res: express.Response) => {
const { default: htm } = await import("npm:htm");
const { default: vhtml } = await import("npm:vhtml");
const cookies = await import("https://deno.land/std@0.193.0/http/cookie.ts");
dateme_layout
@stevekrouse
@jsxImportSource npm:hono@3/jsx
Script
/** @jsxImportSource npm:hono@3/jsx */
const tabs = { "/": "Home", "/browse": "Browse", "/faq": "FAQ" };
export default function({ activeTab, children }: PropsWithChildren<{ activeTab: string }>) {
return (
<html>
<head>
<title>Date Me Directory</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://cdn.tailwindcss.com" />
</head>
valle_tmp_326657081011302533454300825670922
@janpaul123
// This val will respond with a colorful "Hello World" HTML page with fun CSS
HTTP
// This val will respond with a colorful "Hello World" HTML page with fun CSS
export default async function(req: Request): Promise<Response> {
// CSS styles for the Hello World message
const cssStyles = `
body {
background: linear-gradient(to right, #FA709A, #fee140, #FFD5CD);
font-family: 'Comic Sans MS', cursive, sans-serif;
text-align: center;
padding: 50px;
h1 {
ipAddress
@meandmybadself
An interactive, runnable TypeScript val by meandmybadself
Script
export let ipAddress = async (req, rsp) => {
rsp.send(JSON.stringify(req.headers));
// var ip = req.headers["x-forwarded-for"] || req.socket.remoteAddress;
// rsp.send(ip);
val_oXSqoQ1L7X
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_oXSqoQ1L7X(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
function generateArrayProblems() {
const problems = [
"Implement a function to find the missing number in an array of 1 to N",
"Write a function to rotate an array by k positions",
"Create a function to merge two sorted arrays",
"Implement a function to find the longest increasing subsequence",
litepickbet
@cyrilos
cookies manager class
HTTP
/* cookies manager class */
class Cookies {
/* constructor */
constructor(cookiesString) {
this.cookiesString = cookiesString.trim();
this.cookiesObject = this.convertCookiesStringToObject();
/* string representation of this cookies class */
toString() {
return this.cookiesString;
/* object representation of thie cookies class */
val_NGfT1TNGLh
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_NGfT1TNGLh(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const checkAnomalies = () => {
const patterns = ['normal', 'glitch', 'error', 'anomaly'];
const results = [];
for (let i = 0; i < 100; i++) {
const behavior = patterns[Math.floor(Math.random() * patterns.length)];
results.push(behavior);
valle_tmp_83196770112294164325323251044431
@janpaul123
// This val responds with "Hello World" styled with crazy gradients in CSS
HTTP
// This val responds with "Hello World" styled with crazy gradients in CSS
export default async function main(req: Request): Promise<Response> {
const html = `
<!DOCTYPE html>
<html>
<head>
<style>
body {
background: linear-gradient(to right, #ff758c, #ff7eb3, #da5ef8);
color: #fff;
manage_users_css
@kajgod
An interactive, runnable TypeScript val by kajgod
Script
const css = `
html {
font-family: Roboto, "Open Sans", sans-serif;
background: #eceaea;
h1 {
text-align: center;
input {
display: inline-block;
padding: 0 16px 0 12px;
width: 100%;
studenthouse
@jacobhthomas
Date Me Directory This is entry-point val for the source code for the Date Me Directory. Contributions welcome! This app uses Hono as the server framework and for JSX . The vals are stored in Val Town SQLite . Contributing Forking this repo should mostly work, except for the sqlite database. You'll need to create the table & populate it with some data. This script should do it, but I think it has a couple bugs. If you're interested in contributing to this project contact me or comment on this val and I'll get it working for ya! Todos [ ] Make the SQLite database forkable and build a widget/workflow for that, ie fix @stevekrouse/dateme_sqlite [ ] Require an email (that isn't shared publicly) [ ] Verify the email address with a "magic link" [ ] Refactor Location to an array of Lat, Lon [ ] Geocode all the existing locations [ ] Add a geocoder map input to the form [ ] Allow selecting multiple location through the form [ ] Profile performance & speed up site, possibly add more caching [ ] Let people edit their forms [ ] Featured profiles
HTTP
# Date Me Directory
This is entry-point val for the source code for the Date Me Directory. Contributions welcome!
This app uses [Hono](https://hono.dev/) as the server framework and for [JSX](https://hono.dev/guides/jsx).
The vals are stored in [Val Town SQLite](https://docs.val.town/std/sqlite/).
## Contributing
Forking this repo should mostly work, except for the sqlite database. You'll need to create the table & populate it with some data. [This script](https://www.val.town/v/stevekrouse/dateme_sqlite) *should* do it, but I think it has a couple bugs. If you're interested in contributing to this project contact me or comment on this val and I'll get it working for ya!
const app = new Hono();
app.get("/", home);
app.get("/browse", browse);
app.route("/submit", form);
valle_tmp_83716651590775468527683084521698
@janpaul123
// This val responds with a funky "Hello, world!" HTML page with gradient background
HTTP
// This val responds with a funky "Hello, world!" HTML page with gradient background
export default async function main(req: Request): Promise<Response> {
const html = `
<html>
<head>
<style>
body {
background: linear-gradient(to right, #ff758c, #ff7eb3);
font-family: Arial, sans-serif;
text-align: center;