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=2531&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 28949 results for "function"(1859ms)

recentpinboardmain.tsx1 match

@ejfox•Updated 9 months ago
4import axios from "npm:axios";
5
6export default async function main(req: Request): Promise<Response> {
7 const token = Deno.env.get("PINBOARD_TOKEN");
8

githubcollabgenmain.tsx4 matches

@ejfox•Updated 9 months ago
3const OPENAI_API_KEY = "your_openai_api_key"; // Replace with your actual OpenAI API key
4
5export default async function main(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const user1 = url.searchParams.get("user1") || "ejfox";
8 const user2 = url.searchParams.get("user2") || "stevekrouse";
9
10 async function fetchUserActivity(username: string) {
11 const threeMonthsAgo = new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString();
12 const response = await fetch(
20 }
21
22 function summarizeActivity(data: any[]): string {
23 const summary = [];
24 const repoSet = new Set<string>();
96 });
97 } catch (error) {
98 console.error("Error in main function:", error);
99 return new Response(`Error: ${error.message}. Please check the logs for more details.`, { status: 500 });
100 }

githubactivitysummarizermain.tsx3 matches

@ejfox•Updated 9 months ago
10const OPENAI_API_KEY = "your_openai_api_key"; // Replace with your actual OpenAI API key
11
12export default async function main(req: Request): Promise<Response> {
13 const url = new URL(req.url);
14 const user1 = url.searchParams.get('user1') || 'ejfox';
15 const user2 = url.searchParams.get('user2') || 'octocat';
16
17 async function fetchUserActivity(username: string) {
18 const oneYearAgo = new Date(Date.now() - 365 * 24 * 60 * 60 * 1000).toISOString();
19 const response = await fetch(`https://api.github.com/users/${username}/events?per_page=100&since=${oneYearAgo}`);
31 ]);
32
33 function summarizeActivity(data: any[]) {
34 const repoSet = new Set();
35 const languageSet = new Set();

relationshipgeneratormain.tsx1 match

@ejfox•Updated 9 months ago
11const openai = new OpenAI();
12
13export default async function main(req: Request): Promise<Response> {
14 if (req.method !== "POST") {
15 return new Response("Method not allowed. Use POST with text in the body.", { status: 405 });

githubactivitymain.tsx3 matches

@ejfox•Updated 9 months ago
8const GITHUB_USERNAME = "ejfox";
9
10async function fetchGitHubEvents(username: string) {
11 const response = await fetch(`https://api.github.com/users/${username}/events/public`, {
12 headers: {
20}
21
22function processEvents(events: any[]) {
23 return events
24 .filter(event => {
88}
89
90export default async function main(req: Request): Promise<Response> {
91 try {
92 const events = await fetchGitHubEvents(GITHUB_USERNAME);

renderResumemain.tsx1 match

@iamseeley•Updated 9 months ago
1export function renderResume({
2 resumeDetails,
3 theme,

savePDFmain.tsx2 matches

@iamseeley•Updated 9 months ago
1function applyPDFStyles() {
2 const style = document.createElement('style');
3 style.textContent = `
77}
78
79export function saveAsPDF() {
80 const saveButton = document.getElementById('saveAsPDFButton');
81 if (saveButton) {

neverthrowmain.tsx2 matches

@pomdtr•Updated 9 months ago
9}
10
11export function Success<T>(value: T): Success<T> {
12 return { ok: true, value };
13}
14
15export function Failure<E>(error: E): Failure<E> {
16 return { ok: false, error };
17}

publicBlushSnipemain.tsx2 matches

@pomdtr•Updated 9 months ago
1import { Failure, Success } from "https://esm.town/v/pomdtr/neverthrow";
2
3const demoFunction = () => {
4 const result = Math.random();
5 if (result > 0.5)
10};
11
12const res = demoFunction();
13if (res.success) {
14 console.log(res.data);

neverthrowREADME.md2 matches

@pomdtr•Updated 9 months ago
4import { Failure, Success } from "https://esm.town/v/pomdtr/neverthrow?v=5";
5
6const demoFunction = () => {
7 const result = Math.random();
8 if (result > 0.5) {
14};
15
16const res = demoFunction();
17if (res.ok) {
18 console.log(res.value);
tuna

tuna9 file matches

@jxnblk•Updated 16 hours 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.