This file contains hidden or 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 your shell | |
$ paket init | |
$ paket add nuget suave.swagger | |
$ paket install | |
$ paket generate-include-scripts | |
$ code . | |
*) | |
#load ".paket/load/main.group.fsx" |
This file contains hidden or 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
using System.ComponentModel.DataAnnotations; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Web.Mvc; | |
using Newtonsoft.Json; | |
namespace WebApplication1.Controllers | |
{ | |
// It a DTO model |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Net; | |
namespace EventStoreService | |
{ | |
public class EventStoreService | |
{ |
This file contains hidden or 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 toHex (c:char) = Convert.ToInt32(c) |> fun i -> i.ToString("X") | |
let encode s = | |
let parts = s |> Seq.map (fun c -> "%" + (c |> toHex)) | |
String.Join("", parts) | |
let (|HexaChar|_|) (s:char list) = | |
if s.Length > 0 && s.Head = '%' then | |
let chars = s |> Seq.skip 1 |> Seq.take 2 |> Array.ofSeq | |
let h = new String(chars) | |
let num = Convert.ToInt32(h, 16) |
This file contains hidden or 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
#I @"packages\Selenium.WebDriver\lib\net40" | |
#I @"packages\canopy\lib" | |
#I @"packages\FAKE\tools\" | |
#r "FakeLib.dll" | |
#r "canopy.dll" | |
#r "WebDriver.dll" | |
open System | |
open System.IO |
This file contains hidden or 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
// recursive | |
let rec fiboRec = | |
function | |
| 0L -> 0L | |
| 1L -> 1L | |
| n -> fiboRec (n-1L) + fiboRec (n-2L) | |
#time |
This file contains hidden or 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
open System | |
module Domain = | |
type ClassName = string | |
type TagName = string | |
type HtmlId = string | |
type Token = | |
| TagSelector of TagName | |
| ClassSelector of ClassName | |
| WhiteSpace |
This file contains hidden or 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
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
static int SearchWithDichotomy(IList<int> nums, int target) | |
{ | |
var min = 0; | |
var max = nums.Count; |
This file contains hidden or 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
Function Get-CsharpFileNotEndingWithLF([string]$path) | |
{ | |
$files = Get-ChildItem -Path $path -Recurse -Include @("*.cs") | |
$files | Foreach { | |
$content = [System.IO.File]::ReadAllText($_) | |
if ($content -ne $null) | |
{ | |
$endsWithCRLF = $content.EndsWith("`n") | |
if (-not $endsWithCRLF -and -not $_.FullName.Contains("\obj\")) { |
This file contains hidden or 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
open Fake | |
open ProcessHelper | |
open System | |
open System.IO | |
module MSDeployHelper = | |
type MSDeployPackageParams = | |
{ ProjectDir:string | |
PackageFullPath:string | |
Timeout:TimeSpan } |