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/?q=function&page=858&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 10292 results for "function"(746ms)

properGreenGalliformmain.tsx10 matches

@stevekrouse•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
44
45 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
46 Turn your ideas into fully functional apps in{" "}
47 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
48 less than a second
115}
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
168 });
169
170 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
171 setLoading(true);
172 setTimeout(() => handleSubmit(promptItem.prompt), 0);
173 }
174
175 async function handleSubmit(e: React.FormEvent | string) {
176 if (typeof e !== "string") {
177 e.preventDefault();
224 }
225
226 function handleVersionChange(direction: "back" | "forward") {
227 const { currentVersionIndex, versions } = versionHistory;
228 if (direction === "back" && currentVersionIndex > 0) {
972);
973
974function client() {
975 const path = window.location.pathname;
976 const root = createRoot(document.getElementById("root")!);
1008}
1009
1010function extractCodeFromFence(text: string): string {
1011 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1012 return htmlMatch ? htmlMatch[1].trim() : text;
1013}
1014
1015async function generateCode(prompt: string, currentCode: string) {
1016 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1017 if (starterPrompt) {
1057}
1058
1059export default async function server(req: Request): Promise<Response> {
1060 // Dynamic import for SQLite to avoid client-side import
1061 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

cerebras_codermain.tsx10 matches

@thetulga•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
45
46 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47 Turn your ideas into fully functional apps in{" "}
48 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49 less than a second
116}
117
118function App() {
119 const previewRef = React.useRef<HTMLDivElement>(null);
120 const [prompt, setPrompt] = useState("");
170 });
171
172 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173 setLoading(true);
174 setTimeout(() => handleSubmit(promptItem.prompt), 0);
175 }
176
177 async function handleSubmit(e: React.FormEvent | string) {
178 if (typeof e !== "string") {
179 e.preventDefault();
226 }
227
228 function handleVersionChange(direction: "back" | "forward") {
229 const { currentVersionIndex, versions } = versionHistory;
230 if (direction === "back" && currentVersionIndex > 0) {
974);
975
976function client() {
977 const path = window.location.pathname;
978 const root = createRoot(document.getElementById("root")!);
1010}
1011
1012function extractCodeFromFence(text: string): string {
1013 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1014 return htmlMatch ? htmlMatch[1].trim() : text;
1015}
1016
1017async function generateCode(prompt: string, currentCode: string) {
1018 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1019 if (starterPrompt) {
1059}
1060
1061export default async function server(req: Request): Promise<Response> {
1062 // Dynamic import for SQLite to avoid client-side import
1063 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

twitterAlertmain.tsx2 matches

@eseidel•Updated 4 months ago
19});
20
21async function relevant(t: Tweet): Promise<z.infer<typeof RelevanceSchema>> {
22 const systemPrompt = `Determine if this tweet JSON is relevant to Shorebird on the following criteria:
23
51const isProd = true;
52
53export async function twitterAlert({ lastRunAt }: Interval) {
54 // search
55 const since = isProd

neatEmeraldVicunamain.tsx2 matches

@stevekrouse•Updated 4 months ago
19});
20
21async function relevant(t: Tweet): Promise<z.infer<typeof RelevanceSchema>> {
22 const systemPrompt = `Determine if this tweet JSON is relevant to Shorebird on the following criteria:
23
51const isProd = true;
52
53export async function twitterAlert({ lastRunAt }: Interval) {
54 // search
55 const since = isProd

solicitousOliveDuckmain.tsx10 matches

@stevekrouse•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
52
53 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
54 Turn your ideas into fully functional apps in{" "}
55 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
56 less than a second
124}
125
126function App() {
127 const previewRef = React.useRef<HTMLDivElement>(null);
128 const [prompt, setPrompt] = useState("");
178 });
179
180 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
181 setLoading(true);
182 setTimeout(() => handleSubmit(promptItem.prompt), 0);
183 }
184
185 async function handleSubmit(e: React.FormEvent | string) {
186 if (typeof e !== "string") {
187 e.preventDefault();
234 }
235
236 function handleVersionChange(direction: "back" | "forward") {
237 const { currentVersionIndex, versions } = versionHistory;
238 if (direction === "back" && currentVersionIndex > 0) {
982);
983
984async function client() {
985 const path = window.location.pathname;
986 const root = createRoot(document.getElementById("root")!);
1020}
1021
1022function extractCodeFromFence(text: string): string {
1023 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1024 return htmlMatch ? htmlMatch[1].trim() : text;
1025}
1026
1027async function generateCode(prompt: string, currentCode: string) {
1028 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1029 if (starterPrompt) {
1069}
1070
1071export default async function server(req: Request): Promise<Response> {
1072 // Dynamic import for SQLite to avoid client-side import
1073 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

qualityGrayPikemain.tsx10 matches

@stevekrouse•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
44
45 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
46 Turn your ideas into fully functional apps in{" "}
47 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
48 less than a second
115}
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
168 });
169
170 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
171 setLoading(true);
172 setTimeout(() => handleSubmit(promptItem.prompt), 0);
173 }
174
175 async function handleSubmit(e: React.FormEvent | string) {
176 if (typeof e !== "string") {
177 e.preventDefault();
224 }
225
226 function handleVersionChange(direction: "back" | "forward") {
227 const { currentVersionIndex, versions } = versionHistory;
228 if (direction === "back" && currentVersionIndex > 0) {
972);
973
974function client() {
975 const path = window.location.pathname;
976 const root = createRoot(document.getElementById("root")!);
1008}
1009
1010function extractCodeFromFence(text: string): string {
1011 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1012 return htmlMatch ? htmlMatch[1].trim() : text;
1013}
1014
1015async function generateCode(prompt: string, currentCode: string) {
1016 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1017 if (starterPrompt) {
1057}
1058
1059export default async function server(req: Request): Promise<Response> {
1060 // Dynamic import for SQLite to avoid client-side import
1061 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

lovableVioletPeafowlmain.tsx10 matches

@stevekrouse•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
44
45 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
46 Turn your ideas into fully functional apps in{" "}
47 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
48 less than a second
115}
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
168 });
169
170 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
171 setLoading(true);
172 setTimeout(() => handleSubmit(promptItem.prompt), 0);
173 }
174
175 async function handleSubmit(e: React.FormEvent | string) {
176 if (typeof e !== "string") {
177 e.preventDefault();
224 }
225
226 function handleVersionChange(direction: "back" | "forward") {
227 const { currentVersionIndex, versions } = versionHistory;
228 if (direction === "back" && currentVersionIndex > 0) {
972);
973
974function client() {
975 const path = window.location.pathname;
976 const root = createRoot(document.getElementById("root")!);
1008}
1009
1010function extractCodeFromFence(text: string): string {
1011 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1012 return htmlMatch ? htmlMatch[1].trim() : text;
1013}
1014
1015async function generateCode(prompt: string, currentCode: string) {
1016 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1017 if (starterPrompt) {
1057}
1058
1059export default async function server(req: Request): Promise<Response> {
1060 // Dynamic import for SQLite to avoid client-side import
1061 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

cerebras_codermain.tsx10 matches

@mtarapata•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
44
45 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
46 Turn your ideas into fully functional apps in{" "}
47 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
48 less than a second
115}
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
168 });
169
170 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
171 setLoading(true);
172 setTimeout(() => handleSubmit(promptItem.prompt), 0);
173 }
174
175 async function handleSubmit(e: React.FormEvent | string) {
176 if (typeof e !== "string") {
177 e.preventDefault();
224 }
225
226 function handleVersionChange(direction: "back" | "forward") {
227 const { currentVersionIndex, versions } = versionHistory;
228 if (direction === "back" && currentVersionIndex > 0) {
972);
973
974function client() {
975 const path = window.location.pathname;
976 const root = createRoot(document.getElementById("root")!);
1008}
1009
1010function extractCodeFromFence(text: string): string {
1011 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1012 return htmlMatch ? htmlMatch[1].trim() : text;
1013}
1014
1015async function generateCode(prompt: string, currentCode: string) {
1016 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1017 if (starterPrompt) {
1057}
1058
1059export default async function server(req: Request): Promise<Response> {
1060 // Dynamic import for SQLite to avoid client-side import
1061 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

neatBlackSwiftmain.tsx10 matches

@stevekrouse•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
45
46 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47 Turn your ideas into fully functional apps in{" "}
48 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49 less than a second
116}
117
118function App() {
119 const previewRef = React.useRef<HTMLDivElement>(null);
120 const [prompt, setPrompt] = useState("");
171 });
172
173 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
174 setLoading(true);
175 setTimeout(() => handleSubmit(promptItem.prompt), 0);
176 }
177
178 async function handleSubmit(e: React.FormEvent | string) {
179 if (typeof e !== "string") {
180 e.preventDefault();
227 }
228
229 function handleVersionChange(direction: "back" | "forward") {
230 const { currentVersionIndex, versions } = versionHistory;
231 if (direction === "back" && currentVersionIndex > 0) {
975);
976
977function client() {
978 const path = window.location.pathname;
979 const root = createRoot(document.getElementById("root")!);
1011}
1012
1013function extractCodeFromFence(text: string): string {
1014 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1015 return htmlMatch ? htmlMatch[1].trim() : text;
1016}
1017
1018async function generateCode(prompt: string, currentCode: string) {
1019 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1020 if (starterPrompt) {
1081}
1082
1083export default async function server(req: Request): Promise<Response> {
1084 // Dynamic import for SQLite to avoid client-side import
1085 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

summarizeHnmain.tsx9 matches

@prashamtrivedi•Updated 4 months ago
4import { GoogleGenerativeAI } from "https://esm.sh/@google/generative-ai";
5
6function ProgressBar({ progress }) {
7 return (
8 <div className="w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700 mb-4">
16}
17
18function PostDetails({ post }) {
19 if (!post) return null;
20 const hnDiscussionUrl = `https://news.ycombinator.com/item?id=${post.id}`;
76}
77
78function App() {
79 const [postId, setPostId] = useState("");
80 const [postDetails, setPostDetails] = useState(null);
216}
217
218function client() {
219 console.log("Client function called");
220 const root = document.getElementById("root");
221 if (root) {
244}
245
246export default async function server(request: Request): Promise<Response> {
247 console.log("Server function called", request.method, request.url);
248
249 // Handle root GET request
279 <script>
280 console.log("Inline script executed");
281 window.addEventListener('load', function() {
282 console.log("Window load event fired");
283 setTimeout(function() {
284 var loadingMessage = document.getElementById('loading-message');
285 if (loadingMessage) {

getFileEmail4 file matches

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

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago