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 / 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 / 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 / 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;
// Builders
class SimpleBuilder {
constructor(private current = {}) {
}
prop(key: string, value: any) {
return new SimpleBuilder({ ...this.current, ...{ [key]: value } });
}
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'],
}
@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
@michael-wolfenden
michael-wolfenden / graph.linq
Created October 22, 2017 22:44
Google charts - linqpad
<Query Kind="Program">
<Namespace>System.Globalization</Namespace>
</Query>
void Main()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US"); //Separate double digits with dot not comma - please!
var data = new[] {22.61, 22.59, 22.63, 22.60, 22.62, 22.58, 22.61, 22.62, 22.60, 22.64, 22.69, 22.62, 22.65, 22.62, 22.61, 22.65, 22.63, 22.61, 22.65, 22.63, 22.59, 22.62, 22.59, 22.64, 22.58, 22.61, 22.63, 22.61, 22.61, 22.69, 22.62, 22.59, 22.65, 22.65, 22.64, 22.63, 22.63, 22.63, 22.59, 22.61, 22.67, 22.57, 22.60, 22.61, 22.61, 22.61, 22.60, 22.61, 22.64, 22.62, 22.63, 22.67, 22.65, 22.65, 22.61, 22.63, 22.63, 22.61, 22.62, 22.69, 22.62, 22.59, 22.59, 22.61, 22.61, 22.58, 22.61, 22.65, 22.61, 22.63, 22.68, 22.62, 22.64, 22.62, 22.62, 22.64, 22.64, 22.63, 22.65, 22.61, 22.60, 22.63, 22.59, 22.62, 22.61, 22.59, 22.63, 22.62, 22.60, 22.69, 22.62, 22.61, 22.63, 22.65, 22.64, 22.63, 22.63, 22.65, 22.58, 22.60};
RenderLineGraph("Time", "P1", data);
@michael-wolfenden
michael-wolfenden / microservice.linq
Last active October 25, 2018 10:43
aspnetcore microservice - linqpad
<Query Kind="Program">
<NuGetReference>Microsoft.AspNetCore</NuGetReference>
<NuGetReference>Microsoft.AspNetCore.Mvc.Core</NuGetReference>
<NuGetReference>Microsoft.AspNetCore.Mvc.Formatters.Json</NuGetReference>
<NuGetReference>System.ValueTuple</NuGetReference>
<Namespace>Microsoft.AspNetCore</Namespace>
<Namespace>Microsoft.AspNetCore.Builder</Namespace>
<Namespace>Microsoft.AspNetCore.Hosting</Namespace>
<Namespace>Microsoft.AspNetCore.Mvc</Namespace>
<Namespace>Microsoft.Extensions.DependencyInjection</Namespace>
@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 / create-react-app.ps1
Created October 4, 2017 10:48
Docker create-react-app
docker run -it --rm -v ${PWD}:/src -w /src node:8.6.0-alpine /bin/sh