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
git commit --amend --date=now |
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
mvn versions:display-property-updates |
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
# For a property in a Spring component like this: | |
# | |
# @Value("${property.name}") | |
# private List<String> values; | |
# | |
# Spring will fail to start up with a vague error saying something like | |
# "Could not resolve placeholder 'property.name' in value "${property.name}" | |
# even though the property definition is right there in the yaml file | |
# For example, ordinarily in a yaml file something like this: |
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
db.collectionName.find( | |
{ | |
$and: [ | |
{"timestamp": {$gte: ISODate('2021-10-05T00:00:00.000Z')}}, | |
{"timestamp": {$lt: ISODate('2021-10-06T00:00:00.000Z')}} | |
] | |
} | |
) | |
db.collectionName.count( |
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
// Sequence number begins zero | |
db.collectionName.find({ | |
"sequenceNumber": { $regex: /^0/ } | |
}) | |
// Sequence number ends zero | |
db.collectionName.find({ | |
"sequenceNumber": { $regex: /0$/ } | |
}) |
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
db.currentCollectionName.renameCollection("newCollectionName") |
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
# Example using "jq" to pretty print JSON, displayed in less, preserving colour codes | |
curl -s http://localhost:8080/api/transfer/export | jq -C . | less -R | |
# Example using "gunzip", using "-c" with gunzip to keep the original file | |
gunzip -c filename.json/gz | jq -C . | less -R |
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 lombok.extern.slf4j.Slf4j; | |
import org.springframework.boot.web.error.ErrorAttributeOptions; | |
import org.springframework.boot.web.reactive.error.DefaultErrorAttributes; | |
import org.springframework.stereotype.Component; | |
import org.springframework.web.reactive.function.server.ServerRequest; | |
import java.lang.reflect.Method; | |
import java.util.Arrays; | |
import java.util.Map; |
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 lombok.extern.slf4j.Slf4j; | |
import org.springframework.boot.autoconfigure.web.ResourceProperties; | |
import org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler; | |
import org.springframework.boot.web.reactive.error.ErrorAttributes; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.core.annotation.Order; | |
import org.springframework.core.io.ClassPathResource; | |
import org.springframework.http.HttpMethod; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.MediaType; |
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 com.fasterxml.jackson.databind.JsonNode; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.springframework.core.io.buffer.DataBuffer; | |
import org.springframework.core.io.buffer.DataBufferUtils; | |
import org.springframework.core.io.buffer.DefaultDataBufferFactory; | |
import reactor.core.publisher.Flux; | |
import reactor.core.publisher.Mono; | |
import java.io.BufferedWriter; | |
import java.io.FileWriter; |