Skip to content

Instantly share code, notes, and snippets.

@pavelhodek
pavelhodek / README.md
Created August 1, 2025 10:41 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@pavelhodek
pavelhodek / setupmachine.bat
Created November 2, 2023 10:06 — forked from shanselman/setupmachine.bat
WinGet Setup a New Machine
mkdir c:\github
winget install --id=Git.Git -e --accept-package-agreements --accept-source-agreements
winget install --id=Microsoft.VisualStudioCode -e
winget install --id=AgileBits.1Password -e
winget install --id=7zip.7zip -e
winget install --id=Twilio.Authy -e
winget install --id=Bethesda.Launcher -e
winget install --id=Microsoft.Bicep -e
winget install --id=Microsoft.bitsmanager -e
winget install --id=BrutalChess.BrutalChess -e
@pavelhodek
pavelhodek / PerfTest.cs
Created November 2, 2023 09:14 — forked from LeeCampbell/PerfTest.cs
Simple LinqPad sample of how to execute a performance test in C#
void Main()
{
var messageCount = 10000;
var sum =0L;
var result = ThroughputTestResult.Capture(messageCount, () => sum = SumOfSquares(messageCount));
Console.WriteLine($"Result: SumOfSquares({messageCount}) = {sum}");
Console.WriteLine(result.ToString());
}
@pavelhodek
pavelhodek / dotnetcheatsheet.md
Created August 22, 2023 13:30 — forked from jonlabelle/dotnetcheatsheet.md
Dotnet core Cheat Sheet
@pavelhodek
pavelhodek / ANSI.md
Created August 22, 2023 13:30 — forked from jonlabelle/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
@pavelhodek
pavelhodek / NormalizeLineEndings.cs
Created August 22, 2023 13:28 — forked from jonlabelle/NormalizeLineEndings.cs
Normalize line endings in C#.
/// <summary>
/// Normalize line endings.
/// </summary>
/// <param name="lines">Lines to normalize.</param>
/// <param name="targetLineEnding">If targetLineEnding is null, Environment.NewLine is used.</param>
/// <exception cref="ArgumentOutOfRangeException">Unknown target line ending character(s).</exception>
/// <returns>Lines normalized.</returns>
/// <remarks>
/// https://jonlabelle.com/snippets/view/csharp/normalize-line-endings
/// </remarks>
@pavelhodek
pavelhodek / delete_branches.ps1
Created January 2, 2023 15:23 — forked from scottgulliver/delete_branches.ps1
Delete all branches other than dev
git branch | Select-String -Pattern "^* dev$" -NotMatch | foreach { $_ -replace "^ ", "" } | foreach { git branch -d $_ }
@pavelhodek
pavelhodek / checkout_branches.ps1
Created January 2, 2023 15:23 — forked from scottgulliver/checkout_branches.ps1
Powershell script to checkout all remote git branches
git branch -r | Select-String -Pattern "->" -NotMatch | Select-String -pattern "^ origin/" | foreach { $_ -replace '^ origin/', '' } | Foreach { git checkout $_ }

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track