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
@AlexZeitler
AlexZeitler / FanOutSample.cs
Created April 12, 2024 14:41 — forked from flew2bits/FanOutSample.cs
FanOut sample for Dates
using Marten;
using Marten.Events.Projections;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
var builder = Host.CreateApplicationBuilder();
builder.Services.AddMarten(opt => {
opt.Connection(builder.Configuration.GetConnectionString("Marten") ?? "Host=localhost; Port=5433; User Id=postgres; Password=pgsql");
opt.Projections.Add<WorkByDayProjection>(ProjectionLifecycle.Inline);
@AlexZeitler
AlexZeitler / fetch-disposable-email-domains-and-write-to-postgres.sh
Last active November 24, 2023 07:27
Throw away / disposable email domain list with Postgres import
#!/bin/bash
# download the files
curl -o file1.txt https://gist.githubusercontent.com/ammarshah/f5c2624d767f91a7cbdc4e54db8dd0bf/raw/660fd949eba09c0b86574d9d3aa0f2137161fc7c/all_email_provider_domains.txt
curl -o file2.js.txt https://gist.githubusercontent.com/Evavic44/8348e357935d09f79d4c1616b0c20408/raw/72996e053cbaf39de9cf16d304d2c237184f96d2/domain.js
curl -o file3.txt https://raw.githubusercontent.com/disposable/disposable-email-domains/master/domains.txt
# remove first and last line, remove quotes, commas and spaces
sed -e '1d;$d' file2.js.txt | awk '{ gsub(/["\, ]/, ""); print }' > file2.txt
@AlexZeitler
AlexZeitler / brevo.ts
Created July 14, 2023 15:03 — forked from marentdev/brevo.ts
[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 ##
* ---------------------------------------------------------------
*/
@AlexZeitler
AlexZeitler / install.txt
Last active February 1, 2023 02:41 — forked from tkfm-yamaguchi/lang.map.diff
source-highlight's language definition file for YAML
apt-get install source-highlight
# update .bashrc / .zshrc:
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=' -R '
# add yaml support as shown in lang.map.diff
@AlexZeitler
AlexZeitler / MartenProjections.cs
Last active October 13, 2022 07:14
MartenDb projections
public abstract class AppUser
{
public Guid Id { get; set; }
}
public class RegisteredUser : AppUser
{
public void Apply(Registered registered)
{
Username = registered.Username;
@AlexZeitler
AlexZeitler / test.js
Last active October 4, 2022 21:50
fs.stat with async/await in Node.js 8
const asset = require('assert');
const fs = require('fs');
const { promisify } = require('util');
const stat = promisify(fs.stat);
describe('async stat', () => {
it('should not throw if file does exist', async () => {
try {
const stats = await stat(path.join('path', 'to', 'existingfile.txt'));
assert.notEqual(stats, null);
@AlexZeitler
AlexZeitler / HelloWorldController.cs
Created April 27, 2013 20:38
A super simple "Hello World" Controller for ASP.NET Web API
using System.Web.Http;
namespace KatanaWebApiAndStaticConsole {
public class HelloWorldController : ApiController {
public string Get() {
return "Hello World";
}
}
}
@AlexZeitler
AlexZeitler / Rider
Created December 31, 2021 13:29
Rider commandline launcher
#!/usr/bin/env python
# Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import os
import socket
import struct
import sys
import traceback
# See com.intellij.idea.SocketLock for the server side of this interface.

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

@AlexZeitler
AlexZeitler / .editorconfig
Last active August 30, 2021 11:33
TypeScript + Node + VS Code Project settings
root = false
[**/**.yml]
indent_style = space
indent_size = 2
insert_final_newline = true
[**/**.ts]
indent_style = space
indent_size = 2