Quantcast
Channel: Damir's Corner
Browsing index pages (528 articles)
↧

Refactor tests to make them more readable

The key role of tests is to ensure that the software under test behaves correctly. You first add tests to verify that you have correctly implemented a feature. The same tests then serve as a safety net...

View Article


Using request timeouts middleware in web API

Last year a wrote a blog post about restricting a REST API endpoint total response time but potentially continuing the processing in the background. I implemented it fully by hand without any external...

View Article


Model variable JSON field types with unions

A while back I wrote a blog post about deserializing a JSON with a field of a variable type in .NET. At that time I used a custom serializer to achieve that. This scenario seems like a good fit for...

View Article

Labeled break and continue statements in C# 15

Goto statements have been a part of C# since the very first version, but at least I haven't seen them being used very often. In C# 15, labels can also be used in combination with continue and break...

View Article

Indexer extension members in C# 15

Last year, extension members were the biggest new feature of C# 14. I wrote about them in detail in multiple blogposts. This year, extension indexers are being added to C# 15 which didn't make it into...

View Article


Collection expressions with arguments in C# 15

Collection expressions were introduced in C# 12. I wrote a blog post about them at that time. In C# 15, the syntax is being extended with the ability to provide additional arguments to the underlying...

View Article

Custom union types in C# 15

In the previous blog post I explored what union types bring to C#. But what does the compiler do under the hood? And do I need to know about that to fully take advantage of union types? Each union type...

View Article

Union types in C# 15

Continuing with the topic of switch expression exhaustiveness in C# 15, I chose union types as the next new language feature to explore. Before C# 15, there were several ways to return multiple...

View Article


Closed class hierarchies in C# 15

The release of C# 15 is getting closer and its new features started to show up in the .NET 11 previews. That's a good time for me to take a closer look at what to expect. I'm starting with closed class...

View Article


Image may be NSFW.
Clik here to view.

Switching restic backup from NFS to SFTP

For over a year, I've been using restic to back up my home lab server to a repository on a Synology NAS mounted locally using NFS. All this time, it worked for me without any issues whatsoever. Only...

View Article

Installing preview .NET SDK in Arch Linux

I'm in the process of switching from Windows 11 to CachyOS on my home machine. Of course, my setup also includes .NET development tooling. And with the upcoming .NET 11 release, I want to have access...

View Article

Image may be NSFW.
Clik here to view.

Manually trigger workflow from non-main branch

As a part of migrating my blog to Azure Static Web Apps, I also had to modify my GitHub Actions deployment workflow. Usually, I only want the deployment to get triggered from the main branch but during...

View Article

Apex domain redirect for Azure Static Web Apps

After reimplementing redirects in Azure Static Web App using managed Azure Functions, there was one last redirect I couldn't implement in this way and had to find another solution for: redirecting all...

View Article


Writing tests for HTTP-triggered Azure Functions

As I was implementing redirects in Azure Functions for my blog, I wanted to be able to test them as efficiently as possible. Although you can run and test an Azure function locally, and I did, I also...

View Article

Regex based redirects for Static Web Apps

The biggest challenge of moving my blog to Azure Static Web Apps were the redirects. I still support permalinks from my previous blog engine and I previously used back-references in IIS rewrite module...

View Article


Image may be NSFW.
Clik here to view.

JSON files in TypeScript Azure Functions

In the process of moving my blog to Azure Static Web Apps I had to troubleshoot a strange issue: according to logs the managed API Azure Functions have been successfully deployed, but according to...

View Article

Image may be NSFW.
Clik here to view.

Importing JSON with custom types in TypeScript

When you want to embed some static data in your TypeScript application, it's very convenient to store it as a JSON file and import it directly in a source code file. The compiler even implies static...

View Article


Image may be NSFW.
Clik here to view.

A reason VS debugger might not hit breakpoints

There's an open source application plugin written in .NET I occasionally contribute to. As a regular part of my workflow, I sometimes have to attach the debugger to the application with the plugin...

View Article

Image may be NSFW.
Clik here to view.

My Bitwarden backup script

Inspired by a great post in Bitwarden Community Forums and the author's bash script I decided to create my own PowerShell script for backing up the contents of my Bitwarden vault to my existing restic...

View Article

Image may be NSFW.
Clik here to view.

Secure scripts with secrets in Windows

My restic backup script on Windows relied on having the restic password stored in an environment variable, making it and the restic command accessible to any process running with my credentials. Before...

View Article
Browsing index pages (528 articles)


Latest Images