sqliteExplorerAppmain.tsx2 matches
27<head>
28<title>SQLite Explorer</title>
29<link rel="preconnect" href="https://fonts.googleapis.com" />
3031<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32<link
33href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34rel="stylesheet"
35/>
sqliteExplorerAppREADME.md1 match
13## Authentication
1415Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
1617## Todos / Plans
AlgoliaDocumentaionmain.tsx1 match
12--template 'InstantSearch.js' \
13--app-id 'L3YFVOR7YL' \
14--api-key '7fb55c7d480ef8b1ad09b55bf3d57afd' \
15--index-name 'Test_index' \
16--attributes-to-display 'chapterTitle' \
valTownUsermain.tsx15 matches
1import { api } from "https://esm.town/v/iamseeley/api";
23let cachedUser = null;
7if (!cachedUser) {
8try {
9cachedUser = await api('/v1/me', { authenticated: true });
10} catch (error) {
11console.error('Error fetching user info:', error);
49async getLikedVals(options = {}) {
50const { offset = 0, limit = 20 } = options;
51return api(`/v1/me/likes?offset=${offset}&limit=${limit}`, { authenticated: true });
52},
53async getComments(options = {}) {
56if (since) url += `&since=${since}`;
57if (until) url += `&until=${until}`;
58return api(url, { authenticated: true });
59},
60async getReferences(options = {}) {
63if (since) url += `&since=${since}`;
64if (until) url += `&until=${until}`;
65return api(url, { authenticated: true });
66},
67async listBlobs(prefix) {
68let url = '/v1/blob';
69if (prefix) url += `?prefix=${encodeURIComponent(prefix)}`;
70return api(url, { authenticated: true });
71},
72async getBlob(key) {
73return api(`/v1/blob/${encodeURIComponent(key)}`, {
74authenticated: true,
75headers: {
80},
81async storeBlob(key, data) {
82return api(`/v1/blob/${encodeURIComponent(key)}`, {
83method: 'POST',
84body: data,
87},
88async deleteBlob(key) {
89return api(`/v1/blob/${encodeURIComponent(key)}`, {
90method: 'DELETE',
91authenticated: true
95const { offset = 0, limit = 20 } = options;
96const userInfo = await this.getUserInfo();
97return api(`/v1/users/${userInfo.id}/vals?offset=${offset}&limit=${limit}`, { authenticated: true });
98},
99async createVal(valInfo) {
100return api('/v1/vals', {
101method: 'POST',
102body: JSON.stringify(valInfo),
105},
106async aliasVal(valName: string) {
107return api(`/v1/alias/${encodeURIComponent(this.username)}/${encodeURIComponent(valName)}`, { authenticated: true });
108},
109async updateVal(valId, updates) {
110return api(`/v1/vals/${valId}`, {
111method: 'PUT',
112body: JSON.stringify(updates),
115},
116async deleteVal(valId) {
117return api(`/v1/vals/${valId}`, {
118method: 'DELETE',
119authenticated: true
121},
122async executeSqlite(statement) {
123return api('/v1/sqlite/execute', {
124method: 'POST',
125body: JSON.stringify({ statement }),
geminiBboxREADME.md1 match
9This app is an adaptation of Simon Willison's idea, which you can read more about here: [https://simonwillison.net/2024/Aug/26/gemini-bounding-box-visualization/](https://simonwillison.net/2024/Aug/26/gemini-bounding-box-visualization/)
1011- API keys are only stored in your browser's local storage.
12- Source code: [https://www.val.town/v/yawnxyz/geminiBbox/](https://www.val.town/v/yawnxyz/geminiBbox/)
13- Original Source: https://github.com/simonw/tools/blob/main/gemini-bbox.html
1import { API_URL } from "https://esm.town/v/std/API_URL";
23export async function api<T = any>(
4path: string,
5options?: RequestInit & {
12if (options?.paginate) {
13const data = [];
14let url = new URL(`${API_URL}${path}`);
15url.searchParams.set("limit", "100");
1633return { data } as T;
34}
35const resp = await fetch(`${API_URL}${path}`, {
36...options,
37headers: {
valTownUserREADME.md2 matches
1**👤 valTownUser**
23The `valTownUser` object provides a convenient interface to interact with Val Town's API and access user-specific information and functionalities.
45## User Information
40### getId()
41Retrieves the user's ID.
42- Use case: Using the user ID for database queries or API calls.
43```ts
44import { valTownUser } from "https://esm.town/v/iamseeley/valTownUser";
13debugMessages.push("Valtown token retrieved from environment");
1415const client = new ValTown({ apiKey: token });
16debugMessages.push("ValTown client initialized");
17
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
1112<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>
dailyDadJokeREADME.md2 matches
113. 🤣🤣🤣🤣
1213## API
1415This val uses the [icanhazdadjoke API](https://icanhazdadjoke.com/api). You can find [more docs here](https://github.com/15Dkatz/official_joke_api), such as how to [filter by type](https://github.com/15Dkatz/official_joke_api?tab=readme-ov-file#grab-jokes-by-type).