Skip to content

Instantly share code, notes, and snippets.

Implement an Anthropic OAuth CLI and Populate ~/.claude/.credentials.json

This gist shows how to implement your own OAuth workflow so your tool can acquire Anthropic OAuth tokens and write them in the format the Claude Code SDK expects at ~/.claude/.credentials.json.

Notes

  • Uses an Authorization Code + PKCE flow via https://claude.ai/oauth/authorize and token exchange at https://console.anthropic.com/v1/oauth/token.
  • Default client id commonly used by tools: 9d1c250a-e61b-44d9-88ed-5944d1962f5e (override with your own if issued).
  • The authorize endpoint supports a copy/paste mode (no local server). Your CLI opens/prints a URL; the user pastes a code back.
  • Treat tokens as secrets; never log them.
@BlazerYoo
BlazerYoo / ece451_script.md
Last active April 22, 2026 17:34
ece451 presentation script

ECE 451 — Final Project Presentation Script

Self-Powered Epicardial Bioelectronic Patch: Mechanical-First Closed-Loop Therapy for Heart Failure and Arrhythmia Management

Sydney Bold & Boaz Yoo · Target: 12 minutes + 3 min Q&A


How to use this script

# CITATION: https://scikit-learn.org/stable/modules/permutation_importance.html#permutation-importance
# CITATION: https://scikit-learn.org/stable/modules/generated/sklearn.inspection.permutation_importance.html
from sklearn.inspection import permutation_importance
models = {
'Nearest Neighbors': knn,
'Naive Bayes': nb,
'Logistic Regression': log_reg,
'Support Vector Machines': svm,
'Decision Tree': dt,
╭─── Claude Code v2.1.12 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │ Tips for getting started │
│ Welcome back Jonny! │ Run /init to create a CLAUDE.md file with instructions for Claude │
│ │ │
│ │ ───────────────────────────────────────────────────────────────── │
│ ▐▛███▜▌ │ Recent activity
@BlazerYoo
BlazerYoo / crouton.md
Created October 14, 2025 19:06 — forked from tgirke/crouton.md
Crouton
chronos@localhost ~/Downloads $ sudo sh crouton -r xenial -t unity
Installing xenial-amd64 chroot to /usr/local/chroots/xenial
Downloading bootstrap files...
debootstrap error log:
[.[] | select((.extendedSupport // .support) > (now | strftime("%Y-%m-%d")) and (.codename | test($suite; "i")))] | isempty(.[]) | not error: strftime is not defined
[.[] | select((.extendedSupport // .support) > (now | strftime("%Y-%m-%d")) and (.codename | test($suite; "i")))] | isempty(.[]) | not error: test is not defined
[.[] | select((.extendedSupport // .support) > (now | strftime("%Y-%m-%d")) and (.codename | test($suite; "i")))] | isempty(.[]) | not 4 compile errors
Failed to run debootstrap.
@BlazerYoo
BlazerYoo / introduce.py
Last active September 24, 2025 13:46
sml312 import demo
"""
SML312 import demo
"""
def introduceFunctionThatIWrote(name="SML", age="312"):
print(f'Hello! My name is {name} and I am {age} years old!')
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("notnate/Llama-3.1-8B-Instruct-blockchain")
model = AutoModelForCausalLM.from_pretrained("notnate/Llama-3.1-8B-Instruct-blockchain")
# Define the prompt
prompt = "Explain how blockchain works in simple terms."
# Tokenize the prompt
@BlazerYoo
BlazerYoo / install_docker_in_colab.sh
Created October 27, 2024 01:38 — forked from mwufi/install_docker_in_colab.sh
Install Docker in Google Colab!
# First let's update all the packages to the latest ones with the following command
sudo apt update -qq
# Now we want to install some prerequisite packages which will let us use HTTPS over apt
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq
# After that we will add the GPG key for the official Docker repository to the system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# We will add the Docker repository to our APT sources
@BlazerYoo
BlazerYoo / mae345-setup.sh
Created September 24, 2024 15:32
Setting up python environment for cfclient
# 1. Intall homebrew if now already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 2. Install pyenv if not already installed
brew install pyenv
# 3. Add pyenv to shell start up
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"