Skip to content

Instantly share code, notes, and snippets.

View harperreed's full-sized avatar

Harper Reed harperreed

View GitHub Profile

LLM Commit messages for git

  1. Install llm

  2. Create a new directory for your global Git hooks. For example, you can create a directory named git_hooks in your home directory:

mkdir -p ~/.git_hooks
@harperreed
harperreed / .gitconfig
Last active March 10, 2024 18:35
.gitconfig llm command
llm = "!f() { \
if git diff --quiet $1; then \
echo \"No changes to commit. Aborting.\"; \
else \
commit_msg=$(git diff $1 | llm -s \"$(cat ~/.config/prompts/commit-system-prompt.txt)\"); \
echo \"Commit message:\n$commit_msg\"; \
read -p \"Do you want to commit with this message? [y/N] \" confirm; \
if [[ $confirm =~ ^[Yy]$ ]]; then \
git commit -m \"$commit_msg\"; \
else \
@harperreed
harperreed / prompt.txt
Created March 10, 2024 15:58
security robot prompt
You are a security robot. Your job is to observe and report any activity. Specifically, notice the people and what they are doing.
Context:
This is the front of an office space
People enter and exit from the office via the red door
There is aa couch and some chairs that people may be sitting on. There is also a snack area, and an area with equipment. right of the image.
Return JSON.
{

Photo Organizer Script Description

YMMV

Overview

This script organizes photos into albums based on trip data from a JSON file.

Features

  • Data Loading: Reads trip data from 'trips.json' which is assumed to be a dump of the tripit past trips api.
@harperreed
harperreed / chain_summarization.py
Created September 16, 2023 03:16
Chain of Density Summarization
# Import required packages
from dotenv import load_dotenv # For managing environment variables
from html2text import html2text # For HTML to markdown conversion
from readability import Document # For summarizing HTML content
from typing import List # For type hinting
import json # For JSON parsing
import logging # For logging errors
import openai # OpenAI GPT API
import os # For OS-level operations
import requests # For HTTP requests
@harperreed
harperreed / resume.json
Last active September 10, 2024 00:13
resume.json
{
"basics": {
"name": "Harper Reed",
"email": "harper+resume@modest.com",
"image": "https://harperreed.com/avatar",
"profiles": [
{
"network": "twitter",
"username": "harper",
"url": "https://X.com/harper"
import json
import zipfile
import os
import html2markdown
from pathlib import Path
from datetime import datetime
source = 'notes.zip'
with zipfile.ZipFile(source, 'r') as zip_ref:
You are going to pretend to be Concept2PromptAI or C2P_AI for short. C2P_AI takes concepts and turns them into prompts for generative AIs that create images.
You will ask the user for a concept then provide a prompt for it in a copyable code-box.
After providing a prompt, ask if the User wants three different options for prompts for the concept or if they wish to move to a new concept.
Use the following examples as a guide:
Concept: A macro shot of a steampunk insect
@harperreed
harperreed / lsusb-v-osx.txt
Last active April 12, 2022 15:50
OPAL Camera USB debug info
Opal C1:
Product ID: 0xf63b
Vendor ID: 0x03e7
Version: 2.00
Serial Number: 14442C10E19093D700
Speed: Up to 5 Gb/s
Manufacturer: Opal
Location ID: 0x02200000 / 1
Current Available (mA): 900

Hifi Digital MP3 Home

Software / Services / products:

  • Roon - very nice interface / hifi / good DSP - expensive
    • works with many audio endpoints (sonos, roon ready hardware, raspberry pis, etc)
    • High quality
  • Volumio - music player for raspberry pi, etc / multi room support and ripping support