Avoid duplicating shell configurations for Bash and Fish by using edc/bass to source ~/.bash_profile
from ~/.config/fish/config.fish
, e.g.
bass source ~/.bash_profile
Avoid duplicating shell configurations for Bash and Fish by using edc/bass to source ~/.bash_profile
from ~/.config/fish/config.fish
, e.g.
bass source ~/.bash_profile
public List<String> getErrorMessages(BindingResult bindingResult) { | |
return bindingResult.getAllErrors() | |
.stream() | |
.map(error -> { | |
var defaultMessage = error.getDefaultMessage(); | |
if (error instanceof FieldError) { | |
var fieldError = (FieldError) error; | |
return String.format("%s %s", fieldError.getField(), defaultMessage); | |
} else { | |
return defaultMessage; |
@Component | |
@Slf4j | |
public class ErrorLoggingInterceptor implements ClientHttpRequestInterceptor { | |
@Nonnull | |
@Override | |
public ClientHttpResponse intercept(@Nonnull HttpRequest request, @Nonnull byte[] body, ClientHttpRequestExecution execution) | |
throws IOException { | |
var response = execution.execute(request, body); | |
var statusCode = response.getStatusCode(); |
enum Weekday { | |
MONDAY = 'MONDAY', | |
TUESDAY = 'TUESDAY', | |
WEDNESDAY = 'WEDNESDAY', | |
THURSDAY = 'THURSDAY', | |
FRIDAY = 'FRIDAY', | |
} | |
enum Weekend { | |
SATURDAY = 'SATURDAY', |
A @Constraint annotation is normally mapped to ConstraintValidator(s) using the @Constraint#validatedBy annotation parameter.
This however has the limitation that the @Constraint annotation has to know about the ConstraintValidator(s) during compilation, which may not always be feasible (for example, if the annotation is used at the DTO layer, but a ConstraintValidator depends on the service layer
@ControllerAdvice | |
public class EmptyOptionalResponseBodyControllerAdvice implements ResponseBodyAdvice<Optional<?>> { | |
@Override | |
public boolean supports(MethodParameter returnType, @Nullable Class<? extends HttpMessageConverter<?>> converterType) { | |
return Optional.class.isAssignableFrom(returnType.getParameterType()); | |
} | |
@Override | |
public Optional<?> beforeBodyWrite(Optional<?> body, @Nullable MethodParameter returnType, @Nullable MediaType selectedContentType, | |
@Nullable Class<? extends HttpMessageConverter<?>> selectedConverterType, |
jib-maven-plugin
's default example runs the build
goal during the package
phase.
The build
goal will push the docker image to the remote registry, which may be too frequent to run in the package
phase for some projects.
This template instead configures the jib-maven-plugin
to run the following goals in the following phases:
Phase | Goal | Goal Description |
---|---|---|
package | buildTar | Build docker image as tar file |
install | dockerBuild | Build docker image and install in Docker daemon |
It's great for beginners. Then it turns into a mess.
How to setup a development environment where Git from WSL integrates with native Windows applications, using the Windows home folder as the WSL home and using Git from WSL for all tools.
Note if using Git for Windows, or any tool on the Windows side that does not use Git from WSL then there will likely be problems with file permissions if using those files from inside WSL.
These are the tools I use:
wslgit
)Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.
@broros
otherwise why would he hand over a popular package to a stranger?
If it's not fun anymore, you get literally nothing from maintaining a popular package.
One time, I was working as a dishwasher in a restu