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=2498&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 28709 results for "function"(5639ms)

RefiComparisonmain.tsx3 matches

@jbwintersUpdated 9 months ago
20}
21
22function App() {
23 const [offers, setOffers] = useState<Offer[]>([]);
24 const [newOffer, setNewOffer] = useState<Omit<Offer, 'id' | 'monthlyPayment' | 'totalInterest'>>({
354}
355
356function client() {
357 createRoot(document.getElementById("root")).render(<App />);
358}
362}
363
364async function server(request: Request): Promise<Response> {
365 const { blob } = await import("https://esm.town/v/std/blob");
366 const KEY = "RefiComparison";

extractTextmain.tsx1 match

@ttodosiUpdated 9 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function extractText(data, name) {
4 const fileUrl =
5 "https://www.gcmgrosvenor.com/wp-content/uploads/Private-Credit-Co-investing-GCM-Grosvenor.pdf";

smsjournalerregistrationmain.tsx3 matches

@cephalizationUpdated 9 months ago
5const relayURL = "https://cephalization-smsjournalertextrelay.web.val.run";
6
7function App() {
8 const [phoneNumber, setPhoneNumber] = useState("");
9 const [registrationKey, setRegistrationKey] = useState("");
60}
61
62function client() {
63 createRoot(document.getElementById("root")).render(<App />);
64}
65if (typeof document !== "undefined") { client(); }
66
67async function server(request: Request): Promise<Response> {
68 const sharedSecret = Deno.env.get("smsjournalersecret");
69

npmExplorermain.tsx3 matches

@allUpdated 9 months ago
98};
99
100function App() {
101 const [searchTerm, setSearchTerm] = useState("");
102 const [packages, setPackages] = useState([]);
261}
262
263function client() {
264 createRoot(document.getElementById("root")).render(<App />);
265}
267if (typeof document !== "undefined") { client(); }
268
269async function server(request: Request): Promise<Response> {
270 const url = new URL(request.url);
271

allFontmain.tsx3 matches

@allUpdated 9 months ago
36];
37
38function App() {
39 const [customText, setCustomText] = useState("abcde fghijk lmnop qrstu vwxyz");
40 const [font, setFont] = useState("all font");
107}
108
109function client() {
110 createRoot(document.getElementById("root")).render(<App />);
111}
113if (typeof document !== "undefined") { client(); }
114
115export default async function server(request: Request): Promise<Response> {
116 return new Response(
117 `

valboardmain.tsx6 matches

@avycado13Updated 9 months ago
2import { h } from "https://esm.sh/preact@10.23.2";
3
4// Function to fetch JSON data from URL
5async function fetchJSON(url: string) {
6 try {
7 console.log(`Attempting to fetch data from: ${url}`);
19}
20
21// Function to parse and format date
22function formatDate(dateString: string) {
23 try {
24 const [datePart, timePart] = dateString.split(" ");
60
61// Main App component
62function App({ data }: { data: Array<{ id: number; Subject: string; Time: string; Text: string }> }) {
63 if (!data || data.length === 0) {
64 return h("div", null, "No data available");
84
85// Server-side rendering
86export default async function server(request: Request): Promise<Response> {
87 const jsonUrl = "https://avycado13-valboardapi.web.val.run";
88 const data = await fetchJSON(jsonUrl);

lastloginmain.tsx4 matches

@tionisUpdated 9 months ago
1/** @jsxImportSource npm:hono/jsx */
2
3async function createSession(email: string, hostname: string) {
4 const { zip } = await import("https://esm.town/v/pomdtr/sql");
5 const { sqlite } = await import("https://esm.town/v/std/sqlite");
24}
25
26async function getSession(sessionID: string, hostname: string) {
27 const { zip } = await import("https://esm.town/v/pomdtr/sql");
28 const { sqlite } = await import("https://esm.town/v/std/sqlite");
53}
54
55async function deleteSession(sessionID: string) {
56 const { sqlite } = await import("https://esm.town/v/std/sqlite");
57
65const OAUTH_COOKIE = "oauth_store";
66
67export function lastlogin(
68 handler: (req: Request) => Response | Promise<Response>,
69) {

sqliteExplorerAppREADME.md1 match

@rizoadevUpdated 9 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

aqimain.tsx1 match

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

test_migratedmain.tsx5 matches

@jxnblkUpdated 9 months ago
2import { render } from "npm:preact-render-to-string";
3
4export function it(name, fn) {
5 const ok = "✅ [OK]: ";
6 const fail = "❌ [FAIL]: ";
15}
16
17export function describe(name, run) {
18 console.log(name);
19 return async function(req: Request): Promise<Response> {
20 await run();
21 return Response.json({ ok: true, status: 200 });
34};
35
36function Badge({ status }: BadgeProps) {
37 const color = colors[status];
38 const label = status ? status.toUpperCase() : "N/A";
68}
69
70export default async function(req: Request): Promise<Response> {
71 const params = new URL(req.url).searchParams;
72 const valURL = params.get("url");

getFileEmail4 file matches

@shouserUpdated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblkUpdated 1 month ago
Simple functional CSS library for Val Town
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.