Skip to content

Instantly share code, notes, and snippets.

View AlexZeitler's full-sized avatar
👷‍♂️
Building stuff

Alexander Zeitler AlexZeitler

👷‍♂️
Building stuff
View GitHub Profile
namespace Infrastructure
open System.Text.Encodings.Web
open System.Text.Json
open System.Text.Json.Serialization
[<RequireQualifiedAccess>]
module JsonSerializer =
let private setupOptions (options: JsonSerializerOptions) =
options.PropertyNamingPolicy <- JsonNamingPolicy.CamelCase
@AlexZeitler
AlexZeitler / Readme.md
Created January 4, 2021 15:35 — forked from skorfmann/Readme.md
Stub Lambda Functions in your CDK Stack

Stubbing Lambda Functions in your CDK Stack

Given you have a stack with one or more Lambda functions (e.g. as part of a Step Functions state machine), it can be pretty useful to stub long running parts with a known response.

This makes use of cdk Aspects, which allows modifying all or a filtered subsset of resources for a given scope (Stack, Construct).

In addition this leverages raw overrides to remove the original code of the Lambda function.

Please note, that the stub has to be in Python or NodeJS, since inlining code is only supported by those runtimes.

@AlexZeitler
AlexZeitler / event-sourced-user.fsx
Created December 29, 2020 15:34 — forked from akhansari/event-sourced-user.fsx
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
@AlexZeitler
AlexZeitler / App.fs
Created June 12, 2020 12:43 — forked from aspnetde/App.fs
Feliz – MVU with React Function Components
module App
open Elmish
type State =
{ CurrentUser: string option }
type Msg =
| SignIn of string
| SignOut

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
@AlexZeitler
AlexZeitler / siren_api.yml
Created September 20, 2019 19:19 — forked from kevinswiber/siren_api.yml
Siren definitions for Open API Specification
swagger: '2.0'
info:
title: Siren API
description: Template for a Siren API
version: '0.1.0'
schemes:
- http
- https
basePath: /
produces:
'use strict';
class Abstract {
// A static abstract method.
static foo() {
if (this === Abstract) {
// Error Type 2. Abstract methods can not be called directly.
throw new TypeError("Can not call static abstract method foo.");
} else if (this.foo === Abstract.foo) {
// Error Type 3. The child has not implemented this method.
throw new TypeError("Please implement static abstract method foo.");
@AlexZeitler
AlexZeitler / ACCESS_ELASTIC.md
Created July 12, 2018 13:59 — forked from rochacbruno/ACCESS_ELASTIC.md
Docker-compose wait-to-start

When unsing docker compose you can have a problem with the order of dependent linked containers

The solution is to start a script which tries to access a service and waits until it gets ready before loading your program

@AlexZeitler
AlexZeitler / pipeline.gdsl
Created July 12, 2018 11:45 — forked from ggarcia24/pipeline.gdsl
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
@AlexZeitler
AlexZeitler / .gitlab-ci.yml
Created July 11, 2018 22:28 — forked from thornbill/.gitlab-ci.yml
Example Node GitLab CI Yamlfile
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:6
before_script:
- npm install
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache: