Skip to content

Instantly share code, notes, and snippets.

View leafstrat's full-sized avatar

Justin leafstrat

View GitHub Profile
@shikaan
shikaan / bash-gpt.bash
Last active February 26, 2024 05:43
bash GPT
#!/bin/bash
OPENAI_API_KEY="YOUR_API_KEY"
CONVERSATION="/tmp/$(cat /proc/sys/kernel/random/uuid)"
query_open_ai() {
curl -s https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d "{
@dannguyen
dannguyen / shakespeare-ngrams-cli-ack.md
Last active May 30, 2023 16:04
How to tokenize and create n-grams in Shakespeare from the command-line

Creating Shakespearean n-grams with just the command-line and regexes

This is a quick example showing how to use regexes to find tri-grams in Shakespeare...well, 570,872 of them, anyway, if we do some basic filtering of non-dialogue.

Though tokenization and n-grams should typically be done using a proper natural language processing framework, it's possible to do in a jiffy from the command-line, using standard Unix tools and ack, the better-than-grep utility.

What are n-grams?

@dwayne
dwayne / 0-intro.md
Last active February 28, 2023 22:10
My notes from the book "Authority by Nathan Barry".

A Step-By-Step Guide To Self-Publishing

Become an expert, build a following, and gain financial independence.

by Nathan Barry

Table of Contents