Skip to content

Instantly share code, notes, and snippets.

View otto-gebb's full-sized avatar

otto-gebb

  • Karlsruhe
View GitHub Profile
@x-yuri
x-yuri / Generating SSL certificates.md
Last active July 24, 2024 12:03
Generating SSL certificates

Generating SSL certificates

req:

openssl req -x509 -subj /CN=root.yourdomain.com -days 3650 -noenc \
    -out root.crt -keyout root.key
  # -x509 - generate a certificate
  # -subj - subject
  # -days - validity period
@Savelenko
Savelenko / Mendler.fs
Created April 27, 2023 10:01
Pretty printing trees in F# using a Mendler-style catamorphism
/// Non-empty trees.
type Tree<'a> = TreeNode of 'a * List<Tree<'a>>
/// Syntactic simulation of the `Tree` base functor.
let (|TreeNode_|) (a, ys) = (a, ys)
/// Regular catamorphism for `Tree`.
let rec cata f (TreeNode (a, ts)) = f a (ts |> List.map (cata f))
/// Compute a result from a single `Tree` node while having access to a function which computes a result from a single
//open System.IO
//Directory.GetFiles(@"C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\5.0.11", "*.dll")
//|> Array.map (fun f -> $"""#r "{Path.GetFileName(f)}" """)
//|> Array.iter (printfn "%s")
#I @"C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\5.0.11"
#r "Microsoft.AspNetCore.Antiforgery.dll"
#r "Microsoft.AspNetCore.Authentication.Abstractions.dll"
@vrom911
vrom911 / ChrisPenner.hs
Created October 19, 2020 20:43
My solutions to the Chris Penner's 'Silly Job Interview Questions In Haskell' post: https://chrispenner.ca/posts/interview
module ChrisPenner where
import Data.Array ((!))
import Data.Foldable (for_, foldl', maximumBy)
import Data.List (sort)
import Data.Map.Strict (Map)
import Data.Ord (comparing)
import qualified Data.Array as A
import qualified Data.Map.Strict as Map
@object
object / AkklingPersistence.txt
Created May 20, 2018 07:29
Akkling persistence example
1. Yaml configuration section
<?xml version="1.0" encoding="utf-8"?>
<akka.persistence>
<hocon>
<![CDATA[
akka {
persistence{
query.journal.sql {
max-buffer-size = 10000

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@swlaschin
swlaschin / ConstrainedTypesExamples.fsx
Last active July 23, 2024 10:31
Examples of creating constrained types in F#
// General hints on defining types with constraints or invariants
//
// Just as in C#, use a private constructor
// and expose "factory" methods that enforce the constraints
//
// In F#, only classes can have private constructors with public members.
//
// If you want to use the record and DU types, the whole type becomes
// private, which means that you also need to provide:
// * a constructor function ("create").