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=1584&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 18616 results for "function"(3507ms)

getRandomEmojimain.tsx1 match

@maxm•Updated 11 months ago
1import emojis from "https://esm.sh/emojis-list";
2export function getRandomEmoji(): string {
3 return emojis[Math.floor(Math.random() * emojis.length)];
4}

reacttldrawclientmain.tsx1 match

@tfayyaz•Updated 11 months ago
7// import "https://esm.sh/tldraw/tldraw.css";
8
9export function App() {
10 return (
11 <>

openAIStreamingREADME.md1 match

@maxm•Updated 11 months ago
121. **Random Joke Generator:** Fetch a random joke from an API and display it.
132. **Daily Weather Update:** Pull weather data for your location using an API and create a daily summary.
143. **Mini Todo List:** Create a simple to-do list app with add, edit, and delete functionalities.
154. **Chuck Norris Facts:** Display a random Chuck Norris fact sourced from an API.
165. **Motivational Quote of the Day:** Fetch and display a random motivational quote each day.

lastloginHonomain.tsx1 match

@pomdtr•Updated 11 months ago
2import type { MiddlewareHandler } from "npm:hono";
3
4export function lastlogin(options?: LastLoginOptions): MiddlewareHandler {
5 return async (c, next) => {
6 return lastlogin2(next, options)(c.req.raw);

weekdaymain.tsx1 match

@xkonti•Updated 11 months ago
11};
12
13export function getWeekdaysInMonth(year: number, month: number, weekday: Weekday): Date[] {
14 const dates: Date[] = [];
15 const date = new Date(year, month, 1);

twitterAlertmain.tsx1 match

@nevikashah•Updated 11 months ago
4const query = "\"val.town\" OR \"val town\" -_ValTown_";
5
6export async function twitterAlert({ lastRunAt }: Interval) {
7 const results = await twitterSearch({
8 query,

buildclubProjectSearchmain.tsx2 matches

@yawnxyz•Updated 11 months ago
65const defaultEmbeddingColumn = "Embeddings";
66
67async function fetchAirtableData(baseId, tableName, nameColumn, contentColumn, embeddingColumn) {
68 const base = new Airtable({ apiKey: airtableApiKey }).base(baseId);
69 const records = await base(tableName).select().all();
78}
79
80async function searchDocuments(c, query, similarityThreshold) {
81 const baseId = c.req.query("base_id") || defaultBaseId;
82 const tableName = c.req.query("table_name") || defaultTableName;

handleDiscordInteractionREADME.md1 match

@camajudson•Updated 11 months ago
1Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality

airtablesemanticsearchmain.tsx1 match

@yawnxyz•Updated 11 months ago
18const defaultEmbeddingColumn = "Embeddings";
19
20async function fetchAirtableData(baseId, tableName, contentColumn, embeddingColumn) {
21 const base = new Airtable({ apiKey: airtableApiKey }).base(baseId);
22 const records = await base(tableName).select().all();

processResumemain.tsx1 match

@iamseeley•Updated 11 months ago
1import { resumeSections } from "https://esm.town/v/iamseeley/resumeSections";
2
3export function processResume(resume, sectionOrder = [], templates = {}) {
4 const allSections = [
5 'header', 'summary', 'education', 'work', 'projects', 'volunteer',

getFileEmail4 file matches

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