Skip to content

Instantly share code, notes, and snippets.

View houstonhaynes's full-sized avatar

Houston Haynes houstonhaynes

View GitHub Profile
@adityawarmanfw
adityawarmanfw / duckdb__dim_date.sql
Last active April 23, 2024 09:17
Generate Date Dimension table in DuckDB
WITH generate_date AS (
SELECT CAST(RANGE AS DATE) AS date_key
FROM RANGE(DATE '2009-01-01', DATE '2013-12-31', INTERVAL 1 DAY)
)
SELECT date_key AS date_key,
DAYOFYEAR(date_key) AS day_of_year,
YEARWEEK(date_key) AS week_key,
WEEKOFYEAR(date_key) AS week_of_year,
DAYOFWEEK(date_key) AS day_of_week,
ISODOW(date_key) AS iso_day_of_week,
@TheAngryByrd
TheAngryByrd / program.fs
Last active April 14, 2022 04:29
F# MapGet helper
open System
open Microsoft.AspNetCore.Builder
open Microsoft.Extensions.Hosting
open Microsoft.AspNetCore.Http
open System.Threading.Tasks
let mapGet (pattern : string) handler (app : WebApplication) =
app.MapGet(pattern, (Func<_>(handler))) |> ignore
let mapGetAsync (pattern : string) (handler : HttpContext -> Task) (app : WebApplication) =
@noseratio
noseratio / remove-unwanted-windows11-apps.ps1
Last active May 22, 2024 12:40
Windows 11 autorun resident apps that I have to remove manually
# Teams 2.0 (no work account support yet)
winget uninstall MicrosoftTeams_8wekyb3d8bbwe
# Your Phone
winget uninstall Microsoft.YourPhone_8wekyb3d8bbwe
# Widgets (Web Experience Pack)
winget uninstall MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy
# Cortana

Herein lies my thoughts on what the FSSF should seek to accomplish and why. Ultimately, it comes down to spending the money that we have to further the reach of the F# language. How that gets done could make for some challenging implementation details.

It's a marketplace out there

Like it or not, language adoption is a game in a market.

Java didn't overtake the world in the 90s because it was better than C++. It did it because Oracle pumped hundreds of millions of dollars into marketing efforts to get people to realize that it was more productive than C++. They even took out ads in newspapers.

And other times you don't need explicit marketing because you're the default language used for a platform (kotlin via Android, Swift via iOS) and you get to piggyback on the marketing for that platform instead. C# fills this role for Microsoft's stuff that's .NET-based. Yes, F# can "me too" here, but this is just a tiny drip of adoption (albeit steady).

@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?
@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)
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@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
@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

@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