Skip to content

Instantly share code, notes, and snippets.

View michael-wolfenden's full-sized avatar

Michael Wolfenden michael-wolfenden

View GitHub Profile
@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 / common.js
Created September 14, 2018 03:13
Webpack issue - splitChunks alternative for CommonsChunkPlugin
// common modules used on every page
import axios from 'axios'
import Vue from 'vue'
// common css used on every page
import './shared.css'
// some global initialization
alert('common')
@michael-wolfenden
michael-wolfenden / main.cs
Last active September 21, 2018 10:55
Map Find
using ServiceStack.Text;
using LanguageExt;
using static LanguageExt.Prelude;
using static LanguageExt.Map;
var people = Map((1, "Rod"), (2, "Jane"), (3, "Freddy"));
Option<string> result = find(people, 1);
result.PrintDump();
@michael-wolfenden
michael-wolfenden / Pattern.cs
Last active November 4, 2020 03:12
Pattern
public class Pattern<TReturn>
: List<(Type Type, Func<object, TReturn> Map)>
{
public void Add<T>(Func<T, TReturn> map)
=> Add((typeof(T), o => map((T)o)));
public Pattern<TReturn> Default(TReturn val)
{
Add((object _) => val);
return this;
@michael-wolfenden
michael-wolfenden / main.cs
Last active October 13, 2018 08:52
Serialize Left
using System.Linq;
using ServiceStack;
using ServiceStack.Text;
using LanguageExt;
using static LanguageExt.Prelude;
using Newtonsoft.Json;
public class Error : NewType<Error, string>
{
public Error(string value) : base(value) { }
@michael-wolfenden
michael-wolfenden / main.cs
Created October 13, 2018 08:51
Serialize Lefts
using System.Linq;
using ServiceStack;
using ServiceStack.Text;
using LanguageExt;
using static LanguageExt.Prelude;
using Newtonsoft.Json;
public class Error : NewType<Error, string>
{
public Error(string value) : base(value) { }
@michael-wolfenden
michael-wolfenden / XUnitRunner.cs
Last active July 23, 2019 02:49
[Linqpad XUnit Runner] Run xunit within linqpad #xunit
/*
<Query Kind="Program">
<NuGetReference>xunit</NuGetReference>
<NuGetReference>xunit.runner.utility</NuGetReference>
<Namespace>Xunit</Namespace>
<Namespace>Xunit.Runners</Namespace>
<CopyLocal>true</CopyLocal>
</Query>
*/