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=1087&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 17288 results for "function"(1959ms)

comfortableOrangeSparrowmain.tsx2 matches

@charmaine•Updated 3 months ago
34}
35
36async function detectTechnologies(email_address: string): Promise<ShovelResponse> {
37 const domain = email_address.split("@")[1];
38
57}
58
59export async function newUserWelcomeEmail(req: Request): Promise<Response> {
60 if (req.method === "GET") return html(welcomeEmail);
61 if (req.headers.get("clerkNonSensitive") !== Deno.env.get("clerkNonSensitive"))

properPurplePorpoiseREADME.md2 matches

@charmaine•Updated 3 months ago
50- Key: `mentionsDiscord`
51- Value: Your Discord webhook URL.
52Notifications will be sent using this function:
53```
54 await discordWebhook({
67This val uses the SocialData API for Twitter data:
68- **Proxies via Val Town's SocialDataProxy**: Limited to 100 calls/day for [**Val Town Pro users**](https://www.val.town/pricing).
69- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

properPurplePorpoisemain.tsx1 match

@charmaine•Updated 3 months ago
10const isProd = true;
11
12export async function twitterAlert({ lastRunAt }: Interval) {
13 // Scrapes data from past 48 hours time frame if testing
14 const timeFrame = isProd

aqimain.tsx1 match

@cai•Updated 3 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "salt lake city"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

depannageInformatiquemain.tsx12 matches

@vesty91•Updated 3 months ago
57
58// Service page components (unchanged)
59function DiagnosticGratuitPage() {
60 return (
61 <div className="service-page">
81}
82
83function NettoyageOptimisationPage() {
84 return (
85 <div className="service-page">
107}
108
109function ReparationMateriellePage() {
110 return (
111 <div className="service-page">
132}
133
134function SauvegardeRecuperationPage() {
135 return (
136 <div className="service-page">
156}
157
158function InstallationLogiciellePage() {
159 return (
160 <div className="service-page">
186}
187
188function SupportDistancePage() {
189 return (
190 <div className="service-page">
210}
211
212function TarifSystemesExploitationPage() {
213 return (
214 <div className="service-page">
301}
302
303function HomePage() {
304 const [showWelcome, setShowWelcome] = useState(true);
305 const [services, setServices] = useState([
362}
363
364function App() {
365 const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
366 const [activeDropdown, setActiveDropdown] = useState<string | null>(null);
452}
453
454function client() {
455 createRoot(document.getElementById("root")).render(<App />);
456}
457if (typeof document !== "undefined") { client(); }
458
459export default async function server(request: Request): Promise<Response> {
460 return new Response(`
461 <html>
479}
480
481function getCss() {
482 return `
483 * {

satisfiedPinkAnteatermain.tsx1 match

@stevekrouse•Updated 3 months ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

splendidAzureKiwimain.tsx4 matches

@Ravikumarraj•Updated 3 months ago
11}
12
13function CycleDiagram({ cycleLength, lastPeriodDate }) {
14 const phases = useMemo(() => {
15 const periodLength = 5; // Typical period length
57}
58
59function PeriodCalculator() {
60 const [lastPeriodDate, setLastPeriodDate] = useState('');
61 const [cycleLength, setCycleLength] = useState(28);
311}
312
313function client() {
314 createRoot(document.getElementById("root")).render(<PeriodCalculator />);
315}
316if (typeof document !== "undefined") { client(); }
317
318export default async function server(request: Request): Promise<Response> {
319 return new Response(`
320 <html>

cerebras_codermain.tsx11 matches

@hamdanhussein•Updated 3 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) {
1060}
1061
1062export default async function cerebras_coder(req: Request): Promise<Response> {
1063 // Dynamic import for SQLite to avoid client-side import
1064 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1163 <meta property="og:site_name" content="Cerebras Coder">
1164 <meta property="og:url" content="https://cerebrascoder.com"/>
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">

softOrangeLeopardmain.tsx12 matches

@vesty91•Updated 3 months ago
57
58// Service page components (unchanged)
59function DiagnosticGratuitPage() {
60 return (
61 <div className="service-page">
81}
82
83function NettoyageOptimisationPage() {
84 return (
85 <div className="service-page">
107}
108
109function ReparationMateriellePage() {
110 return (
111 <div className="service-page">
132}
133
134function SauvegardeRecuperationPage() {
135 return (
136 <div className="service-page">
156}
157
158function InstallationLogiciellePage() {
159 return (
160 <div className="service-page">
186}
187
188function SupportDistancePage() {
189 return (
190 <div className="service-page">
210}
211
212function TarifSystemesExploitationPage() {
213 return (
214 <div className="service-page">
301}
302
303function HomePage() {
304 const [showWelcome, setShowWelcome] = useState(true);
305 const [services, setServices] = useState([
362}
363
364function App() {
365 const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
366 const [activeDropdown, setActiveDropdown] = useState<string | null>(null);
452}
453
454function client() {
455 createRoot(document.getElementById("root")).render(<App />);
456}
457if (typeof document !== "undefined") { client(); }
458
459export default async function server(request: Request): Promise<Response> {
460 return new Response(`
461 <html>
479}
480
481function getCss() {
482 return `
483 * {

honorableAmberSharkmain.tsx12 matches

@vesty91•Updated 3 months ago
57
58// Service page components (unchanged)
59function DiagnosticGratuitPage() {
60 return (
61 <div className="service-page">
81}
82
83function NettoyageOptimisationPage() {
84 return (
85 <div className="service-page">
107}
108
109function ReparationMateriellePage() {
110 return (
111 <div className="service-page">
132}
133
134function SauvegardeRecuperationPage() {
135 return (
136 <div className="service-page">
156}
157
158function InstallationLogiciellePage() {
159 return (
160 <div className="service-page">
186}
187
188function SupportDistancePage() {
189 return (
190 <div className="service-page">
210}
211
212function TarifSystemesExploitationPage() {
213 return (
214 <div className="service-page">
301}
302
303function HomePage() {
304 const [showWelcome, setShowWelcome] = useState(true);
305 const [services, setServices] = useState([
362}
363
364function App() {
365 const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
366 const [activeDropdown, setActiveDropdown] = useState<string | null>(null);
452}
453
454function client() {
455 createRoot(document.getElementById("root")).render(<App />);
456}
457if (typeof document !== "undefined") { client(); }
458
459export default async function server(request: Request): Promise<Response> {
460 return new Response(`
461 <html>
479}
480
481function getCss() {
482 return `
483 * {

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",