BlogCodeSamples icon indicating copy to clipboard operation
BlogCodeSamples copied to clipboard

Code samples from my blog

Code Samples - Grant's Blog

This repository contains some code samples from my blog posts. I sometimes upload code to separate repos (like for C# / .NET and WinForms), or to Gist or JsFiddle for shorter snippets.

The list below has a link to each blog post, followed by the relevant code for that post.

APIs

  • Discover where the ISS is, where it will be, and who's on it with the ISS Notify API (blog, code)

Dev Tools

  • Can I compare files using VS Code? (blog, code)
  • Cool markdown tricks for GitHub (blog, code)
  • Why doesn't VS 2022 show my WinForms UI at design time? (blog, code)

Frameworks

ASP.NET Core

  • Similar endpoints, swagger pages, and a DevOps fail (blog, code)

WinForms

  • Passing data between two Forms in WinForms (blog, code)

WPF

  • Using a TextBox and CollectionViewSource to Filter a ListView in WPF (blog, code)

Languages

C#

  • An extension method for passing a column name to SqlDataReader.GetFieldValue in C# (blog, code)
  • How do I convert my code from C# to VB.NET (or from VB.NET to C#)? (blog, code)
  • How to generate and verify TOTP 2FA codes (in C#) (blog, code)
  • The Obsolete attribute on a class is ignored when an interface is involved (blog, code)
  • Using an application config file with a .NET Standard app and NUnit 3 (blog, code)
  • What is mocking a dependency? (blog, code)
  • What is the NUnit constraint model and should you use it? (blog, code)

Erlang

  • Keep your EUnit teardown logic as simple as possible! (blog, code)

Misc

  • Running Windows XP in VirtualBox (blog, code)
  • Where should I store application data in Windows? (blog, code)