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=2296&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 31449 results for "function"(7455ms)

cerebras_coderindex7 matches

@RealmcodeUpdated 3 months ago
23);
24
25function Hero({
26 prompt,
27 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("");
169 });
170
171 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
172 setLoading(true);
173 setTimeout(() => handleSubmit(promptItem.prompt), 0);
174 }
175
176 async function handleSubmit(e: React.FormEvent | string) {
177 if (typeof e !== "string") {
178 e.preventDefault();
225 }
226
227 function handleVersionChange(direction: "back" | "forward") {
228 const { currentVersionIndex, versions } = versionHistory;
229 if (direction === "back" && currentVersionIndex > 0) {
973);
974
975function client() {
976 const path = window.location.pathname;
977 const root = createRoot(document.getElementById("root")!);

cerebras_codergenerate-code2 matches

@RealmcodeUpdated 3 months ago
2import STARTER_PROMPTS from "../public/starter-prompts.js";
3
4function extractCodeFromFence(text: string): string {
5 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
6 return htmlMatch ? htmlMatch[1].trim() : text;
7}
8
9export async function generateCode(prompt: string, currentCode: string) {
10 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
11 if (starterPrompt) {

thankfulSilverWhalemain.tsx3 matches

@Adi56Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function BFHLApp() {
6 const [inputJson, setInputJson] = useState('');
7 const [response, setResponse] = useState<any>(null);
117}
118
119function client() {
120 createRoot(document.getElementById("root")).render(<BFHLApp />);
121}
122if (typeof document !== "undefined") { client(); }
123
124export default async function server(request: Request): Promise<Response> {
125 const url = new URL(request.url);
126

valentinemain.tsx3 matches

@mesh_flawlessUpdated 3 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 `

first_codemain.tsx3 matches

@Meon_valUpdated 3 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 `

adroitBlackAphidmain.tsx3 matches

@nightowlkunUpdated 3 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 `

usefulLimeLionREADME.md3 matches

@BobbyaiUpdated 3 months ago
36
37 <script>
38 document.getElementById("honour").addEventListener("change", function() {
39 document.getElementById("manualHonour").style.display = this.value === "Other" ? "block" : "none";
40 });
41
42 document.getElementById("signupForm").addEventListener("submit", function(event) {
43 event.preventDefault();
44 fetch('/register', {
53 });
54
55 document.getElementById("attendanceForm").addEventListener("submit", function(event) {
56 event.preventDefault();
57 fetch('/submit-attendance', {
1export async function GET(request) {
2 try {
3 // 获取外部URL的内容

RISKYmain.tsx6 matches

@Devika_arUpdated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [amount, setAmount] = useState('');
7 const [recipient, setRecipient] = useState('');
77}
78
79function client() {
80 createRoot(document.getElementById("root")).render(<App />);
81}
84let flaggedTransactions: { amount: number, recipient: string, date: string }[] = [];
85
86export default async function server(request: Request): Promise<Response> {
87 if (request.method === 'POST' && new URL(request.url).pathname === '/assess') {
88 const { email } = await import("https://esm.town/v/std/email");
135}
136
137function assessTransactionRisk(transaction: { amount: number, recipient: string }): boolean {
138 const RISK_THRESHOLD = 5000;
139 const HIGH_RISK_RECIPIENTS = ['unknown', 'suspicious', 'scam'];
152}
153
154function getUserGeolocation(): string {
155 return "Unknown Country"; // Mock function, replace with an API if needed
156}
157

TestSlimebattle-system.js2 matches

@sky_porie_fire443Updated 3 months ago
127
128// 辅助功能:计算伤害幅度文本
129function getDamageDescription(damage) {
130 if (damage <= 5) return "轻微的";
131 if (damage <= 10) return "适量的";
136
137// 辅助功能:根据生命百分比获取状态描述
138function getHealthDescription(entity) {
139 const healthPercent = (entity.currentHp / entity.maxHp) * 100;
140
tuna

tuna9 file matches

@jxnblkUpdated 1 week ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouserUpdated 1 month ago
A helper function to build a file's email
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.