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=20&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 7215 results for "function"(451ms)

GitHubSyncREADME.md1 match

@MadEthan6•Updated 3 days ago
42const url = Deno.env.get("PUSH_URL") as string;
43
44async function pushValsToGitHub() {
45 const body = "hello";
46 const signature = await sign(body, secret);

GitHubSynchome1 match

@MadEthan6•Updated 3 days ago
4import type { Context } from "npm:hono";
5
6export default async function(c: Context) {
7 return c.html(
8 <html>

GitHubSyncgithub-push1 match

@MadEthan6•Updated 3 days ago
12const valtown = new ValTown();
13
14export default async function GitHubPush(c: Context) {
15 // auth check in /index
16 const user = await valtown.me.profile.retrieve();

GitHubSynccommit-files2 matches

@MadEthan6•Updated 3 days ago
18
19/**
20 * General use function to commit files to GitHub
21 */
22export async function commitFiles({
23 token,
24 owner,

blob_adminapp.tsx7 matches

@crisscrossed•Updated 3 days ago
10}
11
12function Tooltip({ children, content }: TooltipProps) {
13 const [isVisible, setIsVisible] = useState(false);
14 const tooltipRef = useRef<HTMLDivElement>(null);
49}
50
51function formatBytes(bytes: number, decimals = 2) {
52 if (bytes === 0) return "0 Bytes";
53 const k = 1024;
58}
59
60function copyToClipboard(text: string) {
61 navigator.clipboard.writeText(text).then(() => {
62 console.log("Text copied to clipboard");
66}
67
68function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
69 const [isOpen, setIsOpen] = useState(false);
70 const menuRef = useRef(null);
73
74 useEffect(() => {
75 function handleClickOutside(event) {
76 if (menuRef.current && !menuRef.current.contains(event.target)) {
77 event.stopPropagation();
155}
156
157function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
158 const [isLoading, setIsLoading] = useState(false);
159 const decodedKey = decodeURIComponent(blob.key);
216}
217
218function App({ initialEmail, initialProfile, sourceURL }) {
219 const encodeKey = (key: string) => encodeURIComponent(key);
220 const decodeKey = (key: string) => decodeURIComponent(key);

custom-jsx-runtime-starterREADME.md1 match

@jxnblk•Updated 3 days ago
19
20This points to the `jsx/jsx-runtime` module (the `jsx-runtime` name is important),
21which wraps the default React JSX runtime with a function that extracts an `sx` prop and applies it as the `style` prop.
22
23When the client module requests the `App.tsx` file from Val Town, the JSX is compiled to vanilla JavaScript to run in the browser.

custom-jsx-runtime-starterApp.tsx1 match

@jxnblk•Updated 3 days ago
1/** @jsxImportSource ./jsx */
2
3export function App () {
4 console.log("App");
5 return (

custom-jsx-runtime-starterhttp.tsx1 match

@jxnblk•Updated 3 days ago
5const MODULE_URL = import.meta.resolve("./client.tsx");
6
7export default async function () {
8 const html = renderToString(
9 <html>

custom-jsx-runtime-starterjsx-runtime1 match

@jxnblk•Updated 3 days ago
20}
21
22export function jsxs (type, props, key) {
23 return jsx(type, props, key);
24}

JimeluStevenshandleTelegramMessage.ts5 matches

@luke_f•Updated 3 days ago
30 * Store a chat message in the database
31 */
32export async function storeChatMessage(
33 chatId,
34 senderId,
63 * Retrieve chat history for a specific chat
64 */
65export async function getChatHistory(chatId, limit = 50) {
66 try {
67 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
88 * Format chat history for Anthropic API
89 */
90function formatChatHistoryForAI(history) {
91 const messages = [];
92
112 * Analyze a Telegram message and extract memories from it
113 */
114async function analyzeMessageContent(
115 anthropic,
116 username,
487
488// Handle webhook requests
489export default async function(req: Request): Promise<Response> {
490 console.log("something happened");
491 // Set webhook if it is not set yet

getFileEmail4 file matches

@shouser•Updated 5 days ago
A helper function to build a file's email

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago