Search

Results include substring matches and semantically similar vals. Learn more
dhvanil avatar
val_FPNfGi0LWq
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_FPNfGi0LWq(req) {
try {
// Execute the code directly and capture its result
dhvanil avatar
val_Wn1wUAIHFR
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_Wn1wUAIHFR(req) {
try {
// Execute the code directly and capture its result
shawnbasquiat avatar
CoverLetterGenerator
@shawnbasquiat
// This val creates a cover letter generator using OpenAI's GPT model
HTTP
// This val creates a cover letter generator using OpenAI's GPT model
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function server(req: Request): Promise<Response> {
async function extractTextFromPDF(file: File): Promise<string | null> {
async function generateCoverLetter(resume: string, jobDescription: string): Promise<string> {
console.log("Entering generateCoverLetter function");
const openai = new OpenAI();
console.log("OpenAI instance created");
const completion = await openai.chat.completions.create({
console.log("OpenAI API call completed");
dhvanil avatar
val_Gl2A5DJner
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_Gl2A5DJner(req) {
try {
// Execute the code directly and capture its result
adagradschool avatar
softTanSlug
@adagradschool
An interactive, runnable TypeScript val by adagradschool
HTTP
export default function handler(req) {
return new Response(`"\n <!DOCTYPE html>\n <html>\n <head>\n <title>Claude Chat Conversation</title
headers: {
fadi avatar
myApi
@fadi
An interactive, runnable TypeScript val by fadi
Script
export function myApi(name) {
return { "name": name };
hibodog667 avatar
myApi
@hibodog667
An interactive, runnable TypeScript val by hibodog667
Script
export function myApi(name) {
console.email("name sent" + name);
dhvanil avatar
web_5sTKT1xhCs
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_5sTKT1xhCs(req) {
return new Response(`<!DOCTYPE html>
<html>
nanek avatar
myApi
@nanek
An interactive, runnable TypeScript val by nanek
Script
export function myApi(name) {
return "hi " + name;
dhvanil avatar
val_DDlHRsQXxj
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_DDlHRsQXxj(req) {
try {
// Execute the code directly and capture its result
dhvanil avatar
val_5PE61NGtHN
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_5PE61NGtHN(req) {
try {
// Execute the code directly and capture its result
li_shuai avatar
myApi
@li_shuai
An interactive, runnable TypeScript val by li_shuai
Script
export function myApi(name) {
return "hi " + name;
peterqliu avatar
selfDestruct
@peterqliu
💥 Deletes the val using it, or whatever url is fed it. Handy for sharing single-use scripts without cluttering people's accounts. If used in an HTTP val, this will run immediately when anyone forks it, making for a zero-click execution as long as ValTown immediately serves a preview of the forked val. Add this to your code last and then do not run it, or you will lose your work. Recommend first checking that the val owner isn't you, so that only forked copies will self-destruct. Usage selfDestruct(import.meta.url) Returns a promise of successful deletion, though the val would not be around to read it.
Script
import ValTown from "https://esm.sh/@valtown/sdk@0.22.0";
import { fetchValInfo } from "https://esm.town/v/pomdtr/fetchValInfo?v=2";
export async function selfDestruct(importMetaUrl: string) {
const { id } = await fetchValInfo(importMetaUrl);
const { vals } = new ValTown();
stevekrouse avatar
cerebras_coder_prompts
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
title: "Todo App",
code:
let todos = JSON.parse(localStorage.getItem('todos')) || [];\n\n // Function to render the todo list\n functio
performance: {
tokensPerSecond: 2298.56,
title: "Markdown Editor",
code:
l(defaultMarkdown);\n preview.innerHTML = defaultHtml;\n\n // Function to convert Markdown to HTML\n fun
performance: {
tokensPerSecond: 4092.96,
juansebsol avatar
RudeAI
@juansebsol
@jsxImportSource https://esm.sh/react
HTTP
import { createRoot } from "https://esm.sh/react-dom/client";
function App() {
const [messages, setMessages] = useState([]);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
client();
function generateSessionId() {
return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
export default async function server(request: Request): Promise<Response> {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
const openai = new OpenAI();
const SCHEMA_VERSION = 2;
// Generate AI response
const completion = await openai.chat.completions.create({
messages: [