Skip to content

Instantly share code, notes, and snippets.

View houstonhaynes's full-sized avatar

Houston Haynes houstonhaynes

View GitHub Profile
@odytrice
odytrice / fsharp-tutorial.fs
Last active March 3, 2024 04:32
F# Code Samples
// This sample will guide you through elements of the F# language.
//
// *******************************************************************************************************
// To execute the code in F# Interactive, highlight a section of code and press Alt-Enter in Windows or
// Ctrl-Enter Mac, or right-click and select "Send Selection to F# Interactive".
// You can open the F# Interactive Window from the "View" menu.
// *******************************************************************************************************
// For more about F#, see:
@ninjarobot
ninjarobot / AzureFunctionSecret.fs
Created January 5, 2018 20:58
Example of retrieving a secret from an F# Azure Function App
namespace AzurefnSecret
open Microsoft.Azure.KeyVault
open Microsoft.IdentityModel.Clients.ActiveDirectory
module Example =
let getSecret (appKeyDescription:string) (appKeyValue:string) (secretUrl:string) =
async {
use keyVault = new KeyVaultClient(fun authority resource (_:string) ->
async {
@JordanMarr
JordanMarr / MainWindow.xaml
Last active January 16, 2022 16:28
Example of Using Elmish.WPF + Rx
<Window x:Class="ConsoleApp.Wpf.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ConsoleApp.Wpf.Views"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid Margin="0,25,0,0">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top">
@akhansari
akhansari / event-sourced-user.fsx
Last active December 16, 2022 00:09
F# : Event Sourcing in a nutshell
// ========= Event Sourcing in a nutshell
(*
FriendlyName: string
Aggregate friendly name.
Initial: 'State
Initial (empty) state we will start with.
Decide: 'Command -> 'State -> 'Event list
@ianrussellsoftwarepark
ianrussellsoftwarepark / ComputationExpressions.fs
Created August 8, 2020 14:47
Code for post 12 of Intro to FP in F# series
namespace ComputationExpression
module AsyncResultDemo =
open System
open FsToolkit.ErrorHandling
type AuthError =
| UserBannedOrSuspended
@kekru
kekru / 01-Openshift3-WSL2.md
Last active March 30, 2024 06:51
Openshift 3.11 in WSL2

Running Openshift 3.11 inside WSL2

This is not running yet, but nearly almost

Install WSL2 and oc client

First install a WSL2 with Ubuntu 20.04 as described at Microsoft

Enter wsl shell

@akhansari
akhansari / onion-1.fs
Last active February 22, 2023 16:51
F# : Onion architecture in a nutshell
// 1. pure, don't think about IO at all
module Domain =
let add x y = x + y
// 2. think about IO but not its implementation
module App =
let add (getX: unit -> Async<int32>) y =
async {
let! x = getX ()
return Domain.add x y
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@Savelenko
Savelenko / Program.fs
Last active June 13, 2021 14:41
Advanced(?) domain-driven design in F#
[<EntryPoint>]
let main argv =
printfn "Should be zero (netWeight emptyPallet): %A" Stock.shouldBeZero
printfn "harvesterPartsWeight: %A" Stock.harvesterPartsWeight
printfn "grossWeight harvesterParts: %A" (Stock.grossWeight Stock.harvesterParts)
printfn "grossWeight emptyPallet: %A" (Stock.grossWeight Stock.emptyPallet)
printfn "netWeight harvesterParts: %A" (Stock.netWeight Stock.harvesterParts)
printfn "value harvesterParts: %A" (Stock.value Stock.harvesterParts)
printfn "boxLabels harvesterParts: %A" (Stock.boxLabels Stock.harvesterParts)
printfn "boxLabels emptyPallet: %A" (Stock.boxLabels Stock.emptyPallet)
@TheAngryByrd
TheAngryByrd / dotnet-oss-documentation-tools.md
Created October 31, 2021 19:55
.NET OSS documentation tools

.NET OSS Documentation tools

Criteria

  • What dependencies does it require? (npm, netfx, dotnet-core)
  • Does it seem to be maintained?
  • Does it have a good update story?
  • How easy is it to get started? (good tutorial, templating)
  • Can I change the structure easily to fit the divio structure?
  • Does it support search? Is the search useful?