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
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-resources-plugin</artifactId> | |
<version>3.2.0</version> | |
<configuration> | |
<outputDirectory>${project.build.directory}/modified</outputDirectory> | |
<resources> | |
<resource> | |
<directory>src/main/resources</directory> | |
<filtering>true</filtering> |
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
@Configuration | |
@EnableSwagger2 | |
public class SpringFoxConfig { | |
public static final String AUTHORIZATION_HEADER = "Authorization"; | |
@Bean | |
public Docket api() { | |
return new Docket(DocumentationType.SWAGGER_2) | |
.ignoredParameterTypes(AuthenticationPrincipal.class, DespaniPrincipal.class) |
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
@Bean(name = "piTaskExecutor") | |
@Primary | |
public Executor piTaskExecutor() { | |
log.debug("Creating Async Task Executor"); | |
final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | |
executor.setCorePoolSize(4); | |
executor.setMaxPoolSize(10); | |
executor.setQueueCapacity(5); | |
executor.setAllowCoreThreadTimeOut(false); | |
executor.setThreadNamePrefix("PiExecutor-"); |
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 String getURL(HttpServletRequest curRequest) { | |
if(curRequest ==null) { | |
return "https://treespond.com/"; | |
} | |
String scheme = curRequest.getScheme(); // http | |
String serverName = curRequest .getServerName(); // hostname.com | |
int serverPort = curRequest .getServerPort(); // 80 |
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
List<MyObject> largeList = /* your large list */; | |
List<MyObject> smallList = /* your small list */; | |
Collections.sort(largeList, Comparator.comparing(MyObject::getTicker)); | |
List<MyObject> matchingObjects = smallList.stream() | |
.filter(item -> Collections.binarySearch(largeList, item, Comparator.comparing(MyObject::getTicker)) >= 0) | |
.collect(Collectors.toList()); | |
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 class JWTAuthenticationEntryPoint implements AuthenticationEntryPoint { | |
@Override | |
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) | |
throws IOException, ServletException { | |
response.setStatus(403); | |
response.setContentType(MediaType. APPLICATION_JSON_VALUE); | |
String message; | |
if (exception.getCause() != null) { |
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
@Configuration | |
@EnableWebSecurity(debug = false) | |
public class DespaniDualSecurityConfig extends WebSecurityConfigurerAdapter { | |
@Autowired | |
DespSecurityManager secMan; | |
@Autowired | |
private UserServices userDetailsService; |
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
/** | |
* The first commented line is your dabbler’s title Joe | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
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
YUI.add("SomeOtherModuleOne", function(Y){ | |
//something here | |
}, "0.1", { requires: ["io-base"] }); | |
YUI.add("SomeOtherModuleTwo", function(Y){ | |
//something here | |
}, "0.1", { requires: ["io-base"] }); |