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=930&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 18155 results for "function"(1471ms)

GitHubSync

GitHubSyncREADME.md1 match

@jxnblk•Updated 2 months ago
42const url = Deno.env.get("PUSH_URL") as string;
43
44async function pushValsToGitHub() {
45 const body = "hello";
46 const signature = await sign(body, secret);

faviconmain.tsx6 matches

@stainless_em•Updated 2 months ago
19 }
20}
21async function favicon(url: string, targetSize: number = 512) {
22 if (!inited) {
23 CanvasKit = await CanvasKitInit();
30 let faviconCandidates: { url: string; buffer: ArrayBuffer; width: number; height: number }[] = [];
31
32 async function isFavicon(u: string) {
33 try {
34 const response = await fetch(u);
82 }
83
84 async function checkSuspects(f: string) {
85 for (const suspect of usualSuspects) {
86 const result = await isFavicon(f + suspect);
88 }
89
90 async function checkTheDom(u: string) {
91 try {
92 const response = await fetch(u);
95
96 if ($("link") && $("link").length > 0) {
97 $("link").each(function() {
98 if (
99 $(this).attr("rel") && /(touch-|(\s|^))icon($|\s)/.test($(this).attr("rel")!)
119 }
120
121 async function checkAll(url: string) {
122 await isFavicon(url);
123 if (faviconCandidates.length > 0) {

authenticBeigeFireflymain.tsx7 matches

@all•Updated 2 months ago
788const months = ["Jan", "Feb", "Mar", "Apr", "May", "June", "July", "August", "Sept", "Oct", "Nov", "Dec"];
789
790function NavBar() {
791 return (
792 <nav className="navbar">
814}
815
816function Modal({ crop, onClose }) {
817 return (
818 <div className="modal-overlay" onClick={onClose}>
835}
836
837function CropAvailabilityTable() {
838 const [search, setSearch] = useState("");
839 const [selectedCrop, setSelectedCrop] = useState(null);
881}
882
883function About() {
884 return (
885 <section className="about-section" id="about">
894}
895
896function App() {
897 return (
898 <div className="app">
913}
914
915function client() {
916 createRoot(document.getElementById("root")).render(<App />);
917}
921}
922
923export default async function server(request) {
924 return new Response(
925 `

redditAlertREADME.md2 matches

@tengis•Updated 2 months ago
42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
45
46---
58- Key: `mentionsDiscord`
59- Value: Your Discord webhook URL.
60Notifications will be sent using this function:
61```
62 await discordWebhook({

redditAlertmain.tsx1 match

@tengis•Updated 2 months ago
12const isProd = true;
13
14export async function redditAlert({ lastRunAt }: Interval) {
15 if (!SERP_API_KEY || !DISCORD_API_KEY) {
16 console.error("Missing SERP_API_KEY or Discord webhook URL. Exiting.");

loveyoumain.tsx3 matches

@Tinygusie2•Updated 2 months ago
4import React from "https://esm.sh/react@18.2.0";
5
6function App() {
7 const draw = {
8 hidden: { pathLength: 0, opacity: 0 },
96}
97
98function client() {
99 ReactDOM.createRoot(document.getElementById("root")!).render(<App />);
100}
101if (typeof document !== "undefined") { client(); }
102
103export default async function server(request: Request): Promise<Response> {
104 return new Response(
105 `

dataAnalyticsPortfoliomain.tsx4 matches

@Sumeshbamaniya•Updated 2 months ago
61}
62
63function ThreeBackground() {
64 const mountRef = useRef<HTMLDivElement>(null);
65 const [threeError, setThreeError] = useState<string | null>(null);
123// Existing components and code remain the same...
124
125function App() {
126 return (
127 <ErrorBoundary>
134}
135
136function client() {
137 try {
138 createRoot(document.getElementById("root")!).render(<App />);
149if (typeof document !== "undefined") { client(); }
150
151export default async function server(request: Request): Promise<Response> {
152 return new Response(`
153 <html>

sqliteExplorerAppREADME.md1 match

@ianmenethil•Updated 2 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

replicate_starterApp.tsx1 match

@replicate•Updated 2 months ago
3import React from "https://esm.sh/react@18.2.0";
4
5function ImageGenerator() {
6 const [prompt, setPrompt] = React.useState("");
7 const [images, setImages] = React.useState<any>([]);

BraintrustSDKtutorial1 match

@tkneisly•Updated 2 months ago
3import { Eval } from "npm:braintrust";
4
5export default async function handler() {
6 const result = {
7 apiKeyStatus: null,

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": "*",