This file contains 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 java.util.Objects; | |
import java.util.stream.Collectors; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.ext.Provider; | |
import org.glassfish.jersey.server.ResourceConfig; | |
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider; | |
import org.springframework.core.type.filter.AnnotationTypeFilter; | |
import org.springframework.stereotype.Component; | |
import org.springframework.util.ClassUtils; |
This file contains 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
version: '3.8' | |
services: | |
# Database - Mongo DB | |
mongo: | |
image: mongo | |
environment: | |
MONGO_INITDB_ROOT_USERNAME: helpdev | |
MONGO_INITDB_ROOT_PASSWORD: 123456 |
This file contains 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 java.io.Closeable; | |
import java.io.Serializable; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicBoolean; |
This file contains 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
from multiprocessing.pool import ThreadPool as Pool | |
data_values = [ | |
"b33d45d1-0107-471d-882b-70a445c43d50", | |
"06a55ef1-bc02-4115-91d8-783173ab4eda", | |
"580a171a-2007-41d2-9ba4-e24bb068c2bd" | |
] | |
def worker(some_arg1): |
This file contains 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
#PRIMARY DISPLAY = EXTENDED DISPLAY CONNECTED TO THE HDMI PORT | |
#SECONDARY DISPLAY = BUILT IN DISPLAY | |
PRIMARY_DISPLAY=$(xrandr | grep -w HDMI | awk -F'[ \+]' '{print $1}') | |
SECONDARY_DISPLAY=$(xrandr | grep -w eDP | awk -F'[ \+]' '{print $1}') | |
MODE1408=$(cvt 1408 792 60 | sed -n '2p' | awk '{gsub(/Modeline /,"")}1') | |
MODE1440=$(cvt 1440 810 60 | sed -n '2p' | awk '{gsub(/Modeline /,"")}1') | |
MODE1536=$(cvt 1536 864 60 | sed -n '2p' | awk '{gsub(/Modeline /,"")}1') | |
MODE1600=$(cvt 1600 900 60 | sed -n '2p' | awk '{gsub(/Modeline /,"")}1') |
This file contains 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
https://stackoverflow.com/questions/33744875/spring-boot-how-to-log-all-requests-and-responses-with-exceptions-in-single-pl | |
Currently Spring Boot has the Actuator feature to get the logs of requests and responses. | |
But you can also get the logs using Aspect(AOP). | |
Aspect provides you with annotations like: @Before, @AfterReturning, @AfterThrowing etc. | |
@Before logs the request, @AfterReturning logs the response and @AfterThrowing logs the error message, You may not need all endpoints' log, so you can apply some filters on the packages. |
This file contains 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
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) | |
class SampleE2ETests { | |
@Autowired | |
private TestRestTemplate restTemplate; | |
@Autowired | |
private PersonRepository personRepository; | |
@AfterEach |
This file contains 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
@SpringBootTest | |
@WebMvcTest(controllers = ExampleController.class) | |
class ExampleControllerAPITest { | |
@Autowired | |
private MockMvc mockMvc; | |
@MockBean | |
private PersonRepository personRepository; |