Skip to content

Instantly share code, notes, and snippets.

// F# version of https://twitter.com/gsferreira/status/1516827091127394309/
open System
open System.IO
type PotentialProcessingError = StringMissing | StringTooShort
let application (str: string) =
match str with
| str when str.Length < 5 -> Error StringTooShort
@isaacabraham
isaacabraham / 1-nav.html
Last active October 2, 2020 00:20 — forked from CallumVass/nav.fs
<aside class="relative bg-blue-700 lg:self-stretch lg:w-64 w-full shadow-xl flex flex-col">
<div class="p-6 flex justify-between">
<a href="..">
<img class="object-scale-down h-8 lg:h-32" src=".." alt=".. Logo"/>
</a>
<div class="block lg:hidden">
<button id="nav-toggle" class="flex items-center px-3 py-2 border rounded text-white border-white">
<svg class="fill-current h-3 w-3" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<title>Menu</title>
<path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"/>
@isaacabraham
isaacabraham / 16_exercise.fsx
Created July 2, 2018 21:32 — forked from manuelsidler/16_exercise.fsx
Sort subfolders by folder size in F#
open System.IO
type FolderStatistic = { Name : string
Size : int64 }
let calculateFolderSize (folder : string) =
folder
|> Directory.GetFiles
|> Array.sumBy (fun file -> (FileInfo file).Length)
@isaacabraham
isaacabraham / CalculateACICosts.fsx
Created May 6, 2018 16:39 — forked from lukemerrett/CalculateACICosts.fsx
Calculates the cost of an Azure Container Instances container
// Calculates the cost of an Azure Container Instances container
// Using the default Linux container with 1 vCpu and 1.5GB vRAM
[<Measure>] type gb
[<Measure>] type core
[<Measure>] type gbp
[<AutoOpen>]
module Time =
[<Measure>] type sec