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/image-url.jpg%20%22Image%20title%22?q=function&page=92&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 33110 results for "function"(4252ms)

pipedream-connectDashboard.tsx1 match

@tlefebvre•Updated 1 week ago
9import { AccountsList } from "./AccountsList.tsx";
10
11export function Dashboard(
12 { user, pipedreamToken, onLogout, onError },
13) {

pipedream-connectauth.tsx3 matches

@tlefebvre•Updated 1 week ago
5// in-memory cache
6const users = {};
7async function getValTownUser(apiKey: string) {
8 if (users[apiKey]) return users[apiKey];
9 try {
18}
19
20// Helper function to get current user from cookie
21export async function getCurrentUser(c: any) {
22 const apiKey = getCookie(c, "vt_api_key");
23 console.log("Cookie check - API key found:", !!apiKey);

pipedream-connectAccountsList.tsx1 match

@tlefebvre•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0? */
2export function AccountsList({ accounts }) {
3 return (
4 <section>

whgovwiremain.tsx2 matches

@jimniels•Updated 1 week ago
1import { blob } from "https://esm.town/v/std/blob";
2
3export default async function(interval: Interval) {
4 const datetime = (new Date()).toISOString();
5 const htmlKey = `whgovwire_html_${datetime}`;
18// It excludes whitehouse.gov links and bare links to the whitehouse's social accounts (svgs)
19// const links: Array<string> = $(`a[href^="http"][target="_blank"]:not([href*="whitehouse.gov"])`)
20// .filter(function() {
21// // Exclude
22// return $(this).find("svg").length === 0;

stevensDemomigrateMemoriesDb.ts1 match

@stendec•Updated 1 week ago
2// Run this script manually to add new columns to the memories table
3
4export default async function migrateMemoriesDb() {
5 try {
6 // Import SQLite module

Blobber-2README.md1 match

@stevekrouse•Updated 1 week ago
130
131### Customizing the Interface
132The HTML templates in `main.tsx` can be modified to change the appearance and functionality.
133
134### Adding New Features

Blobber-2main.tsx2 matches

@stevekrouse•Updated 1 week ago
130 </form>
131 <script>
132 document.getElementById('delete-blobs').addEventListener('submit', function (e) {
133 const confirmed = confirm('Are you sure you want to delete these blobs? This action cannot be undone.');
134 if (!confirmed) {
145});
146
147async function handler(request: Request): Promise<Response> {
148 return app.fetch(request);
149}

Blobber-2debug.tsx1 match

@stevekrouse•Updated 1 week ago
1import { lastlogin } from "https://esm.town/v/stevekrouse/lastlogin_safe";
2
3async function handler(request: Request): Promise<Response> {
4 const email = request.headers.get("X-LastLogin-Email");
5

ExampleVideomain.tsx1 match

@wolf•Updated 1 week ago
1import { useState } from "https://esm.sh/react@18.2.0";
2
3export function App(test: number) {
4 const [clicked, setClicked] = useState(0);
5 return (

stevensDemotestDailyBrief.ts1 match

@stendec•Updated 1 week ago
4import { DateTime } from "https://esm.sh/luxon@3.4.4";
5
6export async function testDailyBrief() {
7 try {
8 const testChatId = Deno.env.get("TEST_TELEGRAM_CHAT_ID");

discordWebhook2 file matches

@stevekrouse•Updated 3 days ago
Helper function to send Discord messages
tuna

tuna9 file matches

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