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=758&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 7804 results for "function"(542ms)

twitterRecentMentionsmain.tsx4 matches

@charmaine•Updated 6 months ago
4import { socialDataSearch } from "https://esm.town/v/stevekrouse/socialDataSearch";
5
6export default async function server(request: Request): Promise<Response> {
7 // Updated to just Specs post-launch
8 const query = "@Spectacles";
20}
21
22function retResponse(tweets: any[]): Response {
23 const sevenDaysAgo = new Date();
24 sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
75 <script>
76 // Load Twitter widget asynchronously
77 window.twttr = (function(d, s, id) {
78 var js, fjs = d.getElementsByTagName(s)[0],
79 t = window.twttr || {};
84 fjs.parentNode.insertBefore(js, fjs);
85 t._e = [];
86 t.ready = function(f) {
87 t._e.push(f);
88 };

socialDataUpdatemain.tsx4 matches

@charmaine•Updated 6 months ago
8// and displays them as embedded posts with preview images on a dark background.
9
10export default async function server(request: Request): Promise<Response> {
11 const query = "@SnapAR OR \"Lens Studio\"";
12
23}
24
25function retResponse(tweets: any[]): Response {
26 const sevenDaysAgo = new Date();
27 sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
78 <script>
79 // Load Twitter widget asynchronously
80 window.twttr = (function(d, s, id) {
81 var js, fjs = d.getElementsByTagName(s)[0],
82 t = window.twttr || {};
87 fjs.parentNode.insertBefore(js, fjs);
88 t._e = [];
89 t.ready = function(f) {
90 t._e.push(f);
91 };

tvshowsmain.tsx2 matches

@tmcw•Updated 6 months ago
3import process from "node:process"
4
5export const tvshows = async function() {
6 const TV_SHOWS_WATCHED = [
7 // Ted Lasso
32 data.push(show)
33 }
34 data.sort(function(a, b) {
35 if (a.last_air_date > b.last_air_date)
36 return -1

getAppleDevicemain.tsx1 match

@tmcw•Updated 6 months ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5"
2
3export async function getAppleDevice(req: Request) {
4 const deviceId = new URL(req.url).searchParams.get("search_keywords") as string
5 if (!deviceId) return Response.json("Please provide a search_keywords query parameter")

replaceEmojisWithImagesmain.tsx1 match

@tmcw•Updated 6 months ago
1export async function replaceEmojisWithImages(
2 req: express.Request,
3 res: express.Response,

fantasticPurplePossummain.tsx1 match

@maxm•Updated 7 months ago
1export default async function(req: Request): Promise<Response> {
2 return Response.json({ ok: false });
3}

intenseLimeBuzzardmain.tsx1 match

@maxm•Updated 7 months ago
42);
43
44export default async function(req: Request): Promise<Response> {
45 return Response.json(
46 await db.query(`

jsonVisualizerAppmain.tsx3 matches

@tmcw•Updated 7 months ago
8SyntaxHighlighter.registerLanguage('json', json);
9
10function App() {
11 const [jsonInput, setJsonInput] = useState('');
12 const [parsedJson, setParsedJson] = useState('');
57}
58
59function client() {
60 createRoot(document.getElementById("root")).render(<App />);
61}
63if (typeof document !== "undefined") { client(); }
64
65export default async function server(request: Request): Promise<Response> {
66 return new Response(`
67 <html>

createGitHubContribGraphmain.tsx4 matches

@tmcw•Updated 7 months ago
172}
173
174function App() {
175 const [username, setUsername] = useState("stevekrouse")
176 const [contributionData, setContributionData] = useState<any>(null)
360}
361
362function client() {
363 createRoot(document.getElementById("root")).render(<App />)
364}
365if (typeof document !== "undefined") { client() }
366
367export default async function server(request: Request): Promise<Response> {
368 if (request.method === "POST" && new URL(request.url).pathname === "/contributions") {
369 const { username } = await request.json()
395}
396
397async function fetchGitHubContributions(username: string) {
398 const query = `
399 query($username: String!) {

iframeGridInfinitemain.tsx7 matches

@maxm•Updated 7 months ago
8import { createRoot } from "https://esm.sh/react-dom/client";
9
10function Modal({ onClose }) {
11 return (
12 <div style={{
28}
29
30function IframeCell({ cellKey, url, onUrlSubmit, isLoading }) {
31 const [inputUrl, setInputUrl] = useState(url || '');
32
59}
60
61function App() {
62 const [position, setPosition] = useState({ x: 0, y: 0 });
63 const [isDragging, setIsDragging] = useState(false);
206}
207
208function client() {
209 createRoot(document.getElementById("root")).render(<App />);
210}
212if (typeof document !== "undefined") { client(); }
213
214async function handleSubmitUrl(request: Request): Promise<Response> {
215 const { cellKey, url } = await request.json();
216 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
236}
237
238async function handleLoadUrls(): Promise<Response> {
239 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
240 const KEY = "iframeGridInfinite";
255}
256
257async function server(request: Request): Promise<Response> {
258 if (request.method === 'POST' && new URL(request.url).pathname === '/api/submit-url') {
259 return handleSubmitUrl(request);

getFileEmail4 file matches

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

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago