Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg?q=function&page=2508&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 35209 results for "function"(8908ms)

openTownieMadeThis4index.html2 matches

@charmaine•Updated 4 months ago
251
252 <script>
253 // Countdown Timer functionality
254 function updateCountdown() {
255 // Set the target date (30 days from now for demo purposes)
256 const targetDate = new Date();

Sparkmain.tsx4 matches

@Tade•Updated 4 months ago
8const openai = new OpenAI();
9
10// Helper function to send Telegram message
11async function sendTelegramMessage(chatId: number, text: string) {
12 const response = await fetch(`${TELEGRAM_API_URL}/sendMessage`, {
13 method: 'POST',
25
26// Research consultation logic
27async function processResearchRequest(text: string) {
28 try {
29 const completion = await openai.chat.completions.create({
49}
50
51export default async function (request: Request): Promise<Response> {
52 try {
53 // Log the raw request body for debugging

receptiveApricotElkmain.tsx8 matches

@Mimiie•Updated 4 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function JobPostingForm() {
6 const [title, setTitle] = useState('');
7 const [company, setCompany] = useState('');
55}
56
57function JobListings() {
58 const [jobs, setJobs] = useState([]);
59
60 useEffect(() => {
61 async function fetchJobs() {
62 try {
63 const response = await fetch('/get-jobs');
87}
88
89function ChatRoom() {
90 const [messages, setMessages] = useState([]);
91 const [newMessage, setNewMessage] = useState('');
92
93 useEffect(() => {
94 async function fetchMessages() {
95 try {
96 const response = await fetch('/get-messages');
146}
147
148function App() {
149 return (
150 <div className="job-board-app">
168}
169
170function client() {
171 createRoot(document.getElementById("root")).render(<App />);
172}
173if (typeof document !== "undefined") { client(); }
174
175export default async function server(request: Request): Promise<Response> {
176 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
177 const KEY = "receptiveApricotElk";

openTownieMadeThis4App.tsx1 match

@charmaine•Updated 4 months ago
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function App() {
5 const [clicked, setClicked] = useState(0);
6 return (

emirhanugurabimain.tsx3 matches

@emirhannn•Updated 4 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 return new Response(
107 `

Data_websitemain.tsx4 matches

@Wise12•Updated 4 months ago
30];
31
32function ProjectCard({ project }) {
33 return (
34 <div className="project-card">
51}
52
53function App() {
54 return (
55 <div className="portfolio-container">
108}
109
110function client() {
111 createRoot(document.getElementById("root")).render(<App />);
112}
113if (typeof document !== "undefined") { client(); }
114
115export default async function server(request: Request): Promise<Response> {
116 return new Response(`
117 <html>

ZAAZAmain.tsx1 match

@Habibti•Updated 4 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

linkInBioTemplatemain.tsx1 match

@Habibti•Updated 4 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

jobBoardAppmain.tsx3 matches

@Elohor•Updated 4 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [jobs, setJobs] = useState([]);
7 const [messages, setMessages] = useState([]);
153}
154
155function client() {
156 createRoot(document.getElementById("root")).render(<App />);
157}
158if (typeof document !== "undefined") { client(); }
159
160export default async function server(request: Request): Promise<Response> {
161 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
162 const KEY = "jobBoardApp";

humorousAmethystLobstermain.tsx1 match

@kathryn822•Updated 4 months ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

discordWebhook2 file matches

@stevekrouse•Updated 3 weeks ago
Helper function to send Discord messages
tuna

tuna9 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.