This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void $Unit$_$Scenario$_$Expected$() | |
{ | |
$END$ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ======================================================== | |
// String: String module | |
// Helpers for working with strings | |
// ======================================================== | |
module String = | |
let isNotEmpty s = not (String.IsNullOrEmpty s) | |
let join (ss: string seq) = String.Join("", ss) | |
let lower (s: string) = s.ToLowerInvariant() | |
let trim (s: string) = s.Trim() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let isNotEmpty s = not (String.IsNullOrEmpty s) | |
let join (ss: string seq) = String.Join("", ss) | |
let lower (s: string) = s.ToLowerInvariant() | |
let trim (s: string) = s.Trim() | |
let replace (oldValue: string) newValue (s: string) = s.Replace(oldValue,newValue) | |
let split (by: string) (s: string) = s.Split(by) | |
let endsWith (tail: string) (s: string) = s.EndsWith(tail) | |
let startsWith (head: string) (s: string) = s.StartsWith(head) | |
let contains (search: string) (s: string) = s.Contains(search) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-Item -ItemType directory -Path ".paket" | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$tag = (Invoke-WebRequest -Uri https://api.github.com/repos/fsprojects/Paket/releases | ConvertFrom-Json)[0].tag_name | |
$uri = " https://github.com/fsprojects/Paket/releases/download/" + $tag + "/paket.bootstrapper.exe" | |
Invoke-WebRequest $uri -OutFile .paket/paket.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Program | |
public class Person { | |
// ClassDeclaration | |
// Modifiers | |
// Public | |
// Class | |
// Identifier | |
// ClassBody | |
// LBRACE | |
private String name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//In Startup.cs file | |
services.AddMvc(config => | |
config.ModelBinderProviders.Insert(0, new NoNullStringModelBinderProvider()) | |
); | |
//model binder provider | |
public class NoNullStringModelBinderProvider : IModelBinderProvider | |
{ | |
public IModelBinder GetBinder(ModelBinderProviderContext context) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script checks the markdown links in all markdown files. | |
# param 1: [optioal] [flag] -v or -vv to enable debugging or tracing | |
# param 2: [optional] path to a specific file to check. If not present, will search for *.md | |
# It will match all [desc](https?...) patterns in markdown files. | |
# 'desc' can be a directory or file and it will check it exists. | |
# exist code 1 if and files or links not found. | |
# Examples: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load "StringX.fsx" | |
#load "Result.fsx" | |
open System | |
open System.Diagnostics | |
type Commit = | Commit of string | |
type Author = | Author of string | |
type Lines = string list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* QUEUES | |
https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.queue-1 | |
*) | |
// 1.0 Basic queue - hand-rolled | |
let q = System.Collections.Generic.Queue<string>() | |
q.Enqueue "Hello" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tests | |
// test for invalid name omitted... | |
[Fact] | |
public void CreatingPerson_WithValidPerson_CallsIsValid() | |
{ | |
var name = "Bob"; | |
var people = Substitute.For<IPersonRepository>(); | |
var validator = Substitute.For<IPersonValidator>(); | |
var createPerson = new CreatePerson(people, validator); |
NewerOlder