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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Net.NetworkInformation; | |
using System.Net; | |
namespace AvailablePort | |
{ | |
class Program |
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
(* | |
This script analyzes the dependencies between top level types in a .NET Assembly. | |
It is then used to compare the dependency relationships in some F# projects with those in some C# projects. | |
Note that no attempt has been made to optimize the code yet! | |
REQUIRES: | |
* Mono.Cecil for code analysis | |
From http://www.mono-project.com/Cecil#Download |
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
(* | |
Example of domain-driven design for Checkers | |
Rules from here: https://www.itsyourturn.com/t_helptopic2030.html | |
A SERIES OF SCRATCH DESIGNS | |
*) | |
// As we go through the rules, and learn things, we create a series of designs | |
module Version1 = |
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
namespace HttpClient.FSharp | |
open System | |
open System.Net.Http | |
type HttpMethod = | |
| Post | |
| Put | |
| Delete | |
| Get |
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 getResponse body (cookie: string option) (client:HttpClient) = | |
task { | |
return! | |
Http.createPostRequest Url | |
|> withBody (RequestBody.Xml body) | |
|> fun req -> | |
match cookie with | |
| Some c -> withCookie c req | |
| _ -> req | |
|> Http.execute client |
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
namespace Test | |
module RandomPort = | |
open System | |
open System.Net.NetworkInformation | |
let isFree port = | |
let props = | |
IPGlobalProperties.GetIPGlobalProperties() | |
let tcpListeners = | |
props.GetActiveTcpListeners() |