TekOnline

Category: Programming

  • Removing Files from Git Source Control: A Quick Guide

    Removing Files from Git Source Control: A Quick Guide

    Introduction When working with Git, you might encounter situations where you need to remove a file or folder from source control. Whether it’s a temporary build artifact or a file that should never be tracked, Git provides a straightforward process to achieve this. In this article, we’ll explore the steps involved in removing files from…

  • Developing net core inside docker with https and kestrel

    Developing net core inside docker with https and kestrel

    First of all its a good idea to just make sure you can get https dev working locally. Then you can move to https on your container. This guide doesnt cover that but there are heaps of guides out there and the process is pretty straight forward. This guide will only look at https for…

  • [Solved] ERR_CONNECTION_RESET with SSL and ASP.NET

    I was in the process of migrating an application from forms authentication to Azure identity authentication. Initially, everything seemed straightforward, especially since I had another application already functioning with the new authentication method. However, my optimism quickly waned when I encountered unexpected issues during testing. Upon inspecting the setup, I found that despite setting everything…

  • [Solved] Entity framework – Violation of PRIMARY KEY constraint ‘…’. Cannot insert duplicate key in object ‘dbo…’ the duplicate key value is (…). The statement has been terminated.

    If you are struggling to create a new record in a sql db when using entity framework and you are ending up with an error that looks like this: What this means is that in SQL databases often a table will have a primary key id. And this primary key is generated by the data…

  • String Literal Cheat Sheet (Python, C#, JS)

    String Literal Cheat Sheet (Python, C#, JS)

    Python Python uses f-strings for string interpolation. Here’s an example: In this code, the variables name and age are inserted into the string using curly braces {}. C# C# uses string interpolation with the $ symbol. Here’s an example: In this code, the variables name and age are inserted into the string using curly braces {}. JavaScript JavaScript uses template literals for string interpolation. Template literals are…

  • How to Push Your Git Repository to TFS

    How to Push Your Git Repository to TFS

    In this guide, we’ll walk through the steps of pushing your Git repository to Team Foundation Server (TFS). This guide assumes that you’re working with a Git repository. If your project isn’t already in a Git repository, you’ll need to initialize a new Git repository for your project. Step 1: Add the TFS Remote in…

  • Fixing inconsistently formatted Australian mobile numbers… in excel! 😎

    Fixing inconsistently formatted Australian mobile numbers… in excel! 😎

    Here is the excel formula: This formula checks if the first character of cell M2 is 0. If it is, it concatenates “+61” with the rest of the characters in M2 except the first one. If not, it checks if the first three characters of cell M2 are “+61”. If they are, it returns M2.…

  • How to add a remote folder share as a remote git repository in vs code?

    How to add a remote folder share as a remote git repository in vs code?

    In some cases, you might just wanna push your code to a network folder and use that as your remote. This will also work without vscode as long as you can get to the command line and you have the necessary folder permissions. Here is how 👍 First you will need to initialise your remote…

  • Simple way to sort dates in any format with jquery.datatables

    Simple way to sort dates in any format with jquery.datatables

    Initially, I was formatting the date in my table using any format I liked. However, I soon realized that this would ruin sorting. For example, if you have a table with dates formatted as “dd/mm/yyyy” and “mm/dd/yyyy”, datatables will sort them incorrectly because it will sort them based on their underlying serial numbers. Then I…

  • Converting from DOCX to PDF for thumbnails

    Converting from DOCX to PDF for thumbnails

    I recently needed to show some thumbnails of docx files online. Here is what I came up with. Please note that this will not create a perfect thumbnail. In fact its quite basic. It allows the user to simply see that the file contains something. Nevertheless, I hope you find it helpful! Here is the…