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 parse (buffer : byte []) = | |
try | |
JsonSerializer.DeserializeAsync<'T>(IO.MemoryStream(buffer)) | |
|> Async.AwaitTask | |
|> Some | |
with _ -> None |
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
module Socket | |
open Microsoft.AspNetCore.SignalR | |
open Microsoft.AspNetCore.SignalR.Client | |
open Microsoft.AspNetCore.Sockets | |
let x = HubConnectionBuilder() | |
.WithUrl("http://socket-stage.bittrex.com/signalr") |
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
module WebsocketHelpers = | |
open System | |
open System.Net.WebSockets | |
open System.Threading | |
open Hopac | |
let readMessage messageType (stream : #IO.Stream) (socket : WebSocket) = job { | |
let buffer = new ArraySegment<Byte>( Array.create (1500) Byte.MinValue) | |
let rec readTillEnd' () = job { | |
let! (result : WebSocketReceiveResult) = socket.ReceiveAsync(buffer,CancellationToken.None) |
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
module Bittrex | |
open Asset | |
open Bittrex.Net | |
open Deedle | |
let internal rest = new BittrexClient() | |
let internal webSockets = new BittrexSocketClient() | |
let marketHistory (pair : AssetPair) = |
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 | |
let (+) x y = Checked.(+) x y | |
let number = Random().Next() | |
let rec guess (lower, upper) = | |
let x = (lower + upper) / 2 | |
if number > x then | |
guess (x, upper) |
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
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ oc project test-ci-openshift-no-fim | |
Now using project "test-ci-openshift-no-fim" on server "https://openshift-dev.cern.ch:443". | |
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ | |
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ | |
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ oc create sa other-admin | |
serviceaccount "other-admin" created | |
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ oc policy add-role-to-user admin system:serviceaccounts:test-devforumci-preview:other-admin | |
role "admin" added: "system:serviceaccounts:test-devforumci-preview:other-admin" | |
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ oc new-app --token=$(oc sa get-token other-admin) registry.access.redhat.com/dotnet/dotnet-20-rhel7~https://gitlab.cern.ch/wkulma/devforum | |
--> Found Docker image 9c4630d (2 weeks old) from registry.access.redhat.com for "registry.access.redhat.com/dotnet/dotnet-20-rhel7" |
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
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ oc project test-devforumci-preview | |
Now using project "test-devforumci-preview" on server "https://openshift-dev.cern.ch:443". | |
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ oc create sa other-admin | |
serviceaccount "other-admin" created | |
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ oc policy add-role-to-user admin system:serviceaccounts:test-devforumci:other-admin | |
role "admin" added: "system:serviceaccounts:test-devforumci:other-admin" | |
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ oc new-app --token=$(oc sa get-token other-admin) registry.access.redhat.com/dotnet/dotnet-20-rhel7~https://gitlab.cern.ch/wkulma/devforum | |
--> Found Docker image 9c4630d (2 weeks old) from registry.access.redhat.com for "registry.access.redhat.com/dotnet/dotnet-20-rhel7" | |
.NET Core 2.0 |
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
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ oc status | |
In project test-devforumci on server https://openshift-dev.cern.ch:443 | |
You have no services, deployment configs, or build configs. | |
Run 'oc new-app' to create an application. | |
wojtek@pcuds54:~/Desktop/smieci/fsharp/fsharponacci$ oc get sa | |
NAME SECRETS AGE | |
builder 2 2d | |
default 2 2d | |
deployer 2 2d |
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 rec fib = function | |
| 0L | 1L as n -> n | |
| n -> (fib (n - 1L) + fib (n - 2L)) | |
let memoize f = | |
let memo = ref Map.empty | |
fun arg -> | |
if Map.containsKey arg !memo then Map.find arg !memo | |
else | |
let result = f arg |
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
module Program | |
open Chiron | |
open Suave | |
open Suave.Filters | |
open Suave.Json | |
open Suave.Operators | |
open Suave.Successful | |
NewerOlder