Search

Results include substring matches and semantically similar vals. Learn more
pomdtr avatar
sunbeamTrendingRepositories
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
import { trendingRepositories } from "https://esm.town/v/pomdtr/trendingRepositories";
export async function sunbeamTrendingRepositories() {
const repositories = await trendingRepositories();
const items = repositories.map((repo) => ({
title: repo.name,
subtitle: repo.description || "",
accessories: [`${repo.stargazers_count} *`],
actions: [{ type: "open", target: repo.html_url }],
return { type: "list", items };
pomdtr avatar
deeplink
@pomdtr
An interactive, runnable TypeScript val by pomdtr
HTTP (deprecated)
export default function(req: Request) {
const url = new URL(req.url);
if (!url.searchParams.has("url")) {
return new Response("No URL provided", {
status: 400,
const args = encodeURIComponent(JSON.stringify({
url: url.searchParams.get("url") || "",
return Response.redirect(`raycast://extensions/pomdtr/cmdk/open-page?arguments=${args}`);
clayton avatar
myApi
@clayton
An interactive, runnable TypeScript val by clayton
Script
export function myApi(name) {
return "hi " + name;
iamseeley avatar
typingCli
@iamseeley
🚧 when you want a command line typing effect see styles: typingcliStyles [ ] improve styles (invert text color w/ background when at current character)
Script
## 🚧 when you want a command line typing effect
see styles: [typingcliStyles](https://www.val.town/v/iamseeley/typingcliStyles)
- [ ] improve styles (invert text color w/ background when at current character)
export function typingCli(element, text, callback = () => {}) {
let i = 0;
function type() {
if (i < text.length) {
const span = document.createElement('span');
span.textContent = text.charAt(i);
element.appendChild(span);
KngTwi avatar
discordWelcomeBotMsgForwarder
@KngTwi
Part of the Create a Discord Welcome Bot guide on docs.val.town
Cron
Part of the [Create a Discord Welcome Bot guide](https://docs.val.town/create-a-discord-welcome-bot) on [docs.val.town](https
export const discordWelcomeBotMsgForwarder = async ({ lastRunAt }: Interval) => {
if (discordDMs === undefined) {
throw `expected @me.discordDMs to be a string[] of channel ids`;
const repliesToBot = [];
for (const channelId of discordDMs) {
const messages = await discordFetch(
process.env.discordBot,
// Note: not using pagination here
// (we assume < 50 replies to the bot per each DM)
malloc avatar
verify_discord_signature
@malloc
An interactive, runnable TypeScript val by malloc
Script
export let verify_discord_signature = (
public_key: String,
body: any,
signature: String,
timestamp: any,
return new Promise((resolve, reject) => {
import("https://cdn.skypack.dev/tweetnacl@v1.0.3?dts").then((nacl) => {
const result = nacl.sign.detached.verify(
Buffer.from(timestamp + body),
Buffer.from(signature, "hex"),
iamseeley avatar
interestsSection
@iamseeley
An interactive, runnable TypeScript val by iamseeley
Script
export const interestsSection = (resume) => resume.interests && resume.interests.length ? `
<section>
<h2>Interests</h2>
<ul>
${resume.interests.map(interest => `
<li>
<h3>${interest.name || ''}</h3>
<p>${interest.keywords && interest.keywords.join(', ') || ''}</p>
</li>
`).join('')}
snm avatar
gpt3
@snm
* OpenAI text completion. https://platform.openai.com/docs/api-reference/completions * * val.town has generously provided a free daily quota. Until the quota is met, no need to provide an API key. * To see if the quota has been met, you can run @patrickjm.openAiFreeQuotaExceeded() * * For full REST API access, see @patrickjm.openAiTextCompletion
Script
* OpenAI text completion. https://platform.openai.com/docs/api-reference/completions
* val.town has generously provided a free daily quota. Until the quota is met, no need to provide an API key.
* To see if the quota has been met, you can run @patrickjm.openAiFreeQuotaExceeded()
* For full REST API access, see @patrickjm.openAiTextCompletion
export let gpt3 = async (params: {
openAiKey?: string,
prompt: string,
maxTokens?: number,
const MODEL = "text-davinci-003";
// Determine whether to use provided apiKey or free usage apiKey based on daily quota.
yawnxyz avatar
libsqlstudio
@yawnxyz
LibSQLStudio To authenticate, use the same email as your val town account.
HTTP (deprecated)
# LibSQLStudio
![3fe0fa827f4c3b6e4efcce501182ffcaab898a6f8fb9e12ef44ee25e8e438ded.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/815d
To authenticate, use the same email as your val town account.
import { createApp } from "jsr:@pomdtr/libsqlstudio@0.0.2";
const app = createApp();
export default lastlogin(app.fetch, {
verifyEmail: verifyUserEmail
joey avatar
joeysPublicArray
@joey
An interactive, runnable TypeScript val by joey
Script
export const joeysPublicArray = [];
stevekrouse avatar
limitedVal
@stevekrouse
// Forked from @rlimit.limitedVal
Script
export let limitedVal = (async () => {
// Throws: Error: An untrusted val attempted to access secrets and was blocked.
// const limit = await @rlimit.limit({
// max: 100,
// interval: "10s",
// cost: 5,
const limit = await runVal("rlimit.limit", {
max: 100,
interval: "10s",
cost: 5,
jacoblee93 avatar
braveAgent
@jacoblee93
// Shows how to use the Brave Search tool in a LangChain agent
Script
// Shows how to use the Brave Search tool in a LangChain agent
export const braveAgent = (async () => {
const { ChatOpenAI } = await import(
"https://esm.sh/langchain/chat_models/openai"
const { BraveSearch } = await import("https://esm.sh/langchain/tools");
const { Calculator } = await import(
"https://esm.sh/langchain/tools/calculator"
const { initializeAgentExecutorWithOptions } = await import(
"https://esm.sh/langchain/agents"
const model = new ChatOpenAI({
zhanziyang avatar
dailyDadJoke
@zhanziyang
Daily Dad Joke How do you make a programmer laugh every morning? A dad joke cron job! Setup Fork this val Click Create fork 🤣🤣🤣🤣 API This val uses the icanhazdadjoke API . You can find more docs here , such as how to filter by type .
Cron
# Daily Dad Joke
How do you make a programmer laugh every morning?
A dad joke cron job!
## Setup
1. [Fork this val](https://www.val.town/v/stevekrouse/dailyDadJoke/fork)
2. Click **Create fork**
export async function dailyDadJoke() {
let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
return email({
text: punchline,
defel avatar
token
@defel
An interactive, runnable TypeScript val by defel
Script
export let token = (req, res) => {
res.text("any-token-foo");
vladimyr avatar
aspBadge
@vladimyr
ASP badge generator This is small SVG badge generator made for Ariadne.id Signature Profiles . Route format is: https://vladimyr-aspbadge.web.val.run/<aspe_uri> with optional format and debug query params. Use ?format=json to get back JSON response. JSON format can be used as an input for Shields.io's dynamic endpoint badge . Badge with legacy ASPE URI: [![](https://vladimyr-aspbadge.web.val.run/aspe:keyoxide.org:TOICV3SYXNJP7E4P5AOK5DHW44)](https://keyoxide.org/aspe:keyoxide.org:TOICV3SYXNJP7E4P5AOK5DHW44) 🔬️ inspect ASP JWT token Badge with new ASPE URI (not functional yet ⚠️): [![](https://vladimyr-aspbadge.web.val.run/aspe:fe7b75c54b95ac019dd48fbefe8d654af383cbfe)](https://keyoxide.org/aspe:fe7b75c54b95ac019dd48fbefe8d654af383cbfe)
HTTP (deprecated)
# ASP badge generator
This is small SVG badge generator made for [Ariadne.id Signature Profiles](https://ariadne.id/related/ariadne-signature-profi
https://vladimyr-aspbadge.web.val.run/<aspe_uri>
with optional `format` and `debug` query params. Use `?format=json` to get back JSON response.
JSON format can be used as an input for Shields.io's [dynamic endpoint badge](https://shields.io/badges/endpoint-badge).
Badge with legacy ASPE URI:
// SPDX-License-Identifier: 0BSD
AspeURI,
calculateFingerprint,
fetchASP,