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=database&page=340&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=database

Returns an array of strings in format "username" or "username/projectName"

Found 3476 results for "database"(476ms)

add_to_notion_w_aiREADME.md4 matches

@nerdymomocat•Updated 1 year ago
1Uses instructor and open ai (with gpt-4-turbo) to process any content into a notion database entry.
2
3Use `addToNotion` with any database id and content.
4
5```
10```
11
12Prompts are created based on your database name, database description, property name, property type, property description, and if applicable, property options (and their descriptions).
13
14Supports: checkbox, date, multi_select, number, rich_text, select, status, title, url, email
15
16- Uses `NOTION_API_KEY`, `OPENAI_API_KEY` stored in env variables and uses [Valtown blob storage](https://esm.town/v/std/blob) to store information about the database.
17- Use `get_notion_db_info` to use the stored blob if exists or create one, use `get_and_save_notion_db_info` to create a new blob (and replace an existing one if exists).
18

connect4_sitemain.tsx1 match

@saolsen•Updated 1 year ago
1058// There are concurrency issues with this, turns could get
1059// evaluated twice and overwrite each other, but future steve
1060// can handle that with a real database.
1061app.post("/matches/:match_id/agent_turn", async (c) => {
1062 const parsed_id = MatchId.safeParse(c.req.param("match_id"));

redisREADME.md1 match

@saolsen•Updated 1 year ago
3Creates a global redis instance and exposes functions to use it.
4
5To use, create a redis database on [Upstash](https://upstash.com/) and set the environment variables.
6* `UPSTASH_REDIS_REST_URL`
7* `UPSTASH_REDIS_REST_TOKEN`

add_to_notion_from_todoistmain.tsx5 matches

@nerdymomocat•Updated 1 year ago
20 "papers": {
21 "todoist-section-id": "SECTION_ID_HERE",
22 "notion-map-type": "database",
23 "notion-id": "DB_ID_HERE",
24 },
102}
103
104async function addPageToNotionDatabse(database_id, content) {
105 const response = await notion.pages.create({
106 "parent": {
107 "type": "database_id",
108 "database_id": database_id,
109 },
110 "properties": {
133 addCalloutToNotionPage(mappedNotionId, task.content, convertDateObject(task.due));
134 }
135 else if (mappedNotionType == "database" && mappedNotionId) {
136 addPageToNotionDatabse(mappedNotionId, task.content);
137 }

add_to_notion_from_todoistREADME.md1 match

@nerdymomocat•Updated 1 year ago
1Use todoist for quick notes to add to notion. Uses project to decide which project to fetch to add stuff to notion. Can add to page or database based on config below. Demarkation using sections in the todoist project. Extracts date for page blocks that are added as callouts.
2
3Migrated from folder: Public/add_to_notion_from_todoist

notion_paperpile_detail_fillermain.tsx5 matches

@nerdymomocat•Updated 1 year ago
8
9 if (!NOTION_API_KEY || !PAPERPILE_DB_ID) {
10 throw new Error("Please fill in your API key and database ID");
11 }
12 let dont_update = [];
14 const notion = new Client({ auth: NOTION_API_KEY });
15
16 const databaseId = PAPERPILE_DB_ID;
17
18 const queryResponse = await notion.databases.query({
19 database_id: databaseId,
20 page_size: 100,
21 filter: {
35
36 console.log(
37 `Checked database, found ${relevant_results.length} items to update.`,
38 );
39

dateMeNotionDatabasemain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { notionGetDatabase } from "https://esm.town/v/stevekrouse/notionGetDatabase";
2import process from "node:process";
3
4export let dateMeNotionDatabase = notionGetDatabase({
5 databaseId: "725cb1d741674413b933a37a50f1961f",
6 auth: process.env.notion,
7});

dateme_sqliteREADME.md2 matches

@stevekrouse•Updated 1 year ago
2
3```ts
4import { setupDatabase } from "https://esm.town/v/stevekrouse/dateme_sqlite"
5
6await setupDatabase()
7```
8

cacheREADME.md1 match

@xkonti•Updated 1 year ago
1Implementation of Redis-like cache - a key-value store with expiring keys. Data is stored in the Val Town SQLite database and shared between all your vals.
2
3# Setup

untitled_oliveLoonREADME.md1 match

@serna•Updated 1 year ago
7It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
8
9To use it on your own Val Town SQLite database, [fork it](https://www.val.town/v/stevekrouse/sqlite_admin/fork) to your account.
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago