Skip to content

Instantly share code, notes, and snippets.

View Mastermindzh's full-sized avatar
💭
Happily coding all day every day.

Rick van Lieshout Mastermindzh

💭
Happily coding all day every day.
View GitHub Profile
#!/usr/bin/env bash
# arch-security-check.sh
# Always prints commands before executing.
# Uses sudo for privileged probes and will prompt if needed.
# Optional: --json to output a machine-readable summary.
set -u
set -o pipefail # Exit on any command in pipeline failure
IFS=$'\n\t'
@Mastermindzh
Mastermindzh / Readme.md
Last active May 23, 2024 06:54
Postgrest stack (swagger, pgadmin, http extension)
# Kafka
---
version: "2"
services:
kafbat-ui:
container_name: kafbat-ui
image: ghcr.io/kafbat/kafka-ui:latest
ports:
- 8080:8080
environment:
@Mastermindzh
Mastermindzh / getCustomIsoString.ts
Created July 7, 2021 11:37
Custom isostring implementation for colleagues
/**
* Given a JS date returns a valid ISO date string with offset
*
* const myDate = new Date();
* console.log(getCustomIsoString(myDate));
* > 2021-07-07T13:35:18+02:00
*
*/
const getCustomIsoString = (date: Date) => {
/**
@Mastermindzh
Mastermindzh / async-example-for-colleague.ts
Created November 3, 2020 08:59
An example showing how an async foreach on an array could work. Also shows the general concept of "waiting to continue" or "async execution"
/**
* log a message with an iso datetime
* @param {*} msg msg to log
*/
const log = (msg) => {
console.log(msg, new Date().toISOString());
};
/**
* sleep for a certain amount of ms
import { Injectable } from "@angular/core";
import { Store } from "@ngxs/store";
import { first } from "rxjs/operators";
import { Observable, Subject } from "rxjs";
import { HttpClient, HttpResponse } from "@angular/common/http";
import * as resolvePath from "object-resolve-path";
@Injectable({
providedIn: "root",
@Mastermindzh
Mastermindzh / typescript-inheritance-and-interfaces.ts
Created October 25, 2018 08:28
typescript inheritance and interfaces - I explained the concepts to a colleague and this is the resulting code.
/**
* interface which specifies all properties of a living being
*/
interface IlivingBeing {
name: string;
}
/**
* Interface which specifies the bark method
*/
@Mastermindzh
Mastermindzh / redux-promise-middleware.spec.js
Created June 5, 2018 14:28
redux-promise-middleware tests
import { PENDING, FULFILLED, REJECTED } from "redux-promise-middleware";
export default function handleReduxPromiseMiddleware(
reducer,
actionType,
initialState,
statusKey,
meta = {}
) {
it(`should handle ${PENDING} (redux-promise-middleware)`, () => {
@Mastermindzh
Mastermindzh / cloudSettings
Last active March 4, 2024 10:01
Visual Studio Code Settings Sync Gist
{"lastUpload":"2024-03-04T10:01:33.976Z","extensionVersion":"v3.4.3"}