Skip to content

Instantly share code, notes, and snippets.

@itobey
itobey / openai-chunky-boy.py
Created June 26, 2023 18:27
script to summarize a textfile chunked in openai
import openai
# Set up your OpenAI API credentials
openai.api_key = '<apikey>'
# Function to chunk text into parts of `max_tokens` tokens
def chunk_text(text, max_tokens):
tokens = text.split()
chunks = []
current_chunk = ""
@itobey
itobey / instructions.md
Last active May 29, 2021 09:51 — forked from bitoiu/self-signed-wildcard-cert-for-ghes.md
Self-Signed Wildcard certificate with SAN using openssl / SSL

Copy the default template of openssl.cnf to a writable location.

cp /usr/lib/ssl/openssl.cnf .

Uncomment the req_extensions = v3_req

req_extensions = v3_req # The extensions to add to a certificate request

Add subjectAltName to v3_req section

@itobey
itobey / html-toc.js
Last active August 18, 2020 14:04 — forked from simov/html-toc.js
Generate Table of Contents (TOC) for Dillinger Styled HTML export
// extract all headers
var headers = []
function walk (nodes) {
nodes.forEach((node) => {
var sub = Array.from(node.childNodes)
if (sub.length) {
walk(sub)
}