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=1314&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 18515 results for "function"(2317ms)

wideLibmain.tsx12 matches

@maxm•Updated 5 months ago
5const schemaVersion = 3;
6
7function _client() {
8 return createClient({
9 url: Deno.env.get("WIDE_CLICKHOUSE_URL"),
13}
14
15export async function runMigrations() {
16 for (
17 const migration of [
53 }
54}
55export function parseRows(rows: any[]) {
56 const processedRows = rows.map(row => {
57 const paths: {
65 };
66
67 function processObject(obj: any, currentPath = "") {
68 for (const [key, value] of Object.entries(obj)) {
69 const newPath = currentPath ? `${currentPath}.${key}` : key;
166 * write!
167 */
168export async function write(userId: string, data: any[]) {
169 return await writeRowsToClickhouse(userId, parseRows(data));
170}
182 * values!
183 */
184export async function values(
185 userId: string,
186 { field_name, field_type }: { field_name: string; field_type: FieldType },
218 * fields!
219 */
220export async function fields(userId: string, search: string = "") {
221 return (await (await _client().query({
222 query: `
296 * Get the ClickHouse comparison expression for the given operator
297 */
298function getComparisonExpression(
299 operator: TStringOperator | TNumberOperator | TBooleanOperator,
300 valueRef: string,
325
326/**
327 * Enhanced search function supporting multiple conditions with different operators
328 */
329export async function search(userId: string, {
330 filters,
331 start,
412
413
414function formatDate(date: Date) {
415 return String(getUnixTime(date) + (date.getMilliseconds() / 1000))
416}
425}
426
427function reconstructObjects(
428 results: LogRow[],
429) {

Jokemain.tsx1 match

@slothfuldreams•Updated 5 months ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

bskymain.tsx1 match

@stevekrouse•Updated 5 months ago
5};
6
7export default async function(req: Request): Promise<Response> {
8 const url =
9 "https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=stevekrouse.com&filter=posts_no_replies";

funnyAmaranthCrabmain.tsx1 match

@savinoventura•Updated 5 months ago
5
6// Fetches a random joke.
7function fetchRandomJoke() {
8 const SAMPLE_JOKE = {
9 "setup": "What do you call a group of disorganized cats?",

valSessionmain.tsx2 matches

@maxm•Updated 5 months ago
20`;
21
22async function newSession(valTownToken: string) {
23 const privateKeyPem = `
24-----BEGIN PRIVATE KEY-----
38}
39
40function validate(token: string) {
41 const decoded = jwt.verify(token, publicKeyPem, { algorithms: ["RS256"] }) as
42 & Awaited<

getSubscribersmain.tsx3 matches

@petermillspaugh•Updated 5 months ago
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function getSubscribers() {
4 const subs = await sqlite.execute(`
5 SELECT *
11await getSubscribers();
12
13export async function getNewsletters() {
14 const newsletters = await sqlite.execute(`
15 SELECT id, subject, web_url, target_send_date
20}
21
22export async function getEmailLogs() {
23 const logs = await sqlite.execute(`
24 SELECT id, newsletter_id, subscriber_id, sent_at

bskymain.tsx1 match

@wilhelm•Updated 5 months ago
5};
6
7export default async function(req: Request): Promise<Response> {
8 const url = "https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=wilb.me&filter=posts_no_replies";
9

isAaronAtTheBadPlaceYetmain.tsx1 match

@karkowg•Updated 5 months ago
1export default async function () {
2 const handles = [
3 "aaronfrancis.com",

peacefulYellowBoamain.tsx1 match

@kevinmatula•Updated 5 months ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

polishedCoffeeSlothmain.tsx1 match

@obenga24•Updated 5 months ago
5import { email } from "https://esm.town/v/std/email?v=9";
6// Fetches a random joke.
7function fetchRandomJoke() {
8 const SAMPLE_JOKE = {
9 "setup": "What do you call a group of disorganized cats?",

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
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.