Skip to content

Instantly share code, notes, and snippets.

View StefanMaron's full-sized avatar

Stefan Maroń StefanMaron

View GitHub Profile
@StefanMaron
StefanMaron / test-badge.json
Last active May 6, 2026 08:01
AL Runner test badges
{"schemaVersion": 1, "label": "AL tests", "message": "4281 passing", "color": "brightgreen"}
@StefanMaron
StefanMaron / al-runner-probe23.speedscope.json
Created April 11, 2026 09:39
al-runner 1.0.4 dotnet-trace speedscope for #23 — second-insert hot path
This file has been truncated, but you can view the full file.
{"exporter": "Microsoft.Diagnostics.Tracing.TraceEvent@3.1.23.0", "name": "al-runner-probe23.speedscope", "activeProfileIndex": 0, "$schema": "https://www.speedscope.app/file-format-schema.json", "shared": { "frames": [ { "name": "Process64 al-runner (324060) Args: /home/stefan/.dotnet/tools/.store/msdyn365bc.al.runner/1.0.4/msdyn365bc.al.runner/1.0.4/tools/net8.0/any/AlRunner.dll /home/stefan/Documents/Repos/community/BusinessCentral.Sentinel/BusinessCentral.Sentinel/src/SentinelRuleSet.Table.al /home/stefan/Documents/Repos/community/BusinessCentral.Sentinel/BusinessCentral.Sentinel/src/SentinelRuleSet.Page.al /home/stefan/Documents/Repos/community/BusinessCentral.Sentinel/BusinessCentral.Sentinel/src/Alert.Codeunit.al /home/stefan/Documents/Repos/community/BusinessCentral.Sentinel/BusinessCentral.Sentinel/src/IgnoredAlerts.Table.al /home/stefan/Documents/Repos/community/BusinessCentral.Sentinel/BusinessCentral.Sentinel/src/AlertCard.Page.al /home/stefan/Documents/Repos/community/BusinessCentral.Sentinel/Bus
@StefanMaron
StefanMaron / regexCommands.md
Last active October 17, 2024 07:07
Use full RegEx

Search: (Caption|ToolTip)ML\s*=\s*ENU\s*=\s*'([^']*)',\s*DEU\s*=\s*'([^']*)';
Replace: $1 = '$2', Comment = 'de-DE=$3';

@StefanMaron
StefanMaron / DebloatBCCotnainer.ps1
Created June 19, 2023 04:49
uninstall all apps from a BC container except for Base and System App
$keepApps = @("c1335042-3002-4257-bf8a-75c898ccb1b8","437dbf0e-84ff-417a-965d-ed2bb9650972","63ca2fa4-4f03-4f2b-a480-172fef340d3f")
Get-BcContainerAppInfo -containerName $containerName -installedOnly | where -Property AppId -NotIn $keepApps | % {UnInstall-BcContainerApp -containerName $containerName -name $_.Name -publisher $_.Publisher -version $_.Version -Force }
Import-TestToolkitToBcContainer -containerName $containerName -includeTestLibrariesOnly -includePerformanceToolkit
@StefanMaron
StefanMaron / ExtractTestComments.ps1
Last active May 13, 2022 09:33
Extract Test comments to clipbard in order to paste to excel
$rootpath = "<testfolderpath>"
$givenOut = ""
$thenOut = ""
$output = ""
$scenarioName = ""
$files = Get-ChildItem -Path $rootpath
$files | ForEach-Object {
function Git-ClearBranches {
git remote prune origin
git branch -vv | where {$_ -match '\[origin/.*: gone\]'} | foreach {git branch -D ($_.split(" ", [StringSplitOptions]'RemoveEmptyEntries')[0])}
}
@StefanMaron
StefanMaron / CheckCommitContraints.ps1
Created June 10, 2021 14:08
CheckCommitContraints.ps1
$AppJsonFiles = git diff --staged --name-only
$AppJsonFiles | ForEach-Object {
if ($_ -like "*app.json") {
$appJson = git show :$_
$appJson = $appJson | ConvertFrom-Json
$appJsonVersion = [System.Version]$appJson.Version
if ($appJsonVersion.Build -ne 0) {
@StefanMaron
StefanMaron / pre-commit
Created June 10, 2021 14:05
pre-commit
#!C:/Program\ Files/Git/usr/bin/sh.exe
echo
exec powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\.githooks\CheckCommitContraints.ps1"
exit
@StefanMaron
StefanMaron / UpgradeBCDatabaseWithDocker.ps1
Created June 4, 2021 08:52
This is the script I created in this video https://youtu.be/2UnIFAWgEK0
$ContainerNameOld = 'BC17-dev'
$ContainerNameNew = 'BC18-dev'
$TargetVersionBasePath = 'C:\bcartifacts.cache\onprem\18.0.23013.23795'
$BackFolderName = 'C:\ProgramData\BcContainerHelper\DatabaseUpgrade\'
$BackFile17 = Join-Path $BackFolderName 'Database_17.bak'
# Unsinstall all Extensions
Get-BcContainerAppInfo -containerName $ContainerNameOld | ForEach-Object { UnInstall-BcContainerApp -containerName $ContainerNameOld -Name $_.Name -Version $_.Version -Force }
# Unintall all 'Symbols only' extensions
@StefanMaron
StefanMaron / CustomerListExtension.al
Created December 14, 2020 13:52
How to make a column in a List page empty with "SetLoadFields()"
pageextension 50100 CustomerListExt extends "Customer List"
{
actions
{
addlast(processing)
{
action(RunVendorList)
{
ApplicationArea = All;