This gist kept getting bigger and bigger, so I moved it to a proper repository, complete with a proper NuGet package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text.Json; | |
using System.Text.Json.Nodes; | |
namespace CajunCoding | |
{ | |
public static class SystemTextJsonMergeExtensions | |
{ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull
example requires it.
Consider adopting the new property pattern, wherever you use IsNullOrEmpty
.
string? hello = "hello world";
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
namespace System.Collections.Immutable | |
{ | |
public class ImmutableListWithValueSemantics<T> : IImmutableList<T>, IEquatable<IImmutableList<T>> | |
{ | |
IImmutableList<T> _list; | |
public ImmutableListWithValueSemantics(IImmutableList<T> list) => _list = list; |
Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Where svn.exe can be found | |
$svnPath = 'C:\Data\svn' | |
# Where the resulting git repositories should be created | |
$gitRepoPath = 'C:\Data\svn\git' | |
# The branch that should become the default branch in the git repository | |
$defaultBranch = 'trunk' | |
$removeTempRepository = $true | |
# The URL to the SVN server (can be file:///) | |
$svnRepoUrl = 'file:///c:\Data\svn\SVNRepo' | |
# The relative paths of each project inside the SVN repository, where 'trunk', 'branches' and 'tags' folders can be found |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
******************************************************************************************************* | |
** PLEASE NOTE THAT THIS IS NOW SOMEWHAT OUT OF DATE, THE GENERAL APT-GET LINUX INSTALL INSTRUCTIONS ** | |
** FOR UBUNTU/DEBIAN NOW LARGLEY WORK ON RASBIAN ** | |
******************************************************************************************************* | |
First things first, make sure your Raspberry PI has the latest updates for Raspbian on by running | |
sudo apt-get -y update | |
sudo apt-get -y upgrade |
NewerOlder