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
[<AutoOpen>] | |
module JsonExtensions = | |
open System | |
open Fleece | |
open Fleece.Operators | |
open FSharpPlus | |
open System.Globalization | |
type FromJSONClass with |
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
Verifying that +ascjones is my Bitcoin username. You can send me #bitcoin here: https://onename.io/ascjones |
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
open System | |
// THE MODEL represents only allowed states | |
// ======================================== | |
type Game = | |
{ F1 : Frame; F2 : Frame; F3 : Frame; F4 : Frame; F5 : Frame; F6 : Frame; F7 : Frame; F8 : Frame; F9 : Frame; F10 : FinalFrame } // todo: add extra frames, and FinalFrame type? | |
and Frame = | |
| Strike | |
| Spare of PinCount |
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
module EventStoreHelpers = | |
open System | |
open System.Net | |
open EventStore.ClientAPI | |
let inline private (!>) (x:^a) : ^b = ((^a or ^b) : (static member op_Implicit : ^a -> ^b) x) | |
let private dnsLookup (host : string) = | |
let hostEntry = Dns.GetHostEntry(host) |
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
function prompt { | |
# Admin ? | |
if( ( | |
New-Object Security.Principal.WindowsPrincipal ( | |
[Security.Principal.WindowsIdentity]::GetCurrent()) | |
).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) | |
{ | |
# Admin-mark in WindowTitle | |
$Host.UI.RawUI.WindowTitle = "[Admin] " + $Host.UI.RawUI.WindowTitle | |
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
interface IFin | |
{ | |
int Ordinal { get; } | |
} | |
class Fin3 { } | |
class Fin2 : Fin3 { } | |
class Fin1 : Fin2 { } | |
class Fin0 : Fin1 { } | |
class Foo |
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
class YesOrNo<TState> | |
{ | |
private readonly TState state; | |
private readonly bool keepGoing; | |
public bool Success { get { return keepGoing; } } | |
public YesOrNo(TState state = default (TState), bool keepGoing = true) | |
{ | |
this.state = state; |
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 stripZeros d = d / 1.000000000000000000000000000000000M | |
// > stripZeros 1.5000M;; | |
// val it : decimal = 1.5M |
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
class ProgressBar | |
{ | |
private const char Start = '['; | |
private const char End = ']'; | |
private const char InProgress = '>'; | |
private const char Done = '-'; | |
private readonly int totalSize; | |
private readonly int progressLength; | |
private readonly int chunkSize; |
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
public static class EventStoreHelpers | |
{ | |
public static IEnumerable<T> ReadAllStreamEventsForward<T>(this IEventStoreConnection conn, string streamName, Func<RecordedEvent, T> createEvent, int pageSize) | |
{ | |
StreamEventsSlice currentSlice; | |
var nextSliceStart = StreamPosition.Start; | |
do | |
{ | |
var task = conn.ReadStreamEventsForwardAsync(streamName, nextSliceStart, pageSize, true); task.Wait(); | |
currentSlice = task.Result; |
OlderNewer