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/$%7Bsuccess?q=function&page=99&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 20480 results for "function"(2344ms)

gordwameApp.tsx3 matches

@alexwein•Updated 2 days ago
23}
24
25export function App({ board: initialBoard, solutions: initialSolutions, totalSolutions: initialTotalSolutions }: AppProps) {
26 const defaultBoard = [
27 { position: 0, inner: "", outer: "", flipped: false },
49 // Only fetch a new board if we don't have an initial board
50 if (!initialBoard) {
51 async function initializeBoard() {
52 setIsLoading(true);
53 try {
99
100 useEffect(() => {
101 function handleResize() {
102 const width = window.innerWidth;
103 const height = Math.min(window.innerHeight, width);

open-ai-proxymain.tsx1 match

@khanhicetea•Updated 2 days ago
1export default async function(req: Request): Promise<Response> {
2 // const OPENAI_API_KEY = "your_openai_api_key_here";
3

MUSALLopenai.ts3 matches

@otega07•Updated 2 days ago
14 * Generate a personalized music playlist based on user preferences and context
15 */
16export async function generateMusicPlaylist(
17 user: UserProfile,
18 request: RecommendationRequest
94 * Generate personalized football drill recommendations based on user profile and request
95 */
96export async function generateFootballDrills(
97 user: UserProfile,
98 request: RecommendationRequest,
184 * Generate a complete training session with both music and drills
185 */
186export async function generateTrainingSession(
187 user: UserProfile,
188 request: RecommendationRequest,

EEPPortalmediaMonitoring.tsx5 matches

@solomonferede•Updated 2 days ago
10};
11
12function MediaMonitoringTab({ user }) {
13 const [entries, setEntries] = useState([]);
14 const [platform, setPlatform] = useState("");
167 };
168
169 // Function to open the edit modal
170 const handleEditClick = (entry) => {
171 setEditingEntry(entry);
187 };
188
189 // Function to close the edit modal
190 const handleCloseEditModal = () => {
191 setIsEditModalOpen(false);
204 };
205
206 // Function to handle changes in the edit modal form
207 const handleEditFormChange = (e) => {
208 const { name, value } = e.target;
213 };
214
215 // Function to save the edited entry
216 const handleSaveEdit = async () => {
217 // Validate required fields from editFormData

TownieuseUsageStats.ts1 match

@valdottown•Updated 2 days ago
1import { useEffect } from "react";
2
3export function useUsageStats(messages: any[], usages: any[]) {
4 useEffect(() => {
5 if (!messages?.length) return;

TownieuseProject.tsx1 match

@valdottown•Updated 2 days ago
4const FILES_ENDPOINT = "/api/project-files";
5
6export function useProject(projectId: string, branchId?: string) {
7 const [data, setData] = useState<any>(null);
8 const [loading, setLoading] = useState(true);

TownieuseProjects.tsx1 match

@valdottown•Updated 2 days ago
3const ENDPOINT = "/api/projects-loader";
4
5export function useProjects() {
6 const [data, setData] = useState<any>(null);
7 const [loading, setLoading] = useState(true);

TownieuseLoadingFavicon.ts3 matches

@valdottown•Updated 2 days ago
1import { useEffect } from "react";
2
3function setLoadingFavicon() {
4 document.querySelector('link[rel="icon"]').href = "/favicon-loading.svg";
5}
6function resetFavicon() {
7 document.querySelector('link[rel="icon"]').href = "/favicon.svg";
8}
9
10export function useLoadingFavicon(loading: boolean) {
11 useEffect(() => {
12 if (loading) setLoadingFavicon();

TownieuseCreateProject.tsx1 match

@valdottown•Updated 2 days ago
3const ENDPOINT = "/api/create-project";
4
5export function useCreateProject() {
6 const [data, setData] = useState<any>(null);
7 const [loading, setLoading] = useState(false);

TownieuseCreateBranch.tsx1 match

@valdottown•Updated 2 days ago
3const ENDPOINT = "/api/create-branch";
4
5export function useCreateBranch(projectId: string) {
6 const [data, setData] = useState<any>(null);
7 const [loading, setLoading] = useState(false);

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 weeks 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.