Skip to content

Instantly share code, notes, and snippets.

View shaneholloman's full-sized avatar

Shane Holloman shaneholloman

  • Cello Ltd
  • Wellington, NZ
  • 03:43 (UTC +12:00)
View GitHub Profile
Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches.
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed.
Use <count> tags after each step to show the remaining budget. Stop when reaching 0.
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress.
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process.
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach:
0.8+: Continue current approach
0.5-0.7: Consider minor adjustments
Below 0.5: Seriously consider backtracking and trying a different approach
Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output.
- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure.
- Reasoning Before Conclusions: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS!
- Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed.
- Conclusion, classifications, or results should ALWAYS appear last.
- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements.
- What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from p
@shaneholloman
shaneholloman / document_intelligence.py
Created August 17, 2024 14:57 — forked from daveebbelaar/document_intelligence.py
A service class for interacting with Azure Document Intelligence API.
import logging
import requests
import time
from typing import Union, Dict
from config.settings import get_settings
class DocumentIntelligenceService:
"""
A service class for interacting with Azure Document Intelligence API.
@shaneholloman
shaneholloman / llm_factory.py
Created August 17, 2024 14:46 — forked from daveebbelaar/llm_factory.py
LLM Factory with Instructor
from typing import Any, Dict, List, Type
import instructor
from anthropic import Anthropic
from config.settings import get_settings
from openai import OpenAI
from pydantic import BaseModel, Field
class LLMFactory:
@shaneholloman
shaneholloman / chunking-regex.ts
Created August 15, 2024 10:52 — forked from hanxiao/testRegex.js
Use regex to do chunking by using all semantic cues
// Used in https://jina.ai/tokenizer (Aug. 14th version)
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 6;
const MAX_HEADING_CONTENT_LENGTH = 200;
const MAX_HEADING_UNDERLINE_LENGTH = 200;
const MAX_HTML_HEADING_ATTRIBUTES_LENGTH = 100;
const MAX_LIST_ITEM_LENGTH = 200;
const MAX_NESTED_LIST_ITEMS = 5;
const MAX_LIST_INDENT_SPACES = 7;
const MAX_BLOCKQUOTE_LINE_LENGTH = 200;
@shaneholloman
shaneholloman / pbpaste-pbcopy-ubuntu.md
Last active October 1, 2024 04:09 — forked from diegopacheco/pbpaste-pbcopy-ubuntu.md
pbpaste && pbcopy for Ubuntu Linux 20.04

Install

sudo apt-get install xclip -y

Create Alias

alias pbcopy='xclip -selection clipboard'
<#
.EXAMPLE
llm "what is the capital of spain" -provider openai
.EXAMPLE
llm "what is the capital of spain" -provider anthropic
.EXAMPLE
llm "what is the capital of spain" -provider gemini
#>
@shaneholloman
shaneholloman / Appx-Uninstaller.ps1
Last active October 1, 2024 04:12 — forked from ThioJoe/Appx-Uninstaller.ps1
A basic script for uninstalling a list of app packages in Windows 10/11, including those pre-installed with Windows
# A basic script for uninstalling app packages in Windows 10/11, including those pre-installed with Windows
#
# Note: If you get an error about the script not being allowed to run, the below command will change the execution polciy temporarily for one session only:
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
#
# To execute the script, open a Powershell window to the directory with the script and run the following command using your scripts file name (and don't forget the .\ )
# .\WhateverScriptName.ps1
# -------------------------------------------------------------------------------------------
# Script by ThioJoe - https://github.com/ThioJoe
@shaneholloman
shaneholloman / bookmarks-to-notion.js
Created March 9, 2024 12:50 — forked from unrevised6419/bookmarks-to-notion.js
Export bookmarks to Notion as a Database
(function bookmarksExportToCsv() {
/**
* 1. Export bookmarks from browser (supported any Chromium based browsers and Safari) (chrome://bookmarks)
* 2. Open exported html file again in the browser
* 3. Copy paste this entire file in console, and execute it (hit enter)
* 4. You will be prompted to save a CSV file. Save it.
* 5. Open Notion. Click Import -> CSV
* 6. Select saved CSV file. Wait for import
* 7. You have a new database with all your bookmarks
*/
@shaneholloman
shaneholloman / mtr.sh
Last active February 24, 2024 01:11 — forked from ThinGuy/mtr.sh
Test all nics using mtr (my traceroute)
#!/bin/bash
mtrv4() {
[[ -z ${1} || ${1} =~ -h ]] && {
printf "Usage: %s <hostname|IP>\n" "${FUNCNAME[0]}" 1>&2
return 2
}
for i in $(ip -o -4 a | awk '{if ($2 != "lo") print $2}' | paste -sd' '); do mtr -4 -rw -c 5 -I "${i}" "${1}"; done
}
export -f mtrv4