paket config add-credentials <url> --username <name> --password <password> --verify
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 imageController id = controller { | |
show (fun ctx imageId -> (sprintf "Edit handler - id: %s; imageId %s" id imageId ) |> Controller.text ctx) | |
} | |
let topRouter = router { | |
forwardf "/%s/images" imageController | |
} | |
let app = application { | |
pipe_through endpointPipe |
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
# dotnet --list-sdks # output looks like | |
# 2.1.500 [/usr/local/share/dotnet/sdk] | |
# awk '{print $2"/"$1}' # takes each line from stdin and prints out the 2nd column then "/" then the first column | |
# this gives us [/usr/local/share/dotnet/sdk]/2.1.500 | |
# sed 's/\]//' # replaces the first ']'. ']' has to be escaped with \ | |
# sed 's/\[//' # replaces the first '['. '[' has to be escaped with \ | |
# grep -Ev '2\.2\.102' # matches on 2.2.102 which was the latest SDK installed | |
# -E # enables extended regular expression syntax | |
# -v # inverts the match. So return anything that doesn't match | |
# xargs # allows us to pass standard in as an argument to rm -rf |
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
# Register Microsoft key and feed | |
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb | |
sudo dpkg -i packages-microsoft-prod.deb | |
# Install the .NET SDK | |
sudo add-apt-repository universe | |
sudo apt-get install apt-transport-https | |
sudo apt-get update | |
sudo apt-get install dotnet-sdk-2.2 |
Twitter: @mrjabbott
I'm a software engineer currently working on providing deployment solutions for microservices via FAKE. I've been working with F# since 2014, which is also when I gave my first F# presentation. Since that time I've presented on various F# topics across the country including at Code on the Beach, Twin Cites Code Camp, .NET Fringe, Open F#, and F# Conf. I've also written for the F# Advent Calendar. I'm a co-organizer of the Portland F# User Group. In my "free time" I experiment with new F# projects, and occassionally (not often enough) contribute to F# OSS projects.
Prior to moving to Portland I was also the vice-president, then president, then technology officer for a Louisiana-based non-profit focused on LGBT activism.
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 log p = printfn "expression is %A" p | |
let loggedWorkflow = | |
let x = 42 | |
log x | |
let y = 43 | |
log y | |
let z = x + y // block following let is unfinished. Every expression must return something. | |
log z | |
//return | |
z |
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 now () = System.DateTime.Now | |
let someOtherWork times = async { | |
let rec inner' times current = async { | |
if times = current then | |
printfn "someOtherWork FINISHED" | |
else | |
do! Async.Sleep 1000 | |
let next = current + 1 | |
printfn "someOtherWork step %d @ %s" next (now() |> string) |
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
// ts2fable 0.5.2 | |
module rec Firebase | |
open System | |
open Fable.Core | |
open Fable.Import.JS | |
type [<AllowNullLiteral>] IExports = | |
abstract EmailAuthProvider: EmailAuthProviderStatic | |
abstract EmailAuthProvider_Instance: EmailAuthProvider_InstanceStatic |
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 think I understand apply! | |
Apply is a function that takes an elevated multi parameter functions and partially applies it for you. | |
*) | |
//For example: | |
// usage: printfn "%s" <| sayGood "morning" "Clément" | |
let sayGood = sprintf "Good %s %s" // string -> string -> string |
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
type Result<'a> = | |
| Success of 'a | |
| Failure of string | |
let parseInt x = | |
try | |
System.Int32.Parse(x) |> Success | |
with ex -> ex.Message |> Failure | |
parseInt "hello" |
NewerOlder