Trending Vals

121
stevekrouse avatar
stevekrouse
blueskyAlert
Cron
Forked from buttondown/runner
0
122
stevekrouse avatar
stevekrouse
getDayName
Script
Get the day of week name JavaScript's Date.prototype.getDay() returns a number that represents the day of the week, 0 for Sunday, 1 for Monday, etc. This function returns the name of the week, ie "Sunday" , "Monday" , etc. The function optionally inputs a Date object, but will default to the current time if none is provided.
0
123
pomdtr avatar
pomdtr
verifyUserEmail
Script
Check that a string match your profile email
0
124
NurseA80 avatar
NurseA80
cerebras_coder
HTTP
Forked from stevekrouse/cerebras_coder
1
125
pomdtr avatar
pomdtr
lastloginHono
Script
See @pomdtr/lastlogin for more informations about the middleware Example /** @jsxImportSource npm:hono@3/jsx */ import { lastlogin } from "https://esm.town/v/pomdtr/lastloginHono"; import { verifyUserEmail } from "https://esm.town/v/pomdtr/verifyUserEmail" import { Hono } from "npm:hono"; const app = new Hono(); const lastloginMiddleware = lastlogin({ verifyEmail: verifyUserEmail }); // required for the auth pages to work app.use("/auth/*", lastloginMiddleware); // this page is public app.get("/", async (c) => { return c.html( <div> There is a secret message for you if you{" "}<a href="/secret">login</a> </div>, ); }); // this page requires the user to signup app.get("/secret", lastloginMiddleware, async (c) => { const email = c.req.header("X-User-Email"); return c.html( <div> I think {email} is a really silly email address, actually. </div>, ); }); export default app.fetch;
1
126
taras avatar
taras
markdown_download
HTTP
Forked from taras/scrape2md
2
127
shibrarafaqat avatar
shibrarafaqat
cerebras_coder
HTTP
Forked from stevekrouse/cerebras_coder
0
128
stevekrouse avatar
stevekrouse
calories
HTTP
Forked from stevekrouse/calories_old
1
129
executiveCoder avatar
executiveCoder
extraordinaryBrownEmu
Script
Forked from executiveCoder/cerebras_coder
0
130
executiveCoder avatar
executiveCoder
cerebras_coder
Script
Forked from stevekrouse/cerebras_coder
0
131
stevekrouse avatar
stevekrouse
stripFences
Script
Strip Fences Useful for stripping out code fences, ie from a reply from an llm where you want code and it replies with markdown code fences around that code.
0
132
tmcw avatar
tmcw
bandcampWrapped
HTTP
Bandcamp Wrapped It's Spotify Wrapped, but for Bandcamp! . Bandcamp is for people who buy their music and probably most of them hoard MP3s. Like me. And this val helps those people turn their Bandcamp purchases of 2024 into HTML or Markdown suitable for blog posts on their blogs, which is probably a segment that has some overlap with the people who are wacky enough to buy their music instead of streaming it from some service. Because Bandcamp doesn't have an API, this hinges on you going to your purchases page, copying the purchases, and pasting it in. Thanks to the ability of the system clipboard to contain HTML , the same technology that makes copy-and-pasted text have unpredictable and annoying font and boldness choices also lets this parse and reformat that purchases page into something shareable. I would love for this to support embeds as well, but I haven't found a strategy yet: Bandcamp embeds use album IDs in the URLs, which are not exposed in the content on the purchases page. I'd have to scrape Bandcamp for that, which would probably inevitably be blocked by some 'bot protection' system. Also read about this on macwright.com .
1
133
stevekrouse avatar
stevekrouse
productiveRosePeacock
HTTP
Forked from stevekrouse/cerebras_coder
0
134
stevekrouse avatar
stevekrouse
lovableVioletPeafowl
HTTP
Forked from stevekrouse/cerebras_coder
0
135
nmtech avatar
nmtech
cerebras_coder
HTTP
Forked from CerebrasCoder/cerebras_coder
0
136
stevekrouse avatar
stevekrouse
cors_example
HTTP
CORS issues are the bane of frontend engineers. In Val Town, if you don't customize any CORS headers, we add these defaults: Access-Control-Allow-Origin: "*" Access-Control-Allow-Methods: "GET,HEAD,PUT,PATCH,POST,DELETE" You can override them if you wish to disallow CORS. This val is a client-side-rendered React app that makes requests to @stevekrouse/cors_example_backend. The backend is in a different val because CORS applies to requests on different domains. The backend has examples of the default permissive CORS behavior and disabled CORS.
1
137
stevekrouse avatar
stevekrouse
getShowcaseVals
Script
Get vals that were created in the last month, augmented with all sorts of AI and screenshots, and shoved in a sqlite database for @stevekrouse/showcase.
1
138
prashamtrivedi avatar
prashamtrivedi
icsviewer
HTTP
ICS Calendar Viewer A web-based calendar application for viewing ICS (iCalendar) files, deployed as a Val Town HTTP val. Features 📅 Monthly calendar view 📤 ICS file upload support 📋 ICS content paste support 🌓 Dark/Light mode 🎨 Automatic event coloring Usage Access the calendar through your Val Town HTTP val URL Upload ICS files or paste ICS content View your events on the calendar Toggle dark/light mode as needed Navigate between months Technical Details Built with React 18.2.0 and TailwindCSS Handles ICS file parsing and display No data persistence (events are stored in memory only) Fork and Modify Fork this val Make your changes Save to automatically deploy your version
1
139
stevekrouse avatar
stevekrouse
openai
Script
OpenAI ChatGPT helper function This val uses your OpenAI token if you have one, and the @std/openai if not, so it provides limited OpenAI usage for free. import { chat } from "https://esm.town/v/stevekrouse/openai"; const { content } = await chat("Hello, GPT!"); console.log(content); import { chat } from "https://esm.town/v/stevekrouse/openai"; const { content } = await chat( [ { role: "system", content: "You are Alan Kay" }, { role: "user", content: "What is the real computer revolution?"} ], { max_tokens: 50, model: "gpt-4o" } ); console.log(content);
1
140
maxm avatar
maxm
emojiInstantSearch
HTTP
Forked from maxm/simpleWikipediaInstantSearch
2
141
iamseeley avatar
iamseeley
multirouteSvelte
HTTP
🌐 Multi-Route Website with Svelte
1
142
pomdtr avatar
pomdtr
fetchValInfo
Script
Usage import { fetchValInfo } from "https://esm.town/v/pomdtr/fetchValInfo" const val = await fetchValInfo(import.meta.url) console.log(val.id) What's the difference with extractValInfo ? @pomdtr/extractValInfo get metadata synchronously by analysing the val import url, while @pomdtr/fetchValInfo perform an http call to the val.town REST api. Only use fetchValInfo if you need some metadata that are not available from extractValInfo .
1
143
browserbase avatar
browserbase
browserbaseUtils
Script
Utils to loadPageContent() and screenshotPage() . Browserbase Browserbase offers a reliable, high performance serverless developer platform to run, manage, and monitor headless browsers at scale. Leverage our infrastructure to power your web automation and AI agents. Get started with Browserbase for free here . If you have any questions, reach out to developer@browserbase.com.
1
144
pomdtr avatar
pomdtr
http_client
HTTP
HTTP Client Attach a postman-like http client to your vals, with bookmarks and history support Usage Wrap your http handler in an the httpClient middleware. import {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }) The http client will be shown on the root. Adding bookmarks You might want to bookmark some requests you need often. You can do it by passing a bookmark list as a middleware option: import {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }, { bookmarks: [ { "label": "Dummy Request", "request": new Request("https://dummyjson.com/products") } ]}) Customizing the client path import {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }, { path: "/http-client" }) TODO [ ] fix syntax highlighting on successive request [ ] allow to prefill the initial request
7
145
adnane007al avatar
adnane007al
friendlyChocolateCrayfish
HTTP
Forked from stevekrouse/cerebras_coder
0
146
uran69 avatar
uran69
cerebras_coder
HTTP
Forked from stevekrouse/cerebras_coder
0
147
caiobruno avatar
caiobruno
cerebras_coder
HTTP
Forked from stevekrouse/cerebras_coder
0
148
yawnxyz avatar
yawnxyz
cerebras_coder
HTTP
Forked from stevekrouse/cerebras_coder
0
149
technovator avatar
technovator
cerebras_coder
HTTP
Forked from aksh202004/cerebras_coder
0
150
aksh202004 avatar
aksh202004
cerebras_coder
HTTP
Forked from stevekrouse/cerebras_coder
0