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
set-executionpolicy unrestricted -s cu | |
$browser = New-Object System.Net.WebClient | |
$browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials | |
iex ($browser).downloadstring('https://get.scoop.sh') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// running in fable.io/repl to check performance on 32 bit win 7 with chrome | |
type Agent<'T> = MailboxProcessor<'T> | |
let agent = | |
Agent.Start(fun inbox -> | |
async { while true do | |
let! msg = inbox.Receive() | |
printfn "got message '%s'" msg } ) | |
agent.Post "hello" | |
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
import java.sql.* | |
data class eProgProv(val AcaProg: String, val ProvName: String) | |
val eProgProvs = mutableListOf<eProgProv>() | |
fun inserteProgProv(cn: Connection, e: eProgProv ) { | |
val writeStmt = cn.createStatement() | |
fun escStr(s:String) = s.replace("'", "''") |
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
// no pattern matching but there are when clauses that return values | |
fun int2Bool (i:Int): Boolean = | |
when (i) { | |
0 -> false | |
else -> true | |
} | |
fun bool2Int (b:Boolean): Int = // so you can put functions before or after use - not order dependent | |
when (b) { | |
true -> 1 |
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
# too easy | |
file.size(list.files("c:\\users\\bohdans\\.atom", recursive=T, include.dirs = F, full.names = T)) |
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
// 12 step cold-hot colour scale from http://geog.uoregon.edu/datagraphics/color_scales.htm | |
let rowColourClass (x:double) (min:double) (max:double) = | |
let idx = | |
match x with | |
| x when x > max -> 0 | |
| x when x < min -> 12 | |
| _ -> (int)(Math.Round((x - min)/((max - min)/12.))) | |
[|"#002aff"; "#1965ff"; "#3299ff"; "#65ccff"; "#99edff"; "#ccffff"; "#ffffcc"; "#ffee99"; "#ffcc65"; "#ff9932"; "#ff6619"; "#ff2a00"|] | |
|> Array.rev | |
|> fun a -> a.[idx] |
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 like this active pattern stuff | |
open System.Globalization | |
let (|ShortDate|_|) s = | |
match DateTime.TryParseExact(s, "ddMMMyyyy", CultureInfo.InvariantCulture, DateTimeStyles.None) with | |
| true, d -> Some d | |
| _ -> None | |
let (|LongDate|_|) s = |
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
argu.5.1.0.nupkg | |
fake.5.2.0.nupkg | |
consoletables.2.2.0.nupkg | |
dapper.1.50.5.nupkg | |
dotnet-saturn.0.7.1.nupkg | |
fsharp.core.4.5.0.nupkg | |
giraffe.1.1.0.nupkg | |
hopac.0.3.23.nupkg | |
http.fs.5.3.0.nupkg | |
microsoft.aspnetcore.2.1.2.nupkg |
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
First should think about this: https://mangelmaxime.github.io/Fulma/#fulma/components/modal | |
But otherwise... | |
In NarrativeModal.fs | |
module Client.NarrativeModal | |
open System | |
open Fable.Core | |
open Fable.Core.JsInterop |