Skip to content

This repository contains code samples for articles on my blog. It is easier to keep the code up to date when all of the items are grouped.

License

Notifications You must be signed in to change notification settings

KeesCBakker/keestalkstech-code-gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

234 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KeesTalksTech Gallery Repository

This repository contains code samples for articles on my blog. It is easier to keep the code up to date when all of the items are grouped.

1. Dependency injection (with IOptions) in Console Apps in .NET

When you are used to building web applications, you kind of get hooked to the ease of Dependency Injection (DI) and the way settings can be specified in a JSON file and accessed through DI (IOptions<T>). It's only logical to want the same features in your Console app.

2. Simple JWT Access Policies for API security in .NET

Services can use their private key to communicate with our service. We can configure the access for each issuer using standard .NET claims.

3. Options Injection

Options themselves can be collections as well. This project shows how to use a Dictionary<string, string> and a List<string> as base classes for options. Both are supported by default.

4. .NET Console Application with injectable commands (System.CommandLine preview)

How to use System.CommandLine to build a CLI with commands and dependency injection.

5. Roman Numerals

Parsing Roman Numerals in C# is a good way to explore (implicit) operator overloading.

6. Handlebars.Net & JSON templates

I ❤️ Handlebars! So I was very very very happy to see that Handlebars was ported to .NET! It is a mega flexible templating engine as it can easily be extended. I'm working on a project where I need to parse objects via JSON templates to JSON strings. This blog will show how to instruct Handlebars to parse into JSON and add some nice error messages if your template fails.

7. Docker

All my applications run in Docker. Having a fast CI is paramount. As Docker is not unline a layered cake, it is important to understand how to build your images in such a way that you can cache the layers.

8. Bypass Company Wallpaper as Local Admin

Looks like my organization wants to manage my background picture. But I'm a local admin, so let's see if we can still change that background picture. When I go to Setting > Personalization > Background, I see the message: "Some of these settings are managed by your organization." If you are an admin, you might be able to (temporarily) override the wallpaper, by editing your registry and triggering a refresh of the wallpaper. If you can, you can automate it using PowerShell.

9. Simple Python code to send messages to a Slack channel (without packages)

The Slack API is so simple, that you don't really need a package to post a simple message to a Slack channel. This simple Python code will show you how!

11. Jupyter Notebook and PIL images

When working with images in a Python notebook I like to visualize them on a grid. Just calling display is not enough as it renders the images underneath each other. Let's use Matplotlib to generate a grid of PIL images.

12. HTTP Resilience, Kiota

My new years resolution for 2025 is not to write a custom implementation if I have an Open API specification availabe. Now, let's test how to create a resilent setup without any client generation, with a Kiota client.

13. Chocolatey

With the Chocolatey Package Manager for Windows, it is super easy to install software from the command-line. This makes your installs scriptable and thus repeatable. In this article, I'll show you how to render installation instructions from a machine and how to use the Windows Task Scheduler to update your packages regularly.

14. Validation

Let's explore validation using .NET Data Annotations and FluentValidation.

About

This repository contains code samples for articles on my blog. It is easier to keep the code up to date when all of the items are grouped.

Resources

License

Stars

Watchers

Forks