Skip to content

Instantly share code, notes, and snippets.

View mychalvlcek's full-sized avatar
🙉
.

Michal Vlček mychalvlcek

🙉
.
View GitHub Profile
@mychalvlcek
mychalvlcek / ! Multi tenant circuit breaker with resilience4j & spring
Last active June 12, 2024 09:40
Multi tenant circuit breaker with resilience4j & spring
.
@mychalvlcek
mychalvlcek / Gitlab - test coverage results.md
Last active June 12, 2024 09:39
Gitlab CI test-coverage percentage results for jacoco

How to include test-coverage percentage results in the merge Request of gitlab. Example for jacoco (working for both unit & integration tests)

# .gitlab-.ci.yml

test:
  stage: test
  image: maven:3.8-openjdk-17-slim
    - mvn $MAVEN_CLI_OPTS verify
      # jacoco code-coverage reporting
@mychalvlcek
mychalvlcek / !Spring Quartz - multitenancy.md
Last active June 12, 2024 09:39
Spring Quartz - multitenancy

To achieve multitenant behavior for quartz scheduler, we need to setup:

  • set tenantId for every job we created.. we use quartz JobDataMap (handy key/value store) in Job class
  • JobListener - to inject tenantId from JobDataMap into current thread-bounded tenant context

This will work with shared quartz database.. if we want to have separated quartz databases/schemas for every tenant, we can instantiate multiple SchedulerFactoryBean with its custom dataSource

@mychalvlcek
mychalvlcek / Clock.elm
Created September 2, 2016 17:38
elm svg clock
import Html exposing (Html, button, div)
import Html.App as App
import Html.Events exposing (..)
import Html.Attributes as Attrs
import Svg exposing (..)
import Svg.Attributes exposing (..)
import Time exposing (Time, second)
import Debug
import Date
@mychalvlcek
mychalvlcek / nginx (brew) configuration with php70-fpm
Last active July 5, 2016 15:49
nginx (brew) configuration with php70-fpm, with symfony based example vhost
brew install nginx # install nginx
brew install php70 --with-fpm --with-imap --without-apache # install php
sudo nginx -s reload # to run with (port 80) you have to run as sudo
sudo brew services restart php70-fpm # restart php-fpm
@mychalvlcek
mychalvlcek / JSF - Bootstrap alert renderer
Last active July 26, 2018 17:12
Component which overrides the default JSF Message renderer by Bootstrap alert design.
Component which overrides the default JSF Message renderer by Bootstrap alert design.
faces-config.xml:
<render-kit>
<renderer>
<component-family>javax.faces.Messages</component-family>
<renderer-type>javax.faces.Messages</renderer-type>
<renderer-class>com.example.yourpackage.BootstrapMessagesRenderer</renderer-class>
</renderer>