Skip to content

Instantly share code, notes, and snippets.

@Fredx87
Fredx87 / index.ts
Created January 6, 2024 22:23
@effect/platform @effect/schema Cloudflare Worker example
import * as Http from "@effect/platform/HttpServer";
import { Effect } from "effect";
import * as S from "@effect/schema/Schema";
const HttpLive = Http.router.empty.pipe(
Http.router.get("/", Http.response.text("Hello World")),
Http.router.get(
"/todo/:id",
Effect.gen(function* ($) {
const { id } = yield* $(
@Fredx87
Fredx87 / utils.ts
Created June 24, 2019 10:46
Angular get all errors from FormGroup, flatten
import {
AbstractControl,
FormArray,
FormGroup,
ValidationErrors
} from '@angular/forms';
function parseControlError(
key: string,
control: AbstractControl
@Fredx87
Fredx87 / sync-control.directive.spec.ts
Created August 22, 2018 17:57
Angular SyncControl directive
import { Component } from '@angular/core';
import { async, TestBed } from '@angular/core/testing';
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { SyncControlDirective } from './sync-control.directive';
class FormGroupHostComponent {
formGroup = new FormGroup({
ctrl: new FormControl('')
});
@Fredx87
Fredx87 / README.md
Last active February 25, 2021 18:11
Swagger UI Keycloak Logout plugin

Swagger UI Keycloak Logout plugin

This is a plugin for Swagger UI that integrates the logout process with Keycloak.

When the user clicks "Logout" the logout page of Keycloak is called and then the user session is removed from Keycloak. To use this plugin you need to include the keycloak-logout.js file in dist/index.html and place oauth2-logout.html in the dist folder.

The logout URL is taken from the authorizationUrl removing the auth string and replacing it with the logout string.

Rember to add OAuthLogoutPlugin to the plugins section of SwaggerUi configuration: