Search

Results include substring matches and semantically similar vals. Learn more
jxnblk avatar
hello_cli
@jxnblk
Example CLI hosted on Val Town Install with Deno on your computer (name it whatever you want): deno install -n hello https://esm.town/v/jxnblk/hello_cli Run: hello Uninstall: deno uninstall hello Read the deno install docs
Script
Example CLI hosted on Val Town
Install with Deno on your computer (name it whatever you want):
```sh
deno install -n hello https://esm.town/v/jxnblk/hello_cli
Run:
```sh
// deno install -n hello https://esm.town/v/jxnblk/hello_cli
export default function main() {
const name = Deno.args[0] || "";
console.log(`hello ${name}`);
horatiothomas avatar
dream_interpreter_journal_dictionary_app
@horatiothomas
An interactive, runnable TypeScript val by horatiothomas
HTTP
export default async function handler(request: Request) {
if (request.method === "GET") {
return new Response(
`<!DOCTYPE html>
<html>
<head>
<title>Dream Interpreter</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.3/dist/tailwind.min.css" rel="stylesheet">
<script>
wesbos avatar
displayGuestBook
@wesbos
An interactive, runnable TypeScript val by wesbos
Express (deprecated)
export function displayGuestBook(req: express.Request, res: express.Response) {
const message = req.query.message?.slice(0, 15);
guestCount++;
if (message && !guestBook.includes(message)) {
guestBook = [
message,
// ...@wesbos.guestBook, Disabled for now
res.send(`
<html>
<h1>Guest Book</h1>
pomdtr avatar
hackernews_cmdk
@pomdtr
An interactive, runnable TypeScript val by pomdtr
HTTP
const app = new Hono();
app.get("/", (c) => {
return c.json({
type: "list",
list: {
items: [
title: "Search Front Page",
actions: [
type: "push",
push: {
rayyan avatar
attendance
@rayyan
An interactive, runnable TypeScript val by rayyan
HTTP
export default async function(req: Request): Promise<Response> {
const facultyNo = new URL(req.url).searchParams.get("faculty") ?? "23aebea336";
const html = await fetch(
`https://ctengg.amu.ac.in/web/table.php?id=${facultyNo}`,
).then((r) => r.text());
const $ = cheerio.load(html);
const [name, faculty] = ($("body > div.table-responsive > strong").html() || "<br>").split("<br>");
type Attendance = {
code: string;
total: string;
impedivity avatar
tanaSave
@impedivity
// console.log(console.log(JSON.stringify(Request)));
HTTP
const token = Deno.env.get("tanaInputAPI");
console.log(token);
console.log(Request);
// console.log(console.log(JSON.stringify(Request)));
export const tanaSave = async (req: Request) => {
// console.log("Hello, World!");
const app = new Hono();
app.get("/", async c => c.text("Hello from Hono!"));
app.get("/save", async c => c.text("Endpoint: /save"));
app.get("/save2", async c => {
postpostscript avatar
myIdeas
@postpostscript
@postpostscript 's ideas [ ] betaify - fork a val and optionally its dependencies, then kill them all later [ ] import proxy removing or bundling any with .ts or .vue or whatever - in progress if you want to screw with it [ ] sync sqlite between accounts [x] provide read only query access to sqlite: @postpostscript/sqlitePublic [x] backup function that backs up everything on your account (still queryable through @postpostscript/sqliteUniverse): @postpostscript/sqliteBackup [ ] authenticated poll [ ] sign data left on other account to prevent impersonation [x] readme editor ( @postpostscript/readmeManager ) [ ] request wrapper/middleware to serve favicon [x] [multi-account sqlite query @postpostscript/sqliteUniverse [ ] UI to explore public queryable data [ ] val profiler [ ] zachlike game with Vals as the base [ ] choose your own adventure with editor and state stored in URL [ ] new blog post page [ ] doctest runner [ ] recipe manager + auto scheduler -- every week it tells you a list of recipes + a shopping list. you rate what you cook and it gets recommended later if you liked it [ ] ticktick integration [ ] generic interface for actor model
HTTP
# [@postpostscript](/)'s ideas
- [ ] betaify - fork a val and optionally its dependencies, then kill them all later
- [ ] import proxy removing or bundling any with .ts or .vue or whatever - [in progress if you want to screw with it](typescr
- [ ] sync sqlite between accounts
- [x] provide read only query access to sqlite: [@postpostscript/sqlitePublic](https://val.town/v/postpostscript/sqlitePublic
- [x] `backup` function that backs up everything on your account (still queryable through @postpostscript/sqliteUniverse): [@
// @vtIdeas
// @title my ideas
export default function(req: Request) {
const { author, name } = extractValInfo(import.meta.url);
dhvanil avatar
web_mmtKPYGP3m
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_mmtKPYGP3m(req) {
return new Response(`<!DOCTYPE html>
<html>
<head>
<title>Quantum Breach Synchronization Plan</title>
<style>
body { background: #000; color: #0f0; font-family: monospace; padding: 20px; }
.warning { color: #f00; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
pre { background: #001100; padding: 10px; }
nbbaier avatar
vtghBlog
@nbbaier
An interactive, runnable TypeScript val by nbbaier
Script
const app = new Hono();
const homepage = extractValInfo(import.meta.url);
const repo = "nbbaier/tidal-triaxial";
const content = "posts";
const apiUrl = `https://api.github.com/repos/${repo}/contents/${content}`;
const contentUrl = `https://raw.githubusercontent.com/${repo}/main/${content}`;
const editUrl = `https://github.com/${repo}/edit/main/${content}`;
app.get("/", async c => {
const posts = await getPosts(
apiUrl,
pomdtr avatar
sync
@pomdtr
Sync local <-> remote vals TODO [ ] Separate the logic in two steps: Detect changes Apply changes
Script
# Sync local <-> remote vals
## TODO
- [ ] Separate the logic in two steps:
1. Detect changes
2. Apply changes
const valtownToken = Deno.env.get("VALTOWN_TOKEN");
if (!valtownToken) {
console.error("VALTOWN_TOKEN is required");
Deno.exit(1);
export async function fetchEnv() {
stevekrouse avatar
satisfiedPinkAnteater
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP
export default async function (req: Request): Promise<Response> {
return Response.json({ ok: true })
tmcw avatar
arenaApiExample
@tmcw
Are.na API Example of using the are.na API to get the contents of an Are.na board - specifically my fun board that showcases websites with that "glossy black style." All you need is fetch to make this happen!
Script
# Are.na API
Example of using the [are.na](https://dev.are.na/documentation/channels#Block43472) API to get the contents of an Are.na boar
All you need is [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make this happen!
import { fetch } from "https://esm.town/v/std/fetch";
export let arenaApiExample = (async () => {
const resp = await fetch(
"http://api.are.na/v2/channels/that-glassy-dark-design-style",
const json = await resp.json();
return json;
karkowg avatar
isAaronAtTheBadPlaceYet
@karkowg
Is Aaron Francis at the bad place yet? Periodically check if Aaron Francis has created his account on bsky!
Cron
# Is Aaron Francis at the bad place yet?
Periodically check if Aaron Francis has created his account on bsky!
export default async function () {
const handles = [
"aaronfrancis.com",
"aarondfrancis.bsky.social"
for (const handle of handles) {
try {
const response = await fetch(`https://bsky.social/xrpc/com.atproto.identity.resolveHandle?handle=${handle}`);
if (response.status === 200) {
lcarbonaro avatar
ingeniousAmberBird
@lcarbonaro
An interactive, runnable TypeScript val by lcarbonaro
HTTP
export default async function (req: Request): Promise<Response> {
return Response.json({
name: "valtown",
age: 42,
isMember: true
dhvanil avatar
val_qTMN8anzhZ
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_qTMN8anzhZ(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const isValidBalancedParentheses = (str) => {
const stack = [];
for (const char of str) {
if (char === '(') {
stack.push(char);
} else if (char === ')') {