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
cls | |
Push-Location | |
Set-Location E:\Git\ # edit this path for your location or use ./ | |
Write-Host ("git pull on all directories under " + (Resolve-Path .\).Path) -ForegroundColor Cyan | |
"" | |
Get-ChildItem -Directory -path ./ <# add -Recurse to include all subdirectories recursively #> | ForEach-Object { | |
if (Test-Path ($_.FullName + "/.git") -PathType Container) { | |
Write-Host $_.FullName -NoNewline -ForegroundColor Green | |
Write-Host ">" -NoNewLine -ForegroundColor Gray | |
Write-Host "git pull" -ForegroundColor White |
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
#nullable enable | |
async Task Main() | |
{ | |
// Physical file system interpretation of file system effects | |
var physicalHandler = new PhysicalFileSystemEffectHandler(@"c:\"); | |
// Run test | |
await Test().Run(physicalHandler); | |
} |
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
// NOTE: import this Nuget package: TaskBuilder.fs (written using 2.1.0) | |
// | |
// Tested in LINQPad (hence Dump method usage). | |
open System | |
open System.Collections | |
open System.Collections.Generic | |
open System.Diagnostics | |
open System.Linq | |
open System.Threading |
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
// MailboxProcessor test for comparison against the performance-optimized task-and-channel-based actor impl. here: | |
// | |
// https://gist.github.com/bent-rasmussen/8152df3c842a06acabe219dd877802d5 | |
// | |
// Tested in LINQPad (hence Dump method usage). | |
type Message = | |
| Incr | |
| Not of bool * AsyncReplyChannel<bool> | |
| Counter of AsyncReplyChannel<int> |
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
<Query Kind="Program"> | |
<NuGetReference>Serilog</NuGetReference> | |
<NuGetReference>Serilog.Sinks.LINQPad</NuGetReference> | |
<Namespace>System.Dynamic</Namespace> | |
<Namespace>Serilog</Namespace> | |
</Query> | |
// Just an experiment; you should probably never use this. :-) | |
// Would be nicer with compile-time function creation but not possible atm afaik. |
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
<Query Kind="FSharpProgram"> | |
<NuGetReference>FSharp.Data.Adaptive</NuGetReference> | |
<Namespace>FSharp.Data.Adaptive</Namespace> | |
<Namespace>FSharp.Data.Traceable</Namespace> | |
</Query> | |
// F# - what the F* is this sorcery?! :-) | |
// create a temporary directory |
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
<Query Kind="Program"> | |
<NuGetReference>Observito.Trace.EventSourceFormatter</NuGetReference> | |
<Namespace>Observito.Trace.EventSourceFormatter</Namespace> | |
<Namespace>System.Collections.Immutable</Namespace> | |
<Namespace>System.Diagnostics.Tracing</Namespace> | |
</Query> | |
#nullable enable | |
void Main() |
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
<Query Kind="Statements"> | |
<Namespace>System.Net.Http</Namespace> | |
<Namespace>System.Threading.Tasks</Namespace> | |
<Namespace>System.Dynamic</Namespace> | |
</Query> | |
await TestAsync("Foo", http => http.GetStringAsync("http://www.google.com/"), HttpFormatOptions.Verbose); | |
static object Title(string message, bool isError = false) |
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
// Compile-time error on contradictive conditional compilation symbols. | |
// Make conditional compilation symbols form a discriminated union. | |
#if (SITE_DEV && SITE_TEST) | |
§"Contradictive conditional compilation symbols" | |
#endif |
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
/// Equatable operators - avoid boxing operands when comparing structs. | |
/// Source: https://github.com/dotnet/fsharp/issues/526#issuecomment-119755563 | |
module EquatableOperators = | |
let inline eq<'a when 'a :> System.IEquatable<'a>> (x:'a) (y:'a) = x.Equals y | |
let inline (==) x y = eq x y | |
let inline (!=) x y = not (eq x y) | |
/// We get a fair warning that it's odd that we impl. custom equality | |
/// when we deny the equality operator. | |
[<Struct; NoEquality; NoComparison>] |
OlderNewer