https://aka.ms/aspnetcore-makeover
- Intro (goals/non-goals/what you'll learn)
- Pick The Right Starting Template
- Web Application (no auth)
- Web API
- SPA
| // 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)[] |
| # 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 |
https://aka.ms/aspnetcore-makeover
| 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'], | |
| } |
We subscribe to the Git Featrue Branch workflow, briefly described in that link.
In practice, it works as follows:
git checkout developmentgit pull origin development| # 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 . |
| 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); |
| # 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) |