Skip to content

Instantly share code, notes, and snippets.

@milnak
milnak / GetSavedSibeliusVersion.ps1
Last active December 1, 2025 03:11
Get Sibelius Version of SIB file
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]$Path
)
$fileStream = [IO.File]::OpenRead($Path)
$buffer = New-Object byte[] 16
$bytesRead = $fileStream.Read($buffer, 0, $buffer.Count)
$fileStream.Close()
@milnak
milnak / Format-GitConfig.ps1
Created November 10, 2025 01:27
Pretty print Git configuration
<#
.DESCRIPTION
Formats and outputs the Git configuration in a structured manner.
.EXAMPLE
.\Format-GitConfig.ps1
Outputs the Git configuration grouped by sections and sorted.
#>
$config = foreach ($line in git.exe --no-pager config --global --list | Sort-Object -Unique) {
if ($line -match '^\s*(?<section>\w*)\.(?<subsection>\w*)\.(?<key>\w*)\s*=\s*(?<value>.+)') {
# e.g. difftool.winmerge.name=WinMerge
@milnak
milnak / gitdown.ps1
Created September 24, 2025 23:25
Recursive github repo downloader
# Create a new API token by going to
# https://github.com/settings/tokens/new (provide a description and check "repo" scope")
param (
# github repo path to download, e.g.
# 'https://github.com/microsoft/CsWinRT/tree/master/src/Samples/NetProjectionSample'
[Uri]$RepoPath = 'https://github.com/microsoft/CsWinRT/tree/master/src/Samples/NetProjectionSample',
# Folder to download to.
[Parameter(Mandatory)][string]$Path,
@milnak
milnak / reddit-personal-finance-flowchart-us.md
Created September 22, 2025 00:52
Reddit Personal Finance Flowchart

Reddit /r/personalfinance Flow Chart (US Version)

Originally found here. Last updated by u/antoniosrevenge Feb 22, 2024.

One of the most frequent questions in /r/personalfinance goes something like:

  • "I have $X, what should I do with it?" or
  • "How should I handle my debt/finances/money?"

This incorporates general guidance found in the PF Wiki and that is given often by /r/personalfinance regulars. If you have suggestions about this article, please message the moderators.

@milnak
milnak / Photopea Keyboard Shortcuts.md
Last active September 4, 2025 22:13
Photopea Keyboard Shortcuts

Photopea Keyboard Shortcuts

File
Open Ctrl + O
Save Ctrl + S
Save as PSD Shift+Ctrl + S
Export as Alt+Shift+Ctrl + S

|Edit||

@milnak
milnak / Mirror-Website.ps1
Created September 4, 2025 16:28
Mirror a website using wget
param (
[Parameter(Mandatory)][string]$Domain,
[string]$WgetCommand = 'wget.exe'
)
Get-Command -Name $WgetCommand -CommandType Application -ErrorAction Stop | Out-Null
$TargetPath = '{0}_{1}' -f $Domain, (Get-Date -Format 'yyMMdd')
if (Test-Path -LiteralPath $TargetPath) {
@milnak
milnak / Exact Audio Copy (EAC) Configuration.md
Last active November 30, 2025 03:35
Exact Audio Copy (EAC) Configuration #windows

Exact Audio Copy configuration

These instructions provide a way to accurately rip CDs using Exact Audio Copy (EAC).

Remove Previous Configuration

To backup any previous configuration (optional):

mkdir 'EAC-backup'; cd 'EAC-backup'
@milnak
milnak / mame-windows-build.md
Last active November 30, 2025 03:35
Compiling MAME for Windows #windows
@milnak
milnak / config.yaml
Last active May 29, 2025 20:48
My beet configuration file
# Beets configuration
# ~/.config/beets/config.yaml
# https://beets.readthedocs.io/en/stable/reference/config.html
# Global Options
# --------------
library: /mount/usb/Music/beets.db
directory: /mount/usb/Music/
# Not using replaygain due to this bug: `replaygain` plugin hangs for a few minutes doing nothing, before actually generating tags · Issue #5449 · beetbox/beets
@milnak
milnak / ConvertFrom-MuseScore.ps1
Last active June 17, 2025 23:07
Extract MuseScore score and parts to PDF
<#
.SYNOPSIS
Convert MuseScore file to PDF. Files are output to current folder.
.EXAMPLE
mkdir PDF; cd PDF
Get-ChildItem -File -LiteralPath '..' -Filter '*.mscz' | ForEach-Object { ConvertFrom-MuseScore -Extract Parts -File $_.FullName }
#>
function ConvertFrom-MuseScore {
param(