1I track how much time I work in a week in a note. This function takes that unstructured format and calculates how much time I work each day and week.
2
3The input looks like:
7const DISCORD_WEBSOCKET_URL = process.env.DISCORD_WEBSOCKET_URL;
8
9export default async function(interval: Interval) {
10 if (!STEAM_WEB_API_KEY || !STEAM_ID || !DISCORD_WEBSOCKET_URL) {
11 throw new Error("STEAM_WEB_API_KEY, STEAM_ID or DISCORD_WEBSOCKET_URL not set");
3import { json2csv } from "npm:json-2-csv";
4
5export default async function(interval: Interval) {
6 const complete_ownedGames = await db.select().from(ownedGames).all();
7
1import { valtownToSQLite } from "https://esm.town/v/pomdtr/valTownToSQLite";
2
3export default async function(interval: Interval) {
4 await valtownToSQLite();
5}
1import { valtownToSQLite } from "https://esm.town/v/pomdtr/valTownToSQLite";
2
3export default async function(interval: Interval) {
4 await valtownToSQLite();
5}
1import { makeRandomId } from "https://esm.town/v/olibooty/goldOwl";
2
3export default async function(req: Request): Promise<Response> {
4 const searchParams = new URL(req.url).searchParams;
5 const radix = searchParams.get("radix");
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
4const tabs = { "/": "Home", "/browse": "Browse", "/faq": "FAQ" };
5
6export default function({ activeTab, children }: PropsWithChildren<{ activeTab: string }>) {
7 return (
8 <html>
1# Text Chunk Processor
2
3This JavaScript function processes long text inputs by breaking them into smaller chunks, applying a custom processing function to each chunk, and optionally handling overlaps between chunks.
4
5## Function Signature
6
7```javascript
12
13- `inputText` (string): The long input text to be processed.
14- `processFn` (function, optional): A function to process each chunk. Defaults to logging the chunk.
15- `config` (object, optional): Configuration options.
16
44## Notes
45
46- If `processFn` is not provided, the function will log each chunk and return the original text.
47- If `processFn` returns a value, these values will be collected in an array and returned.
48- If `processFn` doesn't return anything, the original input text is returned.
125});
126
127async function getToken(c) {
128 const state = c.req.query("state") as string;
129 const authData = await db.select().from(table).where(eq(table.id, state)).limit(1);
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",