Skip to content

Instantly share code, notes, and snippets.

View goofballLogic's full-sized avatar
👔
Still counting things

Andrew Stewart Gibson goofballLogic

👔
Still counting things
  • 20:44 (UTC +01:00)
View GitHub Profile

Last updated: April 2024

Technology/Practice Years of usage
NET 5, .NET Core, .NET Framework 21 2003…
Agile, Agile Transformation 13 2006…
ASP, ASP.Net, ASP.Net MVC, ASP.NET Core MVC 18 2003…
AWS – EC2, S3, Lambda, CodePipeline, CloudFront 2 2013…
Azure – Functions, App Services, Storage, SQL, AKS, Cost Mgmt. 6 2014…
Azure DevOps (aka TFS, Team Foundation Server) 6 2006…
Backbone JS, Sammy JS, Microsoft AJAX Extensions 5 2006…2013
// Set up:
// - dotnet new console
// - dotnet add package OneOf
// Implement each of the methods below so that they all compile
// There only one valid implementation for each function (apart from f5 & f6)
using OneOf;
A F1<A>(A a) {
class Cat {
speak() { return "meow"; }
}
function process(cat) {
return cat.speak();
}
class Ball {
}
terraform {
required_version = ">= 0.12"
}
provider "aws" {
region = "eu-west-1"
}
resource "aws_instance" "web" {
const ordinalSuffixes = {
"en": {
"one": "st",
"two": "nd",
"few": "rd",
"other": "th"
}
};
export class OrdinalFormat {
const fullFormat = new Intl.DateTimeFormat("en", { dateStyle: "full" });
const now = new Date();
fullFormat.format(now); // 'Thursday, October 28, 2021'
const fullFormat = new Intl.DateTimeFormat("en", { dateStyle: "full" });
fullFormat.resolvedOptions();
/*
{
calendar: "gregory"
dateStyle: "full"
locale: "en"
numberingSystem: "latn"
timeZone: "Europe/London"
}
const fullFormat = new Intl.DateTimeFormat("en", { dateStyle: "full" });
const now = new Date();
fullFormat.format(now);
// Thursday, October 28, 2021
fullFormat.formatToParts(now)
/*
[
{
const cardinalPluralRules = new Intl.PluralRules("en");
cardinalPluralRules.select(0) // other
cardinalPluralRules.select(1) // one
cardinalPluralRules.select(2) // other
cardinalPluralRules.select(3) // other
cardinalPluralRules.select(4) // other
const ordinalPluralRules = new Intl.PluralRules("en", { type: "ordinal" });
ordinalPluralRules.select(0) // other
ordinalPluralRules.select(1) // one
const ordinalSuffixes = {
"one": "st",
"two": "nd",
"few": "rd",
"other": "th"
};
const ordinalPluralRules = new Intl.PluralRules("en", { type: "ordinal" });
const ordinal = ordinalPluralRules.select(3);