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
<a href="https://cloud.spring.io/spring-cloud-netflix/multi/multi__router_and_filter_zuul.html">Zuul Docs</a> |
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.zuuldemo; | |
import java.util.UUID; | |
import java.util.stream.IntStream; | |
public class UUIDGen { | |
public static void main(String[] args) { | |
IntStream.range(1, 100) | |
.forEach((i) -> { | |
System.out.println(UUID.nameUUIDFromBytes(String.valueOf(System.currentTimeMillis()).getBytes()).toString().replace("-", "") + " millis: " + System.currentTimeMillis()); |
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); |
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
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
"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
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
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
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(); |