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=1171&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 18011 results for "function"(3420ms)

twitterAlertmain.tsx3 matches

@charmaine•Updated 3 months ago
7const query = keywords.map(k => `"${k}"`).join(" OR ") + " " + excludes;
8
9// Helper function to filter relevant tweets
10function relevant(tweet: Tweet) {
11 return (
12 keywords.some(k => tweet.full_text?.includes(k))
18const isProd = true;
19
20export async function twitterAlert({ lastRunAt }: Interval) {
21 // Scrapes data from past 48 hours if testing
22 const since = isProd

textToSixImageGeneratormain.tsx3 matches

@Nandu•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [prompt, setPrompt] = useState("");
7 const [images, setImages] = useState<string[]>([]);
205};
206
207function client() {
208 createRoot(document.getElementById("root")).render(<App />);
209}
210if (typeof document !== "undefined") { client(); }
211
212export default async function server(request: Request): Promise<Response> {
213 return new Response(`
214 <html>

duckdbExamplemain.tsx2 matches

@taras•Updated 3 months ago
2
3export let duckdbExample = await (async () => {
4 async function createWorker(url) {
5 // For Val Town / Deno environments
6 if (typeof Deno !== "undefined") {
38
39console.log(duckdbExample);
40export default async function(req: Request): Promise<Response> {
41 return new Response(JSON.stringify(duckdbExample))
42}

twitterAlertREADME.md1 match

@charmaine•Updated 3 months ago
54This val uses the SocialData API for Twitter data:
55- **Proxies via Val Town's SocialDataProxy**: Limited to 100 calls/day for [**Val Town Pro users**](https://www.val.town/pricing).
56- **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.

highApricotImpalamain.tsx7 matches

@jdan•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function ImportDeck() {
6 const [deckText, setDeckText] = useState("");
7 const [message, setMessage] = useState("");
48}
49
50function ViewDeck() {
51 const [cards, setCards] = useState([]);
52 const [error, setError] = useState("");
59 }, []);
60
61 async function fetchCards() {
62 try {
63 const response = await fetch("/view");
257
258// Rest of the code remains unchanged from the previous implementation
259function RandomCard() {
260 const [randomCard, setRandomCard] = useState<
261 {
321}
322
323function App() {
324 const [view, setView] = useState<"import" | "view" | "random">("import");
325
383}
384
385function client() {
386 createRoot(document.getElementById("root")).render(<App />);
387}
388if (typeof document !== "undefined") { client(); }
389
390export default async function server(request: Request): Promise<Response> {
391 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
392 const { OpenAI } = await import("https://esm.town/v/std/openai");

courteousAzureSquirrelmain.tsx1 match

@charmaine•Updated 3 months ago
11});
12
13function getStripeCustomer(customerId: string) {
14 return stripe.customers.retrieve(customerId);
15}

oauthmain.tsx1 match

@pomdtr•Updated 3 months ago
1type Handler = (req: Request) => Response | Promise<Response>;
2
3export function oauth(params: any, next: (req: Request, accessToken: string) => Response | Promise<Response>): Handler {
4 return (req: Request) => {
5 // TODO: go through oauth flow to extract access token

areMyWebsitesDownmain.tsx1 match

@kylesezhi•Updated 3 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;

diplomaticApricotHeronmain.tsx4 matches

@gigmx•Updated 3 months ago
14}
15
16function App() {
17 const [launches, setLaunches] = useState<TokenLaunch[]>([]);
18
67}
68
69function LaunchCard({ launch }: { launch: TokenLaunch }) {
70 return (
71 <div className="launch-card">
82}
83
84function client() {
85 createRoot(document.getElementById("root")).render(<App />);
86}
90}
91
92export default async function server(request: Request): Promise<Response> {
93 const { blob } = await import("https://esm.town/v/std/blob");
94 const KEY = "diplomaticApricotHeron";

stripeTriggermain.tsx2 matches

@wolf•Updated 3 months ago
9}>;
10
11export function bindAction(actionUrl: string) {
12 bindActionToTrigger(actionUrl, import.meta.url)
13}
20);
21
22export default async function trigger(req: Request): Promise<Response> {
23 const url = new URL(req.url);
24

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks 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": "*",