Skip to content

Instantly share code, notes, and snippets.

View rjurney's full-sized avatar

Russell Jurney rjurney

View GitHub Profile
@rjurney
rjurney / article.baml
Last active July 31, 2025 05:58
BAML Schema for Information Extraction of Companies from News
class NewsArticle {
title string
url string?
@description("URL of the article")
summary string
@description("Summary of the article. What is it about? What are the key points?")
@rjurney
rjurney / results.txt
Created July 17, 2025 11:49
pyspark --packages graphframes:graphframes:0.9.0-spark3.5-s_2.12
Python 3.12.9 | packaged by conda-forge | (main, Mar 4 2025, 22:44:42) [Clang 18.1.8 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 9.0.2 -- An enhanced Interactive Python. Type '?' for help.
Tip: Use `--theme`, or the `%colors` magic to change ipython themes and colors.
25/07/17 21:48:25 WARN Utils: Your hostname, Achilles-3.local resolves to a loopback address: 127.0.0.1; using 10.26.184.245 instead (on interface en0)
25/07/17 21:48:25 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address
:: loading settings :: url = jar:file:/Users/rjurney/Software/spark/assembly/target/scala-2.12/jars/ivy-2.5.1.jar!/org/apache/ivy/core/settings/ivysettings.xml
Ivy Default Cache set to: /Users/rjurney/.ivy2/cache
The jars for the packages stored in: /Users/rjurney/.ivy2/jars
graphframes#graphframes added as a dependency
@rjurney
rjurney / CLAUDE.md
Created June 16, 2025 15:03
Example of a `CLAUDE.md` file to tune Claude Code's performance. Refer to it to create your own `CLAUDE.md`

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Commands

  • Install Dependencies: poetry install
  • Run CLI: poetry run abzu
  • Build/Generate abzu/baml_client code: baml-cli generate
  • Test baml_src code: baml-cli test, poetry run pytest tests/
@rjurney
rjurney / loss.py
Created June 13, 2025 02:05
We all contrastive experience loss at some point in our lives, but which one for your problem and with what hyperparameters?
# This will effectively train the embedding model. MultipleNegativesRankingLoss did not work.
loss: losses.ContrastiveLoss = losses.ContrastiveLoss(model=sbert_model)
# These are default arguments for OnlineContrastiveLoss
loss: losses.OnlineContrastiveLoss = losses.OnlineContrastiveLoss(
model=sbert_model,
margin=0.5, # Margin for contrastive loss
distance_metric=SiameseDistanceMetric.COSINE_DISTANCE,
)
@rjurney
rjurney / CLAUDE.md
Created June 3, 2025 16:22
My `CLAUDE.md`, command and allows-tools setup - note that everything has a CLI :) Why not?

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Commands

  • Install Dependencies: poetry install
  • Run CLI: poetry run abzu
  • Build/Generate abzu/baml_client code: baml-cli generate
  • Test baml_src code: baml-cli test, poetry run pytest tests/
@rjurney
rjurney / technical_analysis.md
Created June 1, 2025 04:51
Claude 4 Opus created a technical analysis agent given a DataFrame of tick data for an equity

I'll show you how to structure data and prompts for effective technical analysis with LLMs. Here's a comprehensive approach:

1. Data Preparation Structure

import pandas as pd
import numpy as np
from typing import Dict, List, Tuple

def prepare_ta_data(df: pd.DataFrame) -> pd.DataFrame:
@rjurney
rjurney / click_conversion_guide.md
Created May 14, 2025 21:29
Click code conversion guide Markdown for Claude Code to use in making CLIs

Click Conversion Guide for Abzu CLI

This document serves as a guide for converting the existing argparse-based CLI to use Click.

Key Click Features to Leverage

  1. Decorator-based Command Pattern
    • Use @click.command() and @click.group() decorators
    • Replace manual subparser creation with nested command groups
@rjurney
rjurney / .claude_slash_settings.json
Created May 13, 2025 21:08
Current Claude Code Configuration
{
"permissions": {
"allow": [
"Bash(git status:*)",
"Bash(git diff:*)",
"Bash(git log:*)",
"Bash(git add:*)",
"Bash(git grep:*)",
"Bash(poetry update:*)",
"Bash(pip show:*)",
@rjurney
rjurney / .claude_slash_settings.json
Last active May 8, 2025 17:05
My current CLAUDE.md file, always a work in progress...
{
"permissions": {
"allow": [
"Bash(git status:*)",
"Bash(git diff:*)",
"Bash(git log:*)",
"Bash(poetry update:*)",
"Bash(pip show:*)",
"Bash(pip freeze:*)",
"Bash(pip list:*)",
@rjurney
rjurney / parse.py
Created April 23, 2025 05:25
Parse JSONIsh brackets
class Solution:
openers = ["(", "{", "["]
closers = [")", "}", "]"]
valid = openers + closers
def __init__(self):
self.stack = []
def push(self, x):
self.stack.append(x)