Skip to content

Instantly share code, notes, and snippets.

View gpltaylor's full-sized avatar
💭
I may be slow to respond.

Garry Taylor gpltaylor

💭
I may be slow to respond.
  • RedBear
  • Lancashire
View GitHub Profile
@masak
masak / explanation.md
Last active April 10, 2025 16:42
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@SeanSobey
SeanSobey / portainer.md
Last active June 12, 2024 07:40
Portainer Setup on Windows 10

Portainer on Windows 10

Here I have 2 methods for running portainer on windows, a quick, preferred method only requiring a fairly recent version of docker, or a more complicated method to try if that does not work.

Using host.docker.internal

This setup will let you run Portainer on windows by using the host.docker.internal endpoint (docker.for.win.localhost is depricated since docker version 3.2.1, but older versions may use this instead).

Please note:

@gpltaylor
gpltaylor / Dotnet Records.md
Created December 11, 2024 13:38
C# Records

Dotnet Records was introduced in 2020 with C#9 and highlighted a shift to Functional Programming within the language. However, in my experience, they have been under utilised and demoted to the league of DTO's, primitive obsession and anaemic classes. However, when we extending Records, the similarities to classes can mask the reasons for choosing Records.

What is a Record?

But first, lets identify what a Record is and why I think we are miss-using them.

Let's create an example, when building a Model to represent a Person, there are a number of Properties required. If the Model is rich, there may also be a number of relationships and navigational properties. Consider a Person, with a collection of Address items. Each Address has a Electric Meter owned by an Energy Provider.

Person
   FirstName: string