Skip to content

Instantly share code, notes, and snippets.

View michael-wolfenden's full-sized avatar

Michael Wolfenden michael-wolfenden

View GitHub Profile
# Type(<scope>): <subject>
# <body>
# <footer>
# Type should be one of the following:
# * feat (new feature)
# * fix (bug fix)
# * docs (changes to documentation)
# * style (formatting, missing semi colons, etc; no code change)
# * refactor (refactoring production code)
@michael-wolfenden
michael-wolfenden / TestHelper.cs
Created September 26, 2017 02:32 — forked from sinairv/TestHelper.cs
String Comparison Unit Test Helper
public static class TestHelpers
{
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue)
{
ShouldEqualWithDiff(actualValue, expectedValue, DiffStyle.Full, Console.Out);
}
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue, DiffStyle diffStyle)
{
ShouldEqualWithDiff(actualValue, expectedValue, diffStyle, Console.Out);
@michael-wolfenden
michael-wolfenden / Docker shell commands.sh
Created October 15, 2017 10:10 — forked from bahmutov/Docker shell commands.sh
A personal cheat sheet for running local Node project in a Docker container
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .
@michael-wolfenden
michael-wolfenden / git-workflow.md
Created April 25, 2018 07:09 — forked from forest/git-workflow.md
Git Feature Branch Workflow

We subscribe to the Git Featrue Branch workflow, briefly described in that link.

In practice, it works as follows:

FEATURE DEVELOPMENT

Steps to Follow:

  1. Start with an updated local development branch -- by checking out the dev branch and pulling changes:
    git checkout development
    git pull origin development
const COLORS = {
blue: ['#1E88E5', '#90CAF9'],
brown: ['#6D4C41', '#D7CCC8'],
gray: ['#212121', '#BDBDBD'],
green: ['#388E3C', '#A5D6A7'],
red: ['#E53935', '#EF9A9A'],
orange: ['#F4511E', '#FFAB91'],
purple: ['#8E24AA', '#E1BEE7'],
yellow: ['#FFD600', '#FFF59D'],
}
// Builders
class SimpleBuilder {
constructor(private current = {}) {
}
prop(key: string, value: any) {
return new SimpleBuilder({ ...this.current, ...{ [key]: value } });
}
@michael-wolfenden
michael-wolfenden / Constructors.cs
Created August 28, 2018 06:10
Port of F# Tic-Tac-Toe
namespace TicTacToe
{
namespace Schema
{
public static class Constructors
{
public static One One() => OneThroughThree.One;
public static Two Two() => OneThroughThree.Two;
public static Three Three() => OneThroughThree.Three;
@michael-wolfenden
michael-wolfenden / .gitattributes
Created June 21, 2020 21:00 — forked from bjrmatos/.gitattributes
My default .gitattributes
# Git to autodetect text files and normalise their line endings to LF when they are checked into your repository.
* text=auto
#
# The above will handle all files NOT found below
#
# These files are text and should be normalized (Convert crlf => lf)
*.php text
*.css text
@michael-wolfenden
michael-wolfenden / types.ts
Created January 14, 2021 20:16 — forked from ClickerMonkey/types.ts
Typescript Helper Types
// when T is any|unknown, Y is returned, otherwise N
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N;
// when T is never, Y is returned, otherwise N
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
// when T is a tuple, Y is returned, otherwise N
// valid tuples = [string], [string, boolean],
// invalid tuples = [], string[], (string | number)[]