TekOnline

Author: jcianci12

  • Angular 19 OAUTH2 bearer token interceptor example. (NswagStudio compatible 😎)

    In this article, we’ll explore how to set up an auth interceptor in Angular to automatically add an authorization header to all outgoing HTTP requests. We’ll also discuss how to avoid modifying the generated api.ts file after each API change. Step 1: Set Up the Auth Interceptor First, let’s create the auth interceptor. In the auth.interceptor.ts file, we’ll import…

  • System.Text.Json 8.0.0.4 Vulnerability: A Solution

    I was facing a very strange issue where after updating a NuGet package (System.Text.Json from 8.0.0.4 to 8.0.0.5) and targeting .NET Framework 4.8.1, the project wouldn’t build correctly. Despite updating the bindingRedirect in the web.config file, the changes seemed to revert. Here’s what worked for me: Note on Entity Framework Compatibility: It’s essential to ensure…

  • Why is My Angular Array Not Updating in the View?

    As an Angular developer, you’ve probably encountered this frustrating scenario: you update an array in your component, but the changes don’t seem to be reflected in the view. You’ve checked your code, and everything looks correct, but the view remains stubbornly unchanged. In this article, we’ll explore the reasons behind this behavior and provide a…

  • Python, Flask and the dreaded error: No module named ‘imp’

    When trying to run a flask application under vscode, dev container, python 3.12.7 64 bit, I started getting these errors: After lots of non helpful answers (at least not for me!) I stumbledacreoss this: https://github.com/microsoft/debugpy/issues/808 Turns out this really helpful comment solved the issue for me! https://github.com/microsoft/debugpy/issues/808#issuecomment-1006990063 Flask has its own built-in debugger, which IIRC…

  • Avoiding Syntax Errors with the Conditional Operator in C#

    I was having a strange bug in my code, everything looked right, but for some reason, it just wouldn’t work as expected. I had written a simple conditional statement using the ternary operator, but it kept throwing a syntax error. I scratched my head, wondering what could be causing the issue. The code in question…

  • Two-Way Data Binding with Dates: A Common Gotcha

    I was having issues getting dates to bind. I realised that when the data came down as a string, the data binding worked fine, but when it came down as a date object, the binding failed. At first, I thought it was a problem with my Angular code, but it turned out to be a…

  • Getting HTML Datepickers to Display Bound Data Correctly

    I was trying to get a HTML datepicker to show the underlying data that it was bound to, but was running into issues with the date format. The datepicker would display the date as a string in the format YYYY-MM-DD, but my backend API expected the date in the same format. I needed to ensure that…

  • Pulling a Close Button to the Right in Bootstrap 5

    I was wanting to pull a close button to the right in Bootstrap 5 recently. After some research and experimentation, I ended up finding that the text-end class is a lifesaver for this! You can even include it in the same class as the col class! Bootstrap 5 provides a variety of utility classes that make aligning elements straightforward.…

  • Taking Control of Notifications with Home Assistant

    I was getting a bit tired of getting non-stop notifications when I was mowing the front lawn. So I decided to create a toggle in Home Assistant that would pause notifications for 15 minutes. The first step was to create a button helper in Home Assistant, which would serve as the toggle switch to pause…

  • Converting B6T images to ISO images.

    I downloaded some old abandoned software the other day, and one of the disk images was in the b6t format. I had no idea what that format was, but I was determined to get the software up and running. After some research, I found that b6t is a proprietary disk image format used by some…