This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.gateway; | |
import ch.qos.logback.classic.PatternLayout; | |
import ch.qos.logback.classic.spi.ILoggingEvent; | |
public class MaskingPatternLayout extends PatternLayout { | |
private String patternsProperty; | |
public String getPatternsProperty() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.beans.factory.config.BeanPostProcessor; | |
@Component | |
public static class BPP implements BeanPostProcessor { | |
@Override | |
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { | |
System.out.println("#######" + beanName + ": " + bean.getClass().getName()); | |
return bean; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class LdapGroupsProvider { | |
private List<String> groups = new ArrayList<>(); | |
@Override | |
public List<String> getGroups() { | |
groups.clear(); | |
final DefaultSpringSecurityContextSource contextSource = | |
new DefaultSpringSecurityContextSource("ldap://localhost:8389/dc=springframework,dc=org"); | |
contextSource.setAnonymousReadOnly(true); | |
contextSource.afterPropertiesSet(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(BeansApplication.class, args); | |
Arrays.stream(configurableApplicationContext.getBeanDefinitionNames()).forEach(System.out::println); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
powershell "Add-Type -AssemblyName System.speech;" ^ | |
"$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;" ^ | |
"$speak.GetInstalledVoices()" ^ | |
"| foreach { $_.VoiceInfo.Name }" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"workbench.colorCustomizations": { | |
/* error squiggles */ | |
// "editorError.foreground": "#6060ff", | |
/* warning squggles */ | |
"editorWarning.foreground": "#000000", | |
/* info squiggles */ | |
// "editorInfo.foreground": "#35ffab" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.properties; | |
import javax.servlet.http.Cookie; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.GetMapping; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.servlet.http.HttpServletRequest; | |
import org.apache.http.HttpRequest; | |
import org.apache.http.client.config.CookieSpecs; | |
import org.apache.http.client.config.RequestConfig; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.client.methods.HttpRequestBase; | |
import org.apache.http.entity.InputStreamEntity; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class CommandLineAppStartupRunner implements CommandLineRunner, ApplicationContextAware { | |
private ApplicationContext applicationContext; | |
@Override | |
public void run(String... args) throws Exception { | |
String[] beanNames = this.applicationContext.getBeanDefinitionNames(); | |
Arrays.stream(beanNames).forEach((beanName) -> { | |
System.out.println(beanName); |