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/$%7Bart_info.art.src%7D?q=function&page=2055&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 28734 results for "function"(3365ms)

boldTanBugmain.tsx7 matches

@Maranatha•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function JobBoard() {
6 const [jobs, setJobs] = useState([]);
7 const [newJob, setNewJob] = useState({
19 }, []);
20
21 async function fetchJobs() {
22 try {
23 const response = await fetch('/jobs');
29 }
30
31 async function fetchMessages() {
32 try {
33 const response = await fetch('/messages');
39 }
40
41 async function submitJob(e) {
42 e.preventDefault();
43 try {
56 }
57
58 async function sendMessage(e) {
59 e.preventDefault();
60 try {
151}
152
153function client() {
154 createRoot(document.getElementById("root")).render(<JobBoard />);
155}
156if (typeof document !== "undefined") { client(); }
157
158export default async function server(request: Request): Promise<Response> {
159 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
160 const KEY = "boldTanBug";

lenientBeigeAnacondamain.tsx7 matches

@Maranatha•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function JobBoard() {
6 const [jobs, setJobs] = useState([]);
7 const [newJob, setNewJob] = useState({
19 }, []);
20
21 async function fetchJobs() {
22 try {
23 const response = await fetch('/jobs');
29 }
30
31 async function fetchMessages() {
32 try {
33 const response = await fetch('/messages');
39 }
40
41 async function submitJob(e) {
42 e.preventDefault();
43 try {
56 }
57
58 async function sendMessage(e) {
59 e.preventDefault();
60 try {
151}
152
153function client() {
154 createRoot(document.getElementById("root")).render(<JobBoard />);
155}
156if (typeof document !== "undefined") { client(); }
157
158export default async function server(request: Request): Promise<Response> {
159 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
160 const KEY = "lenientBeigeAnaconda";

githubContributionTrackermain.tsx3 matches

@storm_trupa•Updated 3 months ago
14}
15
16function App() {
17 const [username, setUsername] = useState("Joshuakibwage");
18 const [contributions, setContributions] = useState<string[]>([]);
143};
144
145function client() {
146 createRoot(document.getElementById("root")).render(<App />);
147}
148if (typeof document !== "undefined") { client(); }
149
150export default async function server(request: Request): Promise<Response> {
151 const url = new URL(request.url);
152

randomQuotesGeneratormain.tsx1 match

@ISMAIL•Updated 3 months ago
1export default function getRandomQuote() {
2 const quotes = [
3 "Success is not final, failure is not fatal: it is the courage to continue that counts.",

jobBoardAndChatAppmain.tsx7 matches

@Maranatha•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function JobBoard() {
6 const [jobs, setJobs] = useState([]);
7 const [newJob, setNewJob] = useState({
19 }, []);
20
21 async function fetchJobs() {
22 try {
23 const response = await fetch('/jobs');
29 }
30
31 async function fetchMessages() {
32 try {
33 const response = await fetch('/messages');
39 }
40
41 async function submitJob(e) {
42 e.preventDefault();
43 try {
56 }
57
58 async function sendMessage(e) {
59 e.preventDefault();
60 try {
151}
152
153function client() {
154 createRoot(document.getElementById("root")).render(<JobBoard />);
155}
156if (typeof document !== "undefined") { client(); }
157
158export default async function server(request: Request): Promise<Response> {
159 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
160 const KEY = "jobBoardAndChatApp";

greatBlushLeopardmain.tsx4 matches

@Blackhammer•Updated 3 months ago
39}
40
41function CVBuilderApp() {
42 const [personalInfo, setPersonalInfo] = useState<PersonalInfo>({
43 fullName: '',
88 };
89
90 // New function to add references
91 const addReference = () => {
92 setReferences([...references, {
578};
579
580function client() {
581 createRoot(document.getElementById("root")).render(<CVBuilderApp />);
582}
584if (typeof document !== "undefined") { client(); }
585
586export default async function server(request: Request): Promise<Response> {
587 return new Response(`
588 <html>

moodTrackermain.tsx7 matches

@Sindy04•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [view, setView] = useState('jobs');
7 const [jobTitle, setJobTitle] = useState('');
28 }, [chatMessages]);
29
30 async function fetchJobs() {
31 try {
32 const response = await fetch('/get-jobs');
38 }
39
40 async function fetchChatMessages() {
41 try {
42 const response = await fetch('/get-chat');
48 }
49
50 async function submitJob() {
51 if (!jobTitle || !jobDescription || !jobCompany) {
52 alert('Please fill in all job posting fields');
77 }
78
79 async function sendChatMessage() {
80 if (!chatMessage.trim()) return;
81
302};
303
304function client() {
305 createRoot(document.getElementById("root")).render(<App />);
306}
307if (typeof document !== "undefined") { client(); }
308
309export default async function server(request: Request): Promise<Response> {
310 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
311 const KEY = "moodTracker";

sociableWhiteLeoponmain.tsx3 matches

@mutindi•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function AmyFreshJuice() {
6 const [email, setEmail] = useState('');
7 const juices = [
229};
230
231function client() {
232 createRoot(document.getElementById("root")).render(<AmyFreshJuice />);
233}
234if (typeof document !== "undefined") { client(); }
235
236export default async function server(request: Request): Promise<Response> {
237 return new Response(`
238 <html>

biobankJobDashboardmain.tsx4 matches

@ZainabMakled•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function JobDashboard() {
6 const [jobs, setJobs] = useState([]);
7 const [loading, setLoading] = useState(true);
52}
53
54function client() {
55 createRoot(document.getElementById("root")).render(<JobDashboard />);
56}
57if (typeof document !== "undefined") { client(); }
58
59export default async function server(request: Request): Promise<Response> {
60 // Fetch jobs from multiple sources
61 const jobSources = [
65 ];
66
67 async function fetchJobs() {
68 try {
69 // In a real implementation, you'd use web scraping or an API

chatAppmain.tsx7 matches

@luka•Updated 3 months ago
6import { blob } from "https://esm.town/v/std/blob";
7
8// Utility function to generate secure reset token
9function generateResetToken() {
10 return crypto.randomUUID();
11}
12
13// Utility function to format timestamps
14function formatTimestamp(timestamp) {
15 const date = new Date(timestamp);
16 const now = new Date();
25}
26
27function App() {
28 const [isLoggedIn, setIsLoggedIn] = useState(false);
29 const [username, setUsername] = useState("");
45 const [isResetPasswordPage, setIsResetPasswordPage] = useState(false);
46
47 // Validation functions
48 const validateUsername = (username) => {
49 if (!username) return "Username is required";
166// Rest of the client and server code remains the same as in the previous implementation
167
168export default async function server(request: Request): Promise<Response> {
169 const { pathname, searchParams } = new URL(request.url);
170

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
tuna

tuna8 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.