Skip to content

Instantly share code, notes, and snippets.

View otto-gebb's full-sized avatar

otto-gebb

  • Karlsruhe
View GitHub Profile
@agokrani
agokrani / claude-code-prompt.txt
Last active September 1, 2025 08:51
Claude Code System Prompt
'system':
[
{
'type': 'text',
'text': "You are Claude Code, Anthropic's official CLI for Claude.",
'cache_control': {'type': 'ephemeral'}
},
{
'type': 'text',
'text': 'You are an interactive CLI tool that helps users with software engineering tasks.
@x-yuri
x-yuri / Generating SSL certificates.md
Last active April 28, 2025 00:50
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
@Savelenko
Savelenko / Explanation.fs
Last active January 7, 2025 17:05
Ghosts of departed proofs using F#
module Explanation
(*
So what is going on in module `ValidatedSum`? This is a more detailed explanation and a piece of guidance. The goal of
all of this is being able to define libraries with "safe" APIs. To be more precise, "safe" means that functions with
interesting preconditions can only be used (applied) such that the precondition is guaranteed to hold; it is impossible
to apply a function on inputs for which the precondition does not hold.
A well-known example is `List.head`. The precondition of applying this function to list `l` is that `l` is non-empty. If
//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
@ld100
ld100 / ArchLinuxWSL2.md
Last active September 3, 2025 17:01
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@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
@valyala
valyala / README.md
Last active August 11, 2025 18:57
Optimizing postgresql table for more than 100K inserts per second

Optimizing postgresql table for more than 100K inserts per second

  • Create UNLOGGED table. This reduces the amount of data written to persistent storage by up to 2x.
  • Set WITH (autovacuum_enabled=false) on the table. This saves CPU time and IO bandwidth on useless vacuuming of the table (since we never DELETE or UPDATE the table).
  • Insert rows with COPY FROM STDIN. This is the fastest possible approach to insert rows into table.
  • Minimize the number of indexes in the table, since they slow down inserts. Usually an index on time timestamp with time zone is enough.
  • Add synchronous_commit = off to postgresql.conf.
  • Use table inheritance for fast removal of old data: