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=2130&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 24819 results for "function"(3986ms)

getSpotifyTrackUrlmain.tsx5 matches

@dthyresson•Updated 10 months ago
12};
13
14export function buildSpotifyTrackKey(artist: string, title: string) {
15 const key = `${SPOTIFY_TRACK_KEY_PREFIX}_artist:${kebabCase(artist)}_title:${kebabCase(title)}`.toLowerCase();
16 console.debug("buildSpotifyTrackKey", artist, title, key);
18}
19
20export function spotifyTrackUrl(track, format: SpotifyTrackUrlFormat) {
21 if (!track) return;
22
30}
31
32export function spotifyTrackAppLink(track) {
33 if (!track) return;
34
38}
39
40async function cacheTrack(spotifyTrackKey: string, track: any) {
41 console.debug(`Caching track ${spotifyTrackKey}`);
42 await blob.setJSON(spotifyTrackKey, track);
51}
52
53export async function getSpotifyTrackUrl(artist: string, title: string, options?: SpotifyTrackUrlOptions) {
54 const format = options?.format || "web";
55

processTrackBlobsJobmain.tsx5 matches

@dthyresson•Updated 10 months ago
5import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";
6
7async function dropDb() {
8 await sqlite.execute(`
9 drop table if exists tracks`);
28});
29
30async function setUpDb() {
31 await sqlite.execute(`
32 create table if not exists tracks (
46}
47
48export async function refreshTrackFromBlobKey(key: string) {
49 const trackInfo = await blob.getJSON(key);
50
75}
76
77export async function perform() {
78 const spotifyTracks = await blob.list("spotify_track_id");
79 for (const spotifyTrack of spotifyTracks) {
83}
84
85export default async function(interval: Interval) {
86 // await dropDb();
87 // await setUpDb();

playRandomSongmain.tsx1 match

@dthyresson•Updated 10 months ago
10};
11
12export async function getRandomTrack(artist?: string): Promise<RandomTrack> {
13 const { rows } = artist
14 ? await sqlite.execute({

resetFavoriteSongSearchesmain.tsx1 match

@dthyresson•Updated 10 months ago
20] as Track[];
21
22export default async function(interval: Interval) {
23 await sqlite.execute(`drop table if exists favorite_song_searches;`);
24

effectmain.tsx2 matches

@dvdsgl•Updated 10 months ago
9 : `${Duration.toMillis(d)}ms`;
10
11export function withTimeLog<A, E, C>(
12 label: string,
13): (self: Effect.Effect<A, E, C>) => Effect.Effect<A, E, C> {
14 return (self) =>
15 Effect.gen(function*() {
16 const start = yield* Clock.currentTimeMillis;
17 const result = yield* self;

graphQLYogaWithSubscriptionsmain.tsx1 match

@dthyresson•Updated 10 months ago
31 countdown: {
32 // This will return the value on every 1 sec until it reaches 0
33 subscribe: async function*(_, { from }) {
34 for (let i = from; i >= 0; i--) {
35 await setTimeout(1000);

compileAndUploadTinygoWasmREADME.md1 match

@kora•Updated 10 months ago
36const resp = await fetch("https://maxm-wasmBlobHost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm");
37const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
38export default async function(req: Request): Promise<Response> {
39 return handler(req);
40}

compileAndUploadTinygoWasmmain.tsx1 match

@kora•Updated 10 months ago
59const resp = await fetch("${url}");
60const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
61export default async function(req: Request): Promise<Response> {
62 return handler(req);
63}`);

memain.tsx1 match

@dthyresson•Updated 10 months ago
1export function handler(request: Request) {
2 return Response.redirect('https://www.thyresson.io')
3}

coffeeReptilemain.tsx1 match

@tempguy•Updated 10 months ago
1import { blob } from "https://esm.town/v/std/blob?v=12";
2export default async function(interval: Interval) {
3 await fetch("https://tempguy-scarletsole.web.val.run/refresh");
4 const date = new Date();

getFileEmail4 file matches

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

tuna8 file matches

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