Skip to content

Instantly share code, notes, and snippets.

@Icaruk
Icaruk / multipleGitProfiles.md
Last active November 25, 2025 21:48
How to have multiple profiles on git

Last update: 30-01-2024
Last view: 25-11-2025

Step 1

Go to your work folder, mine is located at: F:/Work/EnterpriseName/

And then create a .gitconfig-work with the following data:

@thomasdarimont
thomasdarimont / logback-spring.xml
Created June 7, 2017 12:02
logback+graylog spring configuration example
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>
<configuration>
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} [%X{svc_usr}]%clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<contextName>test</contextName>
@vchernogorov
vchernogorov / _readme.md
Last active January 8, 2024 10:17
Паттерны проектирования

Паттерны проектирования

Данный гист содержит описание существующих паттернов проектирования. Также возможны примеры на джаве.

Содержание:

@thomasdarimont
thomasdarimont / KeycloakAdminClientExample.java
Last active September 28, 2025 10:05
Using Keycloak Admin Client to create user with roles (Realm and Client level)
package demo.plain;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.CreatedResponseUtil;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.ClientRepresentation;
@RuiNelson
RuiNelson / Levenshtein.swift
Last active August 2, 2023 03:50
Levenshtein distance between two String for Swift 4.x
import Foundation
extension String {
subscript(index: Int) -> Character {
return self[self.index(self.startIndex, offsetBy: index)]
}
}
extension String {
public func levenshtein(_ other: String) -> Int {
@leefsmp
leefsmp / models.java
Last active October 19, 2024 06:16
Basic RESTful API from a Java servlet
package com.autodesk.adn.viewanddata;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.HashMap;
import java.util.UUID;
import javax.servlet.ServletException;