Skip to content

Instantly share code, notes, and snippets.

@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 November 30, 2025 03:55
Convert Text to C literals
<!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 November 11, 2025 02:46
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
@milnak
milnak / fix-xsc.ps1
Last active January 5, 2026 00:02
Set a Transcribe XSC file to my desired default settings.
<#
.SYNOPSIS
Fix a Transcribe XSC file to my desired default settings.
.DESCRIPTION
This script reads a Transcribe XSC file, modifies some settings to my preferred defaults,
and writes the changes back to the file.
.PARAMETER Path
The path to the XSC file to fix.
.NOTES
The XSC file format is meh, so Read-Xsc is a bit weird.
@milnak
milnak / dump-scoop-aliases.ps1
Last active November 30, 2025 03:42
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)'"
}
@milnak
milnak / mortgage-calc.html
Last active March 28, 2025 22:07
Mortgage calculator written in HTML and JavaScript
<html>
<head>
<title>JavaScript Mortgage Calc</title>
</head>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
@milnak
milnak / SysInfo.vbs
Created March 18, 2025 18:21
Displays system info using WMI
'
' File: SysInfo.vbs
' Created: May 29, 2002
' Version: 1.1
'
' Function: Displays system information using WMI
' Author: Jeff Miller
'
' History:
' 1.0 May 29, 2002 - initial revision
@milnak
milnak / Behringer TD-3 Tutorial.md
Last active November 30, 2025 03:53
Behringer TD3 Tutorial

Behringer TD-3 Tutorial

System overview

  • 4 Pattern Groups (PG): I, II, III, iV
  • 16 Patterns (PA) per PG, eight "A" patterns and eight "B" patterns.
  • Each PA can have up to 16 steps. Default step is a 16th note.
  • 7 Tracks (TR)
    • PG I consists TR 1, 2
  • PG II consists TR 3, 4
@milnak
milnak / manager-cheat-sheet.md
Last active March 15, 2025 20:40
The Manager's Cheat Sheet: 101 Common-Sense Rules for Leaders

The Manager's Cheat Sheet: 101 Common-Sense Rules for Leaders

Boost your management skills by getting back to the basics — here are some common sense tips for leading an effective team.

By Inside CRM Editors

Management is all about connecting with the people on your team. So how do you effectively manage a team? With common knowledge, of course. These are a few back-to-basics rules that will help you develop management skills that really matter.

Body Language