Trending Vals

61
andreterron avatar
examplePDF
@andreterron
HTTP (deprecated)
Forked from vtdocs/examplePDF
62
muhammad_owais_warsi avatar
todoListUsingBlob
@muhammad_owais_warsi
HTTP
A simple TODO list using Blob Storage
63
maxm avatar
multiplayerCircles
@maxm
HTTP (deprecated)
Multiplayer Circles Move circles around. State is synced with the server. Open a window in another tab and watch the circles update as you move them .
64
substrate avatar
shapeshift
@substrate
HTTP (deprecated)
Semantically map a JSON object to a target schema using Substrate . 🪩 To fork, sign up for Substrate to get your own API key and $50 free credits.
65
csl_ avatar
dndoodle
@csl_
HTTP
DNDoodle My DND group has used doodle for ages to schedule our sessions, but it never really worked that great for us. We just didn't need that many features. This was my very first val and honestly, I couldn't be happier with it.
66
jeffreyyoung avatar
MazeBot
@jeffreyyoung
HTTP (deprecated)
Forked from jeffreyyoung/BaseBot
67
jxnblk avatar
vimarkdown
@jxnblk
HTTP
vimarkdown Try it now A VIM-mode markdown editor built with Val Town . Features Write markdown in the browser with VIM keybindings Minimal, focused UI Saves to localStorage Multiple color modes Markdown -> HTML preview (⌘+P) NOT mobile-friendly Fork this editor on Val Town to make it your own Inspired by iA Writer Made by Jxnblk TODO [ ] Add syntax highlighting to frontmatter block [ ] Support multiple fonts
68
jeffreyyoung avatar
identicalPeachDamselfly
@jeffreyyoung
HTTP (deprecated)
Forked from jeffreyyoung/MazeBot
69
pomdtr avatar
sql
@pomdtr
Script
SQL Template Tag Port of blakeembrey/sql-template-tag for usage in val.town. Usage import { sqlite } from "https://esm.town/v/std/sqlite" import { sql, zip } from "https://esm.town/v/pomdtr/sql" const query = sql`SELECT * FROM books WHERE author = ${author}`; console.log(query.sql) // => "SELECT * FROM books WHERE author = ?" console.log(query.args) // => [author] const res = await sqlite.execute(query) console.table(zip(res)) For advanced usage (ex: nesting queries), refer to the project readme .
70
samwillis avatar
pglite
@samwillis
HTTP
Forked from maxm/pgliteNpm
71
stevekrouse avatar
dailyStandupBot
@stevekrouse
Cron
Daily Standup Bot Every weekday at 9am EDT send a message to our team's #engineering Discord channel to start a thread to remind us to do our standup. Slack version: @mikker/dailySlackRoundup Note : We started doing in-person standups at Val Town, so this val was unscheduled. To get it working for you, you'll need to: Fork it Change its type from Script to Cron and set a schedule like 0 13 * * 1-5
72
veddevv avatar
snakeclone
@veddevv
HTTP
Snake clone with effects.
73
andreterron avatar
renderFormAndSaveData
@andreterron
HTTP (deprecated)
Render form and save data This val provides a web-based interface for collecting email addresses. It features a dual-functionality approach: when accessed via a web browser using a GET request, it serves an HTML form where users can submit their email address. If the script receives a POST request, it implies that the form has been submitted, and it proceeds to handle the incoming data. Fork this val to customize it and use it on your account.
74
dthyresson avatar
movieMashup
@dthyresson
HTTP
Movie Mashup It's Blader Runner meets Pretty in Pink. OpenAI generated movie maship title, tagline and treatments. Fal generated movie posters.
75
moe avatar
lostKeys
@moe
HTTP
Forked from moe/exampleP5sketch
76
stevekrouse avatar
nominatimSearch
@stevekrouse
Script
Geocode a free-form description via the Nominatim API The search API allows you to look up a location from a textual description or address. Nominatim supports structured and free-form search queries. Docs: https://nominatim.org/release-docs/latest/api/Search/
77
stevekrouse avatar
lucia_adapter
@stevekrouse
Script
Forked from pomdtr/lucia_adapter
78
samwho avatar
featureflags
@samwho
HTTP
Feature Flags This val demonstrates a very simple feature flag implementation. There is a const in the file called FLAGS which stores the feature flags defined, fork this val and modify this value to setup your own flags. Defining flags The example FLAGS value is: const FLAGS: Record<string, Flag> = { "flag1": Flag.rollout(0.5), "flag2": Flag.enabled().block("user_123"), "flag3": Flag.disabled().allow("hello@samwho.dev"), }; This demonstrates: flag1 -- a flag that will be enabled for 50% of users (more on how users are defined later) flag2 -- a flag that is enabled for everyone except user_123 flag3 -- a flag that is disabled for everyone except hello@samwho.dev Endpoints There are two endpoints: / -- the root endpoint fetches all flags for the given user. /:id -- fetches just one flag value, given by :id , for the given user. Specifying users By default, the user is determined by IP address. If you want to be more specific, you can pass in the ?userId query parameter to any endpoint and that will be used instead. How it works This val works by hashing the userId and using the resulting value to determine whether a flag should be enabled or disabled. In a 50% rollout, for example, the numeric hash of the userId is taken and divided by the maximum hash value. If the result is less than the rollout percentage, the flag is enabled. This allows for completely stateless feature flags, no database required. To prevent the same users getting features first all of the time, the flag name is prepended to the userId before hashing.
79
stevekrouse avatar
sendDiscordMessage
@stevekrouse
Script
Forked from ktodaz/sendDiscordMessage
80
stevekrouse avatar
sqliteAdminDashboard
@stevekrouse
HTTP
Simple SQLite dashboard made by townie in this video: https://x.com/stevekrouse/status/1833577807093371325
81
stevekrouse avatar
lucia_adapter_base
@stevekrouse
Script
Forked from pomdtr/lucia_adapter_base
82
stevekrouse avatar
lucia_middleware_vanilla
@stevekrouse
HTTP (deprecated)
Forked from stevekrouse/lucia_middleware
83
jxnblk avatar
blogOGImage
@jxnblk
HTTP (deprecated)
OG image service for https://val.town/v/jxnblk/dotcom – https://jxnblk.com
84
mattx avatar
verify_discord_signature
@mattx
Script
verify_discord_signature Verify HTTP signatures coming from Discord. public_key should be the Ed25519 public key from Discord, as a hex string body should be the request body as a string. If you have a JSON object as the request body, use JSON.stringify. signature should be the X-Signature-Ed25519 header timestamp should be the X-Signature-Timestamp header You must return a 401 error and return early if this function returns false, otherwise you will pretty quickly get a big scary warning from Discord that your endpoint has been removed. Note that you'll only be able to add one once you've integrated this correctly. As this function only deals with strings, it doesn't matter whether you use an Express or web endpoint.
85
hootz avatar
telegramDalleBot
@hootz
Script
Telegram DALLE Bot A personal telegram bot you can message to create images with OpenAI's DALLE ✨ Set up yours fork this val speak to telegram’s https://t.me/botfather to create a bot and obtain a bot token set the bot token as a val town secret called telegramDalleBotToken add a random string as a val town secret called telegramDalleBotWebhookSecret set up your webhook with telegram like this: // paste and run this in your workspace on here @vtdocs.telegramSetWebhook(@me.secrets.telegramDalleBotToken, { url: /* your fork's express endpoint (click the three dots on a val) */, allowed_updates: ["message"], secret_token: @me.secrets.telegramDalleBotWebhookSecret, }); message your bot some prompts! (if you get stuck, you can refer to the telegram echo bot guide from docs.val.town)
86
maxm avatar
valTownChatGPT
@maxm
HTTP (deprecated)
ChatGPT Implemented in Val Town Demonstrated how to use assistants and threads with the OpenAI SDK and how to stream the response with Server-Sent Events.
87
stevekrouse avatar
sqlite_admin
@stevekrouse
HTTP (deprecated)
Forked from stevekrouse/reactExample
88
stevekrouse avatar
TodoApp
@stevekrouse
HTTP (deprecated)
SSR React Mini & SQLite Todo App This Todo App is server rendered and client-hydrated React. This architecture is a lightweight alternative to NextJS, RemixJS, or other React metaframeworks with no compile or build step. The data is saved server-side in Val Town SQLite . SSR React Mini Framework This "framework" is currently 44 lines of code, so it's obviously not a true replacement for NextJS or Remix. The trick is client-side importing the React component that you're server rendering . Val Town is uniquely suited for this trick because it both runs your code server-side and exposes vals as modules importable by the browser. The tricky part is making sure that server-only code doesn't run on the client and vice-versa. For example, because this val colocates the server-side loader and action with the React component we have to be careful to do all server-only imports (ie sqlite) dynamically inside the loader and action , so they only run server-side.
89
stevekrouse avatar
twitterAlert
@stevekrouse
Cron
Twitter 𝕏 keyword Alerts Custom notifications for when you, your company, or anything you care about is mentioned on Twitter. 1. Authentication You'll need a Twitter Bearer Token. Follow these instructions to get one. Unfortunately it costs $100 / month to have a Basic Twitter Developer account. If you subscribe to Val Town Pro, I can let you "borrow" my token. Just comment on this val and I'll hook you up. 2. Query Change the query variable for what you want to get notified for. You can use Twitter's search operators to customize your query, for some collection of keywords, filtering out others, and much more! 3. Notification Below I'm sending these mentions to a private channel in our company Discord, but you can customize that to whatever you want, @std/email, Slack, Telegram, whatever. TODO [x] ~Filter out retweets. We've long wanted to filter these out. Should be a quick fix if anyone wants to send me a PR :)~ Completed by @sumukh
90
vtdocs avatar
supabaseSDKSelectMyFirstTable
@vtdocs
Script
Selecting from a Supabase table using the SDK. Part of the Supabase guide on docs.val.town .