Skip to content

Instantly share code, notes, and snippets.

View blakeNaccarato's full-sized avatar

Blake Naccarato blakeNaccarato

View GitHub Profile
@blakeNaccarato
blakeNaccarato / $ MacOS Python setup.md
Last active August 24, 2025 01:03
MacOS Python setup

Python project setup on MacOS

Here are two ways to set up a Mac for Python projects, assuming VSCode is already installed. The "new way" is much easier, but you may not have access to uv for some reason, so the "old way" is also shown.

The new way

Install uv.

curl -LsSf https://astral.sh/uv/install.sh | sh
@blakeNaccarato
blakeNaccarato / $ Insert sparkline row at top of DataFrames to preview time series in Data Wrangler.md
Last active June 13, 2025 17:33
Insert sparkline row at top of DataFrames to preview time series in Data Wrangler

The Data Wrangler VSCode extension column summaries can show a histogram of the distribution of data in a column, but this summary is not particularly useful for time series data like sensor signals.

  • If not installed, install the Data Wrangler VSCode extension
  • If sparklines is not installed in the environment to be used by Data Wrangler, use e.g. uv to add the sparklines package to the project's dev dependency group
uv add --dev sparklines
  • Open a data file, e.g. a CSV in VSCode and click the "Open in Data Wrangler" button in the tab ribbon
@blakeNaccarato
blakeNaccarato / $ Change the sheets 'Regularly' with SQLModel and XLWings.md
Created May 8, 2025 18:19
Two-way interactions between an Excel spreadsheet and a SQLite database exported from the Regularly Android app, enabling synchronization and updating of chores in the app.

Change the sheets 'Regularly' with SQLModel and XLWings

This Gist features two-way interactions between an Excel spreadsheet and a SQLite database exported from the Regularly Android app (APK available from other sources), enabling synchronization and updating of chores in the app. This writeup goes in a few different directions, so feel free to poke around:

  • The usage guide is brief, but links to more details for all skill levels.
  • Jump into changing the sheets for a tour of the kind of end-user code that carefully-prepared SQLModel models facilitate.
  • See behind the scenes in the database model deep dive, powered by SQLModel, with special handling of quirks and gotchas.
  • See the Excel and CSV data models for data model philosophy, and a few cool features:
    • A `Datac
@blakeNaccarato
blakeNaccarato / # VSCode Data Wrangler setup.md
Last active May 8, 2025 18:16
VSCode Data Wrangler setup

VSCode Data Wrangler setup

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  • Create a folder e.g. hello_world
@blakeNaccarato
blakeNaccarato / $ Windows Sunshine-Moonlight monitor config scripts and guide.md
Last active August 6, 2025 22:07
Windows Sunshine/Moonlight monitor config scripts and guide

Windows Sunshine/Moonlight monitor config

Scripts and guide to automatic monitor configuration when streaming with Sunshine/Moonlight on Windows.

  • Click "Download ZIP" in the top-right corner of this Gist, and extract scripts to e.g. C:/ (or a directory of your choosing)
  • Download MultiMonitorTool
  • Place scripts and MultiMonitorTool.exe in a directory next to your scripts, or add the tool to your system $PATH
  • Modify your Sunshine "Do command" and "Undo command"
@blakeNaccarato
blakeNaccarato / README.md
Last active March 27, 2025 18:58
My contributions in selected PRs, issues, and discussions

My contributions in selected PRs, issues, and discussions

Selected contributions:

@blakeNaccarato
blakeNaccarato / omnivore-acquisition.md
Last active November 8, 2024 14:24
Omnivore acquisition

Omnivore acquisition (2024-10-29T06-47-27)

@blakeNaccarato
blakeNaccarato / test.ipynb
Last active September 25, 2024 22:51
Integer slice selection in `xarray`
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blakeNaccarato
blakeNaccarato / $README.md
Last active September 25, 2024 19:08
Isolated script for syncing `.env` with e.g. a `tool.my_tool.env` table in `pyproject.toml`

Isolated script for syncing .env with e.g. a tool.my_tool.env table in pyproject.toml.

Download env.py to your project directory containing a pyproject.toml with a table named tool.dev.env and use uv run this tool in an isolated environment.

uv run env.py

Or you can invoke the script directly from a pinned commit revision of this Gist on Windows,

@blakeNaccarato
blakeNaccarato / fit.py
Created July 26, 2024 16:29
Fitting experimental data to model functions using `scipy.optimize.curve_fit`
"""Get fits and errors."""
from functools import partial
from warnings import catch_warnings
from numpy import array, diagonal, full, inf, isinf, linspace, nan, sqrt, where
from scipy.optimize import OptimizeWarning, curve_fit
from scipy.stats import t
# Docs: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html