Skip to content

Instantly share code, notes, and snippets.

@vnau
vnau / jsooner__heads_main.json
Last active April 2, 2025 16:13
Coverage Badges
{"label":"Test Coverage","message":"100%","schemaVersion":1,"color":"green","namedLogo":"vitest"}
@vnau
vnau / SP-FixTemplates.ps1
Last active November 18, 2021 20:40
The script fixes SharePoint Template Files (STP) so that they can be imported while preserving Lookup fields. The STP files are first extracted, the GUIDs are replaced with the corresponding list paths, and subsequently repackaged. All dependent SharePoint Template files must be located in the folder where the script is run.
# The script fixes SharePoint Template Files (STP) so that they can be imported while preserving Lookup fields.
# The STP files are first extracted, the GUIDs are replaced with the corresponding list paths, and subsequently repackaged.
# All dependent SharePoint Template files must be located in the folder where the script is run.
$templatePath=(Get-Item .).FullName
# retrieve list of stp files
$lists = Get-ChildItem -Path $templatePath -Filter *.stp -File -Name| ForEach-Object {
[System.IO.Path]::GetFileNameWithoutExtension($_)
}
@vnau
vnau / backup.ps1
Created March 6, 2020 19:07
PowerShell script to backup files to ZIP archive excluding specific folders
param([Parameter(Mandatory)]$path)
$ErrorActionPreference = "Stop"
# top path that we want to keep in the source code zip file
$subdir = ""
# location of the zip file
$ZipFile = (Get-Item -Path ".\").FullName+"\"+(Split-Path $path -leaf)+".zip"
# change current directory
Set-Location "$path"
@vnau
vnau / svg2ico.cmd
Last active December 14, 2017 15:52
Convert SVG icon with transparent background to ICO file format using ImageMagick
convert -density 384 -background transparent -define icon:auto-resize -colors 256 icon.svg icon.ico