-
Use Onion architecture
- Dependencies go inwards. That is, the Core domain doesn't know about outside layers
-
Use pipeline model to implement workflows/use-cases/stories
- Business logic makes decisions
- IO does storage with minimal logic
- Keep Business logic and IO separate
-
Keep IO at edges
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
type Json = | |
| Null | |
| Bool of bool | |
| Number of float | |
| String of string | |
| Array of Json list | |
| Object of (string * Json) list | |
type Bracket = Open | Close |
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 rec Dat | |
open Browser.Types | |
open Fable.Core | |
open System | |
[<ImportAll("dat.gui")>] | |
let exports: IExports = jsNative | |
[<AllowNullLiteral>] |
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 Huffman | |
open System | |
open System.IO | |
type bit = bool | |
type path = bit list | |
type BinaryTreeNode = | |
| Leaf of byte * frequency:int |
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
/// <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); |
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:
- Create an account in Azure (or use an existing one)
- Create a resource group (or use an existing one)
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
/// <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); |
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
(* | |
An immutable R-Tree implementation in F#. | |
Based on: https://github.com/swimos/swim-rust/tree/main/swim_utilities/swim_rtree (licensed on Apache 2.0) | |
Author: Bartosz Sypytkowski <b.sypytkowski at gmail.com> | |
*) | |
namespace Demos.RTree |
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 SharedMemory | |
open MBrace.FsPickler | |
module Rpc = | |
type RpcContext<'command, 'message> = | |
{ name: string; buffer: RpcBuffer; post: 'command -> Async<'message>} with | |
interface IDisposable with | |
member this.Dispose() = this.buffer.Dispose() | |
let createHost name (handler : 'command -> Async<'message>) = |
NewerOlder