Skip to content

2024

Json

Should I use System.Text. (STJ) or Newtonsoft. (previously .NET)? use STJ, Newtonsoft is no longer enhanced with new features. The author works for Microsoft now on some non-json stuff. JamesNK reddit comment Terms ma...

<3 regex

<3 regex https://regex101.com/r/RdCR7j/1 - set the global flag (g) to get all matches https://www.debuggex.com/ - havent't played with this a lot but I might give it a try, looks like a decent learning tool regex - us...

PowerShell "Oopsie"

Task - remove a specific string from each line of multiple CSV files. This task was added to the scripting exercise list. First - let's generate some CSV files to work with: $numberOfFiles = 10 $numberOfRows = 100 $fi...

My recommendations

Terminal etc. https://github.com/PowerShell/PowerShell - PowerShell 7+ - faster & better then Windows PowerShell https://ohmyposh.dev/ - amazing prompts - replace that old $ sign with amazing stuff https://github.com/...

PowerShell quirk

tl;dr In PowerShell if you want to return an array instead of one element of the array at the time do this: > @(1..2) | % { $a = "a" * $_; @($a,$_) } # wrong! will pipe/return 1 element at a time > @(1..2) | % { $a = ...

node packages updating

tl;dr > npm install depcheck -g - install depcheck globally > depcheck - check for redundant packages > npm un this-redundant-package - uninstall redundant packages (repeat for all redundant packages) Create a pull-re...

axios, cookies & more

axios, cookies & more axios axios - promise-based HTTP client for node.js when used in node.js axios uses http module (https://nodejs.org/api/http.html) in node axios does not support cookies by itself (https://github...