Skip to content

Instantly share code, notes, and snippets.

@milnak
milnak / Exact Audio Copy (EAC) Configuration.md
Last active June 24, 2025 04:36
Exact Audio Copy (EAC) Configuration

Exact Audio Copy configuration

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

Remove Previous Configuration

REG.EXE DELETE 'HKEY_CURRENT_USER\Software\AWSoftware\EACU' /F
Remove-Item -Recurse -Force "$env:AppData\EAC"
@milnak
milnak / scoop release notes.ps1
Created June 1, 2025 04:29
Show release notes for installed scoop apps
param (
# Show release notes (if available) for scoop apps updated within n days.
[int]$NumberOfDays = 2,
# Auth Token to avoid github rate limiting.
# (Not yet implemented)
[string]$AuthToken
)
# TODO: Pass in auth info:
# $authorization = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$AuthToken"))
@milnak
milnak / mame-windows-build.md
Last active May 31, 2025 16:57
Compiling MAME for 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(
@milnak
milnak / text-to-c.html
Last active April 17, 2025 16:41
Convert text into C-like literal, escaping newlines, tab, double quotes, backslash.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="keywords" content="C++ escaping, C++ special characters, C++ text escaping">
<meta name="author" content="Tomasz Ostrowski">
<meta name="description" content="Text -> C/C++ string converter (special characters escaping).">
<title>Text -> C/C++ string converter</title>
<style>
body {
@milnak
milnak / bash-git-prompt.sh
Created April 17, 2025 16:36
Bash Git Prompt
#!/bin/bash
PROMPT_DIRTRIM=2
# RED="\[\033[0;31m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[0;32m\]"
# BLUE="\[\033[0;34m\]"
# LIGHT_BLUE="\[\033[1;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
@milnak
milnak / update-mame.ps1
Last active April 24, 2025 22:15
MAME installation updater
if (-not (Get-Command -Name '7z.exe' -CommandType Application)) {
Write-Warning '7z.exe not found'
return
}
$output = ./mame.exe -version
# e.g. 0.275 (mame0275)
if ($output -notmatch '(?<friendly>\d+\.\d+) \((?<version>.+)\)') {
Write-Warning 'Unable to determine local MAME version. Expecting MAME.exe in current folder.'
return
# Set a Transcribe XSC file to my desired default settings.
# the XSC file format is meh, so Read-Xsc is a bit weird.
param ([Parameter(Mandatory)][string]$Path)
function Read-Xsc {
param ([Parameter(Mandatory)][string]$Path)
$data = [ordered]@{}
$version = $null
@milnak
milnak / dump-scoop-aliases.ps1
Last active June 1, 2025 04:31
Scoop Aliases
Get-ChildItem -LiteralPath "${env:HOMEDRIVE}${env:HOMEPATH}/scoop/shims" -File -Recurse -Filter 'scoop-*.ps1' `
| Select-Object `
@{ Name = 'Name'; Expression = { $_.BaseName.SubString(6) } },
@{ Name = 'Command'; Expression = { (Get-Content $_.FullName | Select-String -Pattern '^# Summary: (.*)' -NotMatch) -replace '''','''''' } },
@{ Name = 'Summary'; Expression = { (Get-Content $_.FullName | Select-String -Pattern '^# Summary: (.*)').Matches[0].Groups[1] }} `
| ForEach-Object {
"scoop alias add '$($_.Name)' '$($_.Command)' '$($_.Summary)'"
}