Skip to content

Instantly share code, notes, and snippets.

View harperreed's full-sized avatar

Harper Reed harperreed

View GitHub Profile
@harperreed
harperreed / peter-thiels-cs183-startup-class-01-notes-essay.md
Created July 29, 2012 21:20
Notes Essays—Peter Thiel’s CS183: Startup—Stanford, Spring 2012

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

@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.
{

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 \

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 / If-you-can.md
Created January 8, 2016 21:01
If You Can - How Millennials Can Get Rich Slowly
@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 / OAuthGspread.py
Created September 23, 2014 19:29
easily use access token and refresh token with gspread
import gspread
from oauth2client.client import OAuth2Credentials
import datetime
import requests
class OAuthGspread:
scope = ['https://spreadsheets.google.com/feeds', 'https://docs.google.com/feeds']
def __init__(self, client_id, client_secret, access_token, refresh_token, ):
@harperreed
harperreed / resume.json
Created August 15, 2023 19:50
resume.json
{
"basics": {
"name": "Harper Reed",
"email": "harper@nata2.org",
"image": "https://harperreed.com/avatar",
"profiles": [
{
"network": "twitter",
"username": "harper",
"url": "https://twitter.com/harper"