Skip to content

Instantly share code, notes, and snippets.

View arkadiusjonczek's full-sized avatar
🏴‍☠️

Arkadius Jonczek arkadiusjonczek

🏴‍☠️
View GitHub Profile
@wojteklu
wojteklu / clean_code.md
Last active July 19, 2025 09:33
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@sts
sts / openidc_otp_validation.sh
Last active January 16, 2025 03:55
Keycloak OTP Validation API
BASE_URL=https://localhost:8081/auth
CLIENT_ID=curl-test
CLIENT_SECRET=
USERNAME=
PASSWORD=
REALM=validation-test
OTP_CODE=027253
# OpenID Access Token via "Resource Owner Password Credentials Grant"
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 19, 2025 08:00
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active July 14, 2025 06:05
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
<?php
/**
* Coin Dashboard by Christian Haschek
* https://blog.haschek.at
*
* Donations always welcome
* BTC: 1ChrisHMgr4DvEVXzAv1vamkviZNLPS7yx
* ETH: 0x1337C2F18e54d72d696005d030B8eF168a4C0d95
*
* Read more at
@ThomasVitale
ThomasVitale / Main.java
Last active June 11, 2023 08:54
Keycloak Admin REST API for Java
import com.sun.org.apache.regexp.internal.RE;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.CredentialRepresentation;
import org.keycloak.representations.idm.UserRepresentation;
import java.util.Arrays;
@tsandall
tsandall / gist:c7b57b5f96b77765ef416fba6f8e9f3e
Last active May 29, 2023 23:44
Example of verifying JWTs signed with RS256 in OPA
package example
cert = `-----BEGIN CERTIFICATE-----
MIIFiDCCA3ACCQCGV6XsfG/oRTANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMC
VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFTATBgNVBAcMDFJlZHdvb2QgQ2l0eTEO
MAwGA1UECgwFU3R5cmExDDAKBgNVBAsMA0RldjESMBAGA1UEAwwJbG9jYWxob3N0
MRgwFgYJKoZIhvcNAQkBFglhc2hAc3R5cmEwHhcNMTgwMzA2MDAxNTU5WhcNMTkw
MzA2MDAxNTU5WjCBhTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWEx
FTATBgNVBAcMDFJlZHdvb2QgQ2l0eTEOMAwGA1UECgwFU3R5cmExDDAKBgNVBAsM
A0RldjESMBAGA1UEAwwJbG9jYWxob3N0MRgwFgYJKoZIhvcNAQkBFglhc2hAc3R5
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 17, 2025 06:10
set -e, -u, -o, -x pipefail explanation
@dhana-git
dhana-git / Guide on Microservices: Backups and Consistency.md
Created March 29, 2019 09:28
Guide on Microservices: Backups and Consistency | Consistent Disaster Recovery for Microservices - the BAC Theorem

Guide on Microservices: Backups and Consistency | Consistent Disaster Recovery for Microservices - the BAC Theorem


The BAC (Backup Availability Consistency) Theorem

When backing up an entire microservices architecture, it is not possible to have both availability and consistency.

  • Eventual Inconsistency with Full Availability (High Availability)
    • When making an independent backup of the state (the event log) of each service, it is possible that one service will be backed up before the event is added to the log, while the other service will be backed up after the corresponding event is added to its log. When restoring the services from backup, only one of the two services will recover its complete log. The global state of the microservice architecture will thus become inconsistent after restoring it from backup.
    • Possible problems,
  • Broken link
@bitsurgeon
bitsurgeon / youtube.md
Last active June 30, 2025 14:33
Markdown cheatsheet for YouTube

Embed YouTube Video in Markdown File

  1. Markdown style
[![Watch the video](https://img.youtube.com/vi/nTQUwghvy5Q/default.jpg)](https://youtu.be/nTQUwghvy5Q)
  1. HTML style
<a href="http://www.youtube.com/watch?feature=player_embedded&v=nTQUwghvy5Q" target="_blank">