Skip to content

Instantly share code, notes, and snippets.

openapi: 3.0.0
info:
title: Clinical Trial Randomization API
version: 1.0.0
paths:
/randomization_methods:
get:
summary: Get available randomization methods
responses:
'200':
@ldziedziul
ldziedziul / README.md
Created September 21, 2022 12:03 — forked from magnetikonline/README.md
Cleanup legacy GitHub Actions workflow runs.

Cleanup legacy GitHub Actions workflow runs

Python utility to delete in bulk all GitHub Actions runs for a given workflow, either current or legacy/since removed. The GitHub UI currently allows removal of individual workflow runs, but this becomes tedious with a bulk of previous runs.

Usage

Create a Personal access token allowing the workflow scope:

image

@ldziedziul
ldziedziul / README.md
Created June 8, 2021 17:48 — forked from m1keil/README.md
Configure Kibana to use SAML with GSuite (Google Apps, GApps, G Suite)

The following worked with Elastic Cloud, Elasticsearch & Kibana v7.6.0. It should be pretty close for other kinds of deployments. Before starting, make sure you have the right license level that allows SAML.

Create SAML App in GSuite:

  • Navigate to the SAML apps section of the admin console
  • Click the Add button and choose to "SETUP MY OWN CUSTOM APP"
  • Write down the Entity ID and download the Idp metadata file
  • Choose application name, description and add logo
  • In the "Service Provider Details" screen add the following:

Just a test of the plantuml inside the markdown file

@startuml component
actor client
node app
database db

db -> app
app -> client
@ldziedziul
ldziedziul / server.py
Created December 28, 2017 23:32 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
ext {
javaLanguageLevel = 1.8
generatedMapperSourcesDir = "${buildDir}/generated-src"
}
configurations {
mapstruct
}
dependencies {
@ldziedziul
ldziedziul / A.java
Created July 18, 2017 13:20
Class size
class A {{
int a;
try {a=0;} finally {
try {a=0;} finally {
try {a=0;} finally {
try {a=0;} finally {
try {a=0;} finally {
try {a=0;} finally {
try {a=0;} finally {
try {a=0;} finally {
class ExceptionPuzzle {
void someMethod() {
//...
}
void someOtherMethod() {
try {
someMethod();
} catch (Exception ex) {
throw ex;
@ldziedziul
ldziedziul / AppWebXml.java
Last active August 29, 2015 14:16
Multiple wars of Spring Boot app on the single Tomcat instance
/*
* AppWebXml.java
*
*/
package pl.dziedziul;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import pl.dziedziul.app.web.Application;
function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));