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 Car { | |
private String model; | |
private String color; | |
private Double price; | |
public Car(String model, String color, Double price) { | |
this.model = model; | |
this.color = color; | |
this.price = price; |
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
@Service | |
public class TokenValidatorServiceImpl implements TokenValidatorService { | |
private String fileAttUrlPath; | |
private String fileAttRoute; | |
@Autowired | |
private ClientProperties clientProperties; | |
private final WebClient.Builder webClientBuilder; |
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
# sample for lifecycle config | |
variable "bucket_lifecycle_config" { | |
type = list(any) | |
description = "Bucket lifecycle. Set empty list if you want to ignore the lifecycle configuration." | |
default = [] | |
} | |
bucket_lifecycle_config = [{ | |
"id" = "DisposePLIST" | |
"prefix" = "disposable" |
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
vim ~/.aws/config | |
[ansible-dynamic-inventory] | |
region = ap-southeast-1 | |
vim ~/.aws/credentials | |
[ansible-dynamic-inventory] | |
aws_access_key_id = XXXXXXXX | |
aws_secret_access_key = YYYYYYYYYYYYYYYY |
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
//there is at least one negative number | |
public void anyMatch(){ | |
boolean anyMatch; | |
anyMatch = IntStream.of(-1,2,3,5,7,9) | |
.anyMatch(i -> i < 0); | |
System.out.format("It is [%b] that at least one negative number \n", | |
anyMatch); | |
//Output: It is [true] that at least one negative number |
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 lorem_metrics | |
import ( | |
"github.com/go-kit/kit/metrics" | |
"time" | |
) | |
func Metrics(requestCount metrics.Counter, | |
requestLatency metrics.Histogram) ServiceMiddleware { | |
return func(next Service) Service { |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: mock-endpoint | |
namespace: ns1 | |
spec: | |
selector: | |
matchLabels: | |
name: mock-endpoint | |
template: |
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 org.apache.commons.lang.StringUtils; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.sql.Timestamp; | |
import java.util.Date; | |
import java.util.Set; | |
import static org.assertj.core.api.Assertions.assertThat; |
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
packer { | |
required_plugins { | |
amazon = { | |
version = ">= 0.0.2" | |
source = "github.com/hashicorp/amazon" | |
} | |
} | |
} | |
source "amazon-ebs" "centos7" { |
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
// RandomMessageProcessor.java | |
// snippet code | |
@Async("asyncExecutor") | |
public void process(RequestDto requestDto) { | |
if(reentrantLock.isLocked()) { | |
logger.info("Another thread is processing the processor!"); | |
return; | |
} | |
reentrantLock.lock(); |
NewerOlder