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=2643&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 29089 results for "function"(1911ms)

getCloudLabCountmain.tsx1 match

@todepond•Updated 1 year ago
4// TODO: Convert to sqlite
5
6export default async function(req: Request): Promise<Response> {
7 const result = await sqlite.execute(
8 "SELECT COUNT(*) FROM counter_2_baby",

createValmain.tsx1 match

@stevekrouse•Updated 1 year ago
29}
30
31export function createVal({ token, ...data }: { token?: string } & CreateValArgs): Promise<ValResponse> {
32 return fetchJSON("https://api.val.town/v1/vals", {
33 bearer: token || Deno.env.get("valtown"),

hono_react_ssrmain.tsx1 match

@stevekrouse•Updated 1 year ago
40
41export const middleware = (importMetaURL: string) =>
42 async function(req: Request): Promise<Response> {
43 const { author, name } = extractValInfo(importMetaURL);
44 const valURL = `https://www.val.town/v/${author}/${name}`;

linkInBioTemplatemain.tsx1 match

@vhugoobject•Updated 1 year ago
12};
13
14export default async function(req: Request) {
15 return new Response(
16 renderToString(

valTownBadgeExamplemain.tsx1 match

@jxnblk•Updated 1 year ago
4import { render } from "npm:preact-render-to-string";
5
6function handler(req: Request): Promise<Response> {
7 const body = render(
8 <div>

codeIconReactmain.tsx1 match

@jxnblk•Updated 1 year ago
2import React from "npm:react";
3
4export default function CodeIcon(props: React.SVGProps<SVGSVGElement>) {
5 return (
6 <svg

staticChessREADME.md1 match

@bjenhamin4alfredolvchenki•Updated 1 year ago
8Plain, brutalist, no bloat chess. Every page is only html and css. Every chess move is made by clicking a link. Send a link to your friend and they'll send you one back to make your move. No silly animations or slick interactivity to trip up your gameplay. When Google indexes this site will we successfully compute all possible chess moves?
9
10Functionality is quite limited, and things might be broken. Please let me know if you find bugs!
11
12Inspired by [this HN discussion](https://news.ycombinator.com/item?id=39456467) about sites that have all possible game states of tic-tac-toe.

frontmattermain.tsx2 matches

@pomdtr•Updated 1 year ago
6import { frontmatter } from "npm:micromark-extension-frontmatter";
7
8export async function extractFrontmatter(readme: string) {
9 const tree = await fromMarkdown(readme, {
10 extensions: [frontmatter(["yaml"])],
23}
24
25export async function extractValFrontmatter(val: { author: string; name: string }) {
26 const { readme } = await api<{ readme: string }>(`/v1/alias/${val.author}/${val.name}`);
27 return extractFrontmatter(readme);

SignupModalmain.tsx1 match

@iamseeley•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx */
2
3export default function SignupModal() {
4 return (
5 <div id="signup-modal" className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 animate-fadeIn">

LoginModalmain.tsx1 match

@iamseeley•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx */
2
3export default function LoginModal() {
4 return (
5 <>
tuna

tuna9 file matches

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