Skip to content

Instantly share code, notes, and snippets.

View andrewabest's full-sized avatar

Andrew Best andrewabest

View GitHub Profile
@andrewabest
andrewabest / Parser.cs
Created February 4, 2022 00:43
A basic function-applying token replacement implementation with Sprache
void Main()
{
var input = "Hello #{Greeting | Upper} #{Greeting | Upper}, How do you like #{DayOfWeek | Lower}";
var variables = new Dictionary<string, string>()
{
{ "Greeting", "hello" },
{ "DayOfWeek", "Wednesday" }
};
@andrewabest
andrewabest / create.bat
Created April 21, 2020 05:40
Creates and packages a dotnet web app for deployment testing via Octopus
dotnet new mvc --auth None -f netcoreapp3.1
dotnet build
dotnet publish
octo pack --Id=MyApp.Test --format=Zip --Version=1.0.0 --basePath=./bin/Debug/netcoreapp3.1/publish
@andrewabest
andrewabest / MustConformToOneOf.cs
Last active January 30, 2020 02:53
MustConformToOneOf - Strongly Typed Conventions spike
void Main()
{
typeof(NonConforming).MustConformToOneOf(new PropertyConventionSpecification[] {
new PropertiesMustHavePrivateSettersConventionSpecification(),
new PropertiesMustHavePublicSettersConventionSpecification()
});
}
public class NonConforming
{
@andrewabest
andrewabest / Notes.md
Last active January 2, 2020 10:59
Kubernetes on Windows - detangling the mess

Kubernetes on Windows

The tooling for K8s on Windows has come a long way over the last couple of years and is starting to stabilise. Minikube 'just works' and you no longer need to fight it (stopping the cluster works now, yay!).

However the tooling has also become so prolific it tends to end up in various places on your machine nested inside other tools. So lets straighten that out.

Kubectl

Windows ends up with a mess of kubectl versions kicking around - VS 2019 has its own, Docker for Windows has its own, Azure Dev Spaces has its own, you may have downloaded the MSI, you may have installed it via Chocolatey.

@andrewabest
andrewabest / stub.ts
Created September 11, 2019 04:45
Basic typescript stubs
export function stub<T>(): T {
const typeAssertion = {} as T;
for (const prop in typeAssertion) {
if (typeAssertion.hasOwnProperty(prop)) {
typeAssertion[prop] = undefined;
}
}
return typeAssertion;
}
@andrewabest
andrewabest / about-me.md
Created August 25, 2019 11:05
DDD Adelaide 2019 Submissions

Andrew is a Principal Consultant with Readify, and has participated on enough interesting gigs in his time to have a tale or five to tell. Like many he has made some strong opinions along the way - some of which even pertain to software; but is always ready to revise them if a convincing argument (and possibly a cleansing ale) is supplied!

@andrewabest
andrewabest / about-me.md
Last active October 3, 2018 04:58
DDD Brisbane 2018 Submissions

Andrew is a Principal Consultant with Readify, and has participated on enough interesting gigs in his time to have a tale or five to tell. Like many he has made some strong opinions along the way - some of which even pertain to software; but is always ready to revise them if a convincing argument (and possibly a cleansing ale) is supplied!

@andrewabest
andrewabest / Instructions.md
Last active November 4, 2019 09:32
Git setting up and fixing line endings

UPDATE

Step 1 & 2 are no longer enough, as git will nag about irreversable conversions regardless of you asking it to convert things.

See This issue for an explanation.

Tl;Dr: git config --global core.safecrlf false

Step 1:

@andrewabest
andrewabest / motivation.md
Last active February 6, 2018 03:33
What motivates developers?

A pyramid, much like Maslow's heirarchy of needs

Peak: Impact and Purpose

  • Seeing the results of the physical and emotional investment in our work, regularly
  • Realizing our visions
  • Validation of the efforts we expended and decisions we made with autonomy
  • Quantifying and celebrating the impact we have had on peoples lives via our work
  • Recieving reward, praise, or other kind of recognition for our accomplishments
  • Outcomes over output
@andrewabest
andrewabest / dbdown.bat
Last active January 15, 2018 05:57
SQL Server on Linux Docker local dev
ECHO OFF
docker stop mssql-myproj-dev
docker rm mssql-myproj-dev