Search
![pomdtr avatar](https://images.clerk.dev/oauth_github/img_2RCoAITJZH1QencEgtVjh4Qirj4.jpeg)
kv
@pomdtr
Usage import { openKv } from "https://esm.town/v/pomdtr/kv"
const kv = openKv()
await kv.set("test", true)
console.log(await kv.get("test"))
Script
import { sqliteStore } from "https://esm.town/v/vladimyr/keyvhqSqlite";
import Keyv from "npm:@keyvhq/core";
export function openKv<T = any>() {
const { slug } = callerRef();
return new Keyv<T>({ store: sqliteStore, namespace: slug });
connect
@dinavinter
An interactive, runnable TypeScript val by dinavinter
Script
} from "https://esm.sh/@hocuspocus/provider@2.15.0?&external=ws&target=esnext&yjs=13.6.20";
import * as Y from "https://esm.sh/yjs@^13.6.20?target=esnext";
export function connectYjs(doc: Y.Doc | string): Y.Doc {
const provider = new HocuspocusProvider({
preserveConnection: true,
![britzdm avatar](https://images.clerk.dev/oauth_github/img_2SmQkW9Tdx9OXIunmUlelQFBwoD.jpeg)
myApi
@britzdm
An interactive, runnable TypeScript val by britzdm
Script
export function myApi(name) {
return "hi " + name;
lavenderPinniped
@jamisonl
Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality
HTTP
Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality
req.headers.get("X-Signature-Ed25519"),
req.headers.get("X-Signature-Timestamp"),
// Get the user calling this slash command
const userId = await body.member?.user?.id;
if (bank[userId] === undefined) bank[userId] = starting_amount;
weatherGPT
@abar04
Cron
import { email } from "https://esm.town/v/std/email?v=11";
import { OpenAI } from "npm:openai";
let location = "Perth WA";
).then(r => r.json());
const openai = new OpenAI();
let chatCompletion = await openai.chat.completions.create({
messages: [{
console.log(text);
export async function weatherGPT() {
await email({ subject: "Weather Today", text });
![stevekrouse avatar](https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg)
expressHTMLExample
@stevekrouse
// View at https://stevekrouse-expressHTMLExample.express.val.run?name=Steve
Express (deprecated)
// View at https://stevekrouse-expressHTMLExample.express.val.run?name=Steve
export async function expressHTMLExample(
req: express.Request,
res: express.Response,
![jonicas avatar](https://secure.gravatar.com/avatar/ad0243487e834c9f8748d9889d5428d7.jpg?s=200&d=identicon)
myApi
@jonicas
An interactive, runnable TypeScript val by jonicas
Script
export function myApi(name) {
return "hi " + name;
testFetch
@ImGqb
An interactive, runnable TypeScript val by ImGqb
Script
export function testFetch(params: any) {
return params;
val_wOeFDx5oZj
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_wOeFDx5oZj(req) {
try {
// Execute the code directly and capture its result
rateArticleRelevance
@iakovos
An interactive, runnable TypeScript val by iakovos
Script
export const rateArticleRelevance = async (interests: string, article: any) => {
const { default: OpenAI } = await import("npm:openai");
const openai = new OpenAI({ apiKey: process.env.OPENAI_KEY });
try {
Give a score from 0 to 10. Why did you give this score? Respond with the score only.
const response = await openai.chat.completions.create({
messages: [
![mpsuesser avatar](https://images.clerk.dev/oauth_github/img_2TWxBLePYXau3wZspjInpCqP4hU.jpeg)
myApi
@mpsuesser
An interactive, runnable TypeScript val by mpsuesser
Script
export function myApi(name) {
return "hi " + name;
![puf avatar](https://secure.gravatar.com/avatar/4df6cf8a2fa4219b0990c579e3f5cffd.jpg?s=200&d=identicon)
getFirebaseTweets
@puf
An interactive, runnable TypeScript val by puf
Script
import { fetch } from "https://esm.town/v/std/fetch";
export async function getFirebaseTweets() {
const result = await fetch("https://twitter.com/firebase");
console.log(result);
![vtdocs avatar](https://images.clerk.dev/uploaded/img_2RCZq1QXONdaqPE472xAyQkVaqx.png)
browserlessScrapeExample
@vtdocs
An interactive, runnable TypeScript val by vtdocs
Script
method: "POST",
body: JSON.stringify({
"url": "https://en.wikipedia.org/wiki/OpenAI",
"elements": [{
// The second <p> element on the page