Let's say you have implemented a small data pipeline library to replace LINQ.
module TrivialStream =
type Receiver<'T> = 'T -> unit
type Stream<'T> = Receiver<'T> -> unit
module Details =
(* | |
Simulation of the Lorentz attractor, using Fable. | |
If you want to see this code in action, just copy this code into the Fable REPL: | |
https://fable.io/repl/ | |
*) | |
module App | |
open Elmish | |
open Elmish.React |
// ts2fable 0.0.0 | |
namespace rec Fable.Three | |
open System | |
open Fable.Core | |
open Fable.Import.JS | |
open Fable.Import.Browser | |
module Three = | |
open System | |
open System.IO | |
open System.Diagnostics | |
let downloadDependencies deps = | |
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | |
if not (File.Exists "paket.exe") then | |
async { | |
let url = "http://fsprojects.github.io/Paket/stable" |
namespace GhFsharpTest | |
open Grasshopper.Kernel | |
open Grasshopper.Kernel.Types | |
type Priority() = | |
inherit GH_AssemblyPriority() | |
override u.PriorityLoad() = | |
GH_LoadingInstruction.Proceed |
Last week I spent a lot of time trying to deploy an F# ASP.NET Core app (a Giraffe app, specifically) to Azure because the information to complete all the steps was scattered in several places. So I'm writing this hopefully it will save the pain to others :)
The following steps are mostly taken from this guide and it's only necessary to do them once:
/// <summary> | |
/// Extract all family type properties data | |
/// </summary> | |
/// <param name="app"></param> | |
private MultiValueDictionary<string, Tuple<string, string>> ExtractFamilyParameterInfo(Application app) | |
{ | |
//Open Revit Family File in a separate document | |
var doc = app.OpenDocumentFile(FamilyPath); |
#I __SOURCE_DIRECTORY__ | |
#r "libs/NuGet.Core.dll" | |
#r "System.Xml.Linq" | |
open NuGet | |
open System | |
open System.IO | |
module NuGet = |
/// <summary> | |
/// Run Revit commands using Win32 API | |
/// </summary> | |
public class Win32Api | |
{ | |
[DllImport("user32.dll")] | |
private static extern IntPtr GetForegroundWindow(); | |
[DllImport("user32.dll")] | |
static extern bool SetFocus(IntPtr hWnd); |
open System.IO | |
open System.Collections.Concurrent | |
// A Merkle tree for a file system might look like this | |
// PASTE!! | |
let isDirectory(path:string) = | |
let attr = File.GetAttributes(path) | |
attr.HasFlag(FileAttributes.Directory) |