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%20%22Image%20title%22?q=function&page=2108&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 29280 results for "function"(2175ms)

LanguageTranslatormain.tsx4 matches

@juleeyet•Updated 3 months ago
4
5// Spinner Component
6function Spinner({ theme }) {
7 const spinnerStyle = {
8 display: "flex",
40}
41
42function App() {
43 const [theme, setTheme] = useState(() => {
44 const savedTheme = localStorage.getItem("app-theme");
373}
374
375function client() {
376 createRoot(document.getElementById("root")).render(<App />);
377}
381}
382
383export default function server(request: Request): Response {
384 return new Response(`
385 <html>

getWeatherREADME.md1 match

@geoffreylitt•Updated 3 months ago
1## Get Weather
2
3Simple function to get weather data from the free [wttr.in](https://wttr.in/:help) service.
4
5```ts

sqliteBrowserREADME.md1 match

@geoffreylitt•Updated 3 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

sqliteExplorerAppREADME.md1 match

@geoffreylitt•Updated 3 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

blitheTealAnteatermain.tsx1 match

@Nabby•Updated 3 months ago
1export default async function (interval: Interval) {
2
3}

jobAndChatAppmain.tsx2 matches

@hyperayoub•Updated 3 months ago
1export default async function server(request: Request): Promise<Response> {
2 const { email } = await import("https://esm.town/v/std/email");
3
60 }
61
62 // Rest of the existing server function remains the same
63}

fashionWebsitemain.tsx4 matches

@Stella55•Updated 3 months ago
34};
35
36function ProductCard({ product }) {
37 return (
38 <div className="product-card">
45}
46
47function App() {
48 const [gender, setGender] = useState('male');
49
90}
91
92function client() {
93 createRoot(document.getElementById("root")).render(<App />);
94}
95if (typeof document !== "undefined") { client(); }
96
97export default async function server(request: Request): Promise<Response> {
98 return new Response(`
99 <html>

twitterAlertREADME.md2 matches

@tengis•Updated 3 months ago
46- Key: `mentionsDiscord`
47- Value: Your Discord webhook URL.
48Notifications will be sent using this function:
49
50```ts
63
64- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **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.

twitterAlertmain.tsx1 match

@tengis•Updated 3 months ago
12const isProd = false;
13
14export async function twitterAlert({ lastRunAt }: Interval) {
15 // If isProd, search for tweets since that last time this interval ran
16 // if not, search for tweets since 48 hours ago for testing

HabitTrackermain.tsx7 matches

@Gabriel_Aejis•Updated 3 months ago
4
5// Utility for generating secure random tokens
6function generateToken() {
7 return crypto.randomUUID();
8}
9
10function App() {
11 const [user, setUser] = useState(null);
12 const [habits, setHabits] = useState([]);
282}
283
284function client() {
285 createRoot(document.getElementById("root")).render(<App />);
286}
287if (typeof document !== "undefined") { client(); }
288
289export default async function server(request: Request) {
290 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
291 const KEY = "HabitTracker";
318 `);
319
320 // Utility functions for authentication
321 async function hashPassword(password) {
322 const encoder = new TextEncoder();
323 const data = encoder.encode(password);
327 }
328
329 async function verifyPassword(inputPassword, storedHash) {
330 const inputHash = await hashPassword(inputPassword);
331 return inputHash === storedHash;
tuna

tuna9 file matches

@jxnblk•Updated 1 day ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 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.