Skip to content

Instantly share code, notes, and snippets.

View brenorb's full-sized avatar

Breno brenorb

View GitHub Profile
@brenorb
brenorb / README.md
Created March 26, 2026 14:52
macOS launchd daily catch-up template with persisted state and RunAtLoad fallback

Launchd Daily Catch-Up Template

This is a small template for the common macOS pattern:

  • run a task every night at a fixed local time
  • if the Mac was asleep, run on wake
  • if the Mac was off and later boots/logs in, run once as catch-up
  • avoid custom hourly cron polling

What Is In Here

@brenorb
brenorb / executable_uv_weather.py
Last active September 3, 2025 23:03
self contained executable python script example
#!/usr/bin/env -S uv run --script --python 3.12.3
# /// script
# dependencies = ['httpx', 'rich']
# ///
# To make it executable: chmod +x executable_uv_weather.py
import httpx, rich
print(httpx.get("https://wttr.in/?format=3").text)
import os
import dspy
from dotenv import load_dotenv
load_dotenv()
# Configure OpenAI API key
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY")
lm = dspy.LM(model="openai/gpt-4o-mini", model_type="chat")
@brenorb
brenorb / ruff.toml
Created February 4, 2025 20:40
Ruff configuration for ignoring warnings on `import *`
[tool.ruff]
line-length = 88
indent-width = 4
target-version = "py39"
ignore = ["F403", "F405"] # Ignore wildcard import warnings
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
@brenorb
brenorb / privacy_policy_sos.md
Created November 25, 2023 02:32
Privacy Policy for the Spirit of Satoshi GPT

Privacy Policy for the Spirit of Satoshi GPT

Last Updated: 2023-11-24

The Spirit of Satoshi GPT ("Spirit of Satoshi," "we," "us," or "our") is committed to respecting your privacy and ensuring the security of your information. This Privacy Policy outlines how we handle information when you interact with our GPT model.

  1. Information Usage

When you use the Spirit of Satoshi GPT, we may collect and process the text inputs and queries you provide. This information may be temporarily routed through our private servers to enhance the quality of the GPT responses and help identify the best contexts for your queries.

@brenorb
brenorb / tags.py
Created June 3, 2021 20:24
🏷️ Display all unique HMTL Tags from file
# How to use it
# > python -m tag html_file
# {'tag', 'other_tag', ...}
from bs4 import BeautifulSoup
import sys
file = sys.argv[1]
@brenorb
brenorb / optimal_portfolio.py
Created May 30, 2020 16:25
Making a graph of optimal portfolio
import pandas as pd, numpy as np
import yfinance as yf
import datetime as dt
import re
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
plt.rcParams['figure.figsize'] = [10,6]
plt.rcParams["font.weight"] = "bold"
plt.rcParams["axes.labelweight"] = "bold"
@brenorb
brenorb / emoji_cheatsheet.md
Last active January 6, 2025 16:49 — forked from roachhd/README.md
😛 📑 EMOJI cheatsheet

Emoji Cheatsheet

People

:bowtie: - :bowtie: 😄 - :smile: 😆 - :laughing: 😊 - :blush:

@brenorb
brenorb / get_print.py
Created June 13, 2019 21:22
Simple way to keep track of results printed but not returned
# from https://www.kaggle.com/kmader/july-24-micro-challenge
from contextlib import redirect_stdout
from io import StringIO
def simulate_game(verbose=False):
out_buffer = StringIO()
with redirect_stdout(out_buffer):
blackjack.simulate_one_game()
out_str = out_buffer.getvalue()
if verbose:
@brenorb
brenorb / tweet_dumper.py
Last active December 1, 2025 01:04 — forked from yanofsky/LICENSE
A Python 3.+ script to download all of a user's tweets into a csv.
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""