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
@aspnetde
aspnetde / App.fs
Last active February 13, 2022 21:33
Feliz – MVU with React Function Components
module App
open Elmish
type State =
{ CurrentUser: string option }
type Msg =
| SignIn of string
| SignOut
@goeh
goeh / set-keycloak-client-secret.groovy
Created November 29, 2019 12:00
Inject client secrets from a local file into a Keycloak Realm Export (JSON) file
import groovy.json.JsonSlurper
import groovy.json.JsonOutput
def jsonSlurper = new JsonSlurper()
def secrets = jsonSlurper.parse(new File(args[1] ?: "secrets.json")).clients.inject([:]) { map, c -> map[c.client] = c.secret; map }
def realm = jsonSlurper.parse(new File(args[0]))
for(client in realm.clients) {
if(secrets[client.clientId]) {
@kevinswiber
kevinswiber / siren_api.yml
Last active September 7, 2022 21:02
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:
@akhansari
akhansari / event-sourced-user.fsx
Last active December 16, 2022 00:09
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

Tenant Bridges

This document defines a mechanism to establish multiplexed, platform-level information flow between the tenant scopes of different, multitenant platform-as-a-service (PaaS) or software-as-a-service (SaaS) systems. In particular, this specification introduces the concept of a tenant-bridging “channel” that is established as a communication link between the tenants of two cooperating platforms. While the mechanism defined here is quite simple, the solved problem requires quite a bit of context setting:

What are we solving?

The "cooperating platforms" are commonly from different cloud service vendors and are addressing different customer scenarios. Examples might be enterprise resource planning (ERP) on one side and general-purpose application hosting on the other. A scenario to enable might be for the ERP system to be easily extensible with event-driven serverless functionality hosted on the other platform.

In such a scenario, it will likely be the same customer organization who is a te

@jhewlett
jhewlett / HttpClient.FSharp.fs
Last active May 14, 2023 15:42
Functional wrapper around System.Net.Http.HttpClient. Inspired in part by Http.fs (https://github.com/haf/Http.fs) and FSharp.Data (https://fsharp.github.io/FSharp.Data/library/Http.html)
namespace HttpClient.FSharp
open System
open System.Net.Http
type HttpMethod =
| Post
| Put
| Delete
| Get
@marentdev
marentdev / brevo.ts
Created July 14, 2023 13:20
[Node.JS] [TypeScript] [Axios] Brevo Class API using swagger-typescript-api
/* eslint-disable */
/* tslint:disable */
/*
* ---------------------------------------------------------------
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
* ## ##
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
@zcaceres
zcaceres / Error-Handling-Patterns-Express.md
Last active August 3, 2023 13:40
error handling patterns in Express

Handling Errors

Express.js makes it a breeze to handle errors in your routes.

Express lets you centralizes your error-handling through middleware.

Let's look at patterns for how to get the most out of your error-handling.

First, our error-handling middleware looks like this:

@michaelcox
michaelcox / SpecRunner.js
Last active January 11, 2024 06:05
Browser Unit Testing with Backbone Mocha Chai and RequireJS
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
"use client";
import {
Dialog,
DialogContent,
DialogTitle,
DialogTrigger
} from "@/components/ui/dialog";
import useDragDrop from "@/hooks/useDragDrop";
import { cn, formatBytes } from "@/lib/utils";