Skip to content

Instantly share code, notes, and snippets.

View sliekens's full-sized avatar

Steven sliekens

View GitHub Profile
@sliekens
sliekens / github_tools_overview.txt
Created September 5, 2025 18:26
Overview of tools available in GitHub context
The tools available in the `#github` context typically include features for managing repositories, issues, pull requests, and workflows. Specific tools may vary based on the GitHub API and the integrations you have set up, but generally, they include:
- **Repository Management**: Create, update, and delete repositories.
- **Issue Tracking**: Create, comment on, and close issues.
- **Pull Requests**: Create, review, and merge pull requests.
- **Actions**: Manage GitHub Actions for CI/CD workflows.
- **Webhooks**: Set up webhooks for event-driven integrations.
- **API Access**: Use the GitHub API for custom integrations and automation.
@sliekens
sliekens / dotnet-feature-adaptation.md
Created September 5, 2025 18:23
Adaptation of the Dotnet feature to resolve GitHub issue #1469

Issue #1469: Dotnet Feature Adaptation

This adaptation addresses the requirements outlined in GitHub issue #1469 regarding the Dotnet feature in the repository. The changes include:

  1. Updated Configuration: Adjusted the configuration settings to align with the latest Dotnet SDK requirements.
  2. Enhanced Documentation: Improved the README and inline comments for better clarity on usage and setup.
  3. Testing: Added unit tests to ensure the feature works as expected.

Code Changes

@sliekens
sliekens / AspNetDefaults.csproj
Last active July 12, 2024 12:07
Aspire split defaults for web and workers
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireSharedProject>true</IsAspireSharedProject>
</PropertyGroup>
<ItemGroup>
@sliekens
sliekens / reply.md
Last active October 10, 2022 09:32
Reference data as code and EF

This is a reply to Reference data as code: https://enterprisecraftsmanship.com/posts/reference-data-as-code

I recommend reading it first, because it's good and because otherwise this won't make sense to you.

TLDR; I strongly recommend replacing static readonly fields with creation methods or equivalent getters.

public class Industry : Entity
{
- public static readonly IndustryCars = new Industry(1, "Cars");
@sliekens
sliekens / rant.md
Created May 11, 2022 21:41
How to nuke Git LFS files from your repository with filter-branch

You probably found this page because LFS storage quotas suck absolute balls and GitHub's response to the question to "how can I delete old unneeded files from your servers?" is "Fuck off and get fucked, loser." (Slightly paraphrased)

I refuse to delete my entire repository just to clear up LFS storage. Instead I removed all LFS files from my Git history and uninstalled LFS.

Command to list all commits with LFS files (basically a dry run):

git checkout main
git filter-branch --prune-empty --index-filter 'git lfs ls-files $GIT_COMMIT' 
@sliekens
sliekens / encapsulated-requests.md
Last active April 17, 2022 07:55
Encapsulate your requests

Encapsulate your requests

I've written a lot of code that accesses other web APIs so here are some of my thoughts about how to do it the right way in C#.

HttpClient

Let's take a closer look at the .NET HttpClient interface. Are you surprised? This design looks like they took too much of a good thing —convenience— and turned it into a bad thing: the burden of choice.

@sliekens
sliekens / ibm-data-db2.md
Last active September 30, 2025 20:57
IBM DB .NET Core Provider

IBM Db2 data provider for .NET Core / .NET 5+

/edit I made this page in Feb 2020 because there was no documentation publicly available, and I wanted to share what little information I could find. I'm not associated with IBM.

More official documentation can be found here: https://community.ibm.com/community/user/datamanagement/blogs/vishwa-hs1/2020/07/12/db2-net-packages-download-and-configure

⚠️ NOTE TO IBM ⚠️ (You can skip this section unless you work for IBM)

If you work for IBM, please make the following changes to these packages:

@sliekens
sliekens / DiscriminatedJsonConverter.cs
Last active December 15, 2022 19:24
Configurable JsonConverter for deserializing discriminated JSON
using System;
using System.Diagnostics;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Infrastructure
{
public sealed class DiscriminatedJsonConverter : JsonConverter
{
@sliekens
sliekens / DesignedForInheritanceTest.cs
Last active May 14, 2019 23:04
Design for inheritance
using System;
using System.Linq;
using System.Reflection;
using Xunit;
namespace YourLibName.Tests.PatternsAndPractices
{
public class DesignedForInheritanceTest
{
public DesignedForInheritanceTest()
# Check the working directory for modified files
# Exit with an error if there are any
$modified = git ls-files --modified
if ($modified -ne $null) {
Write-Error "Working directory contains modified files: $modified"
exit 1
}