Skip to content

Instantly share code, notes, and snippets.

@knosey
knosey / testRegex.js
Created August 29, 2024 13:33
Regex for chunking by using all semantic cues
// Updated: Aug. 20, 2024
// Run: node testRegex.js whatever.txt
// Live demo: https://jina.ai/tokenizer
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
// COPYRIGHT: Jina AI
const fs = require('fs');
const util = require('util');
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 7;
@knosey
knosey / claude_3.5_sonnet_artifacts.xml
Created July 18, 2024 08:06 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
@knosey
knosey / notion_burndown.py
Last active November 20, 2023 18:49
Notion API burndown chart
"""
Set up the Notion API: You'll need an integration token from Notion and permissions to access the relevant database.
Access the Tickets Database: Use the Notion API to access your tickets database.
Filter Tickets: Apply filters to select tickets that are being worked on this week.
Track Progress: Determine the progress of each ticket to use in the burndown chart.
Generate a Burndown Chart: Use a charting library like matplotlib to create the burndown chart.