Skip to content

Instantly share code, notes, and snippets.

View blakeNaccarato's full-sized avatar

Blake Naccarato blakeNaccarato

View GitHub Profile
@blakeNaccarato
blakeNaccarato / Set-PrimaryMonitor.ps1
Last active April 6, 2025 21:53
Monitor setup for Sunshine/Moonlight streaming
<#.SYNOPSIS
Set primary monitor resolution and scaling. Optionally move/maximize windows.
#>
Param(
# Path to MultiMonitorTool.exe (https://www.nirsoft.net/utils/multi_monitor_tool.html)
[Parameter(Mandatory)][string]$Tool,
# Primary monitor width
[int]$Width,
# Primary monitor height
@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
@blakeNaccarato
blakeNaccarato / disableCortanaAndWebSearch.reg
Created June 18, 2024 04:27
Disabling Cortana and web search in Windows 11, worked as recently as March 2024
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search]
"CortanaConsent"=dword:00000000
"AllowSearchToUseLocation"=dword:00000000
"BingSearchEnabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]
"ConnectedSearchUseWebOverMeteredConnections"=dword:00000000
"AllowCortana"=dword:00000000
@blakeNaccarato
blakeNaccarato / Sync-Py.ps1
Last active March 19, 2024 04:28
Cross-platform PowerShell script (tested on Windows, Ubuntu, MacOS) to sync a Python environment with `uv`, example for `requirements.txt`, `pyproject.toml` is similar.
<#.SYNOPSIS
Sync Python dependencies.#>
Param(
# Python version.
[string]$Version = '3.11'
)
$REQUIREMENTS = 'requirements.txt'
function Sync-Py {
@blakeNaccarato
blakeNaccarato / $process-ctherm-tci-data.md
Last active March 19, 2024 04:09
Process data exported from the C-Therm TCi thermal conductivity analyzer.

Process data exported from the C-Therm TCi thermal conductivity analyzer.

Usage

If you already have Python 3.11 and the Python launcher installed on Windows/Linux/MacOS, you may run process_data.py with pipx by first downloading it (or copy/pasting its contents into a locally-saved script) and running e.g.

py -3.11 -m pipx run process_data.py
@blakeNaccarato
blakeNaccarato / Matlab and Python notes.md
Last active January 22, 2024 19:09
Notes on actually calling Python from within Matlab, Matlab from within VSCode Jupyter notebooks, and version control of Matlab project folders with Git.

Matlab and Python notes

Notes on actually calling Python from within Matlab, Matlab from within VSCode Jupyter notebooks, and version control of Matlab project folders with Git. These are hastily scribbled notes, not transformed into anything cohesive quite yet.