View terraform_check_attribute_empty.tf
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
# 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" |
View deployment.yaml
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: mock-endpoint | |
namespace: ns1 | |
spec: | |
selector: | |
matchLabels: | |
name: mock-endpoint | |
template: |
View SampleBeanTest.java
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 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; |
View aws.centos7.pkr.hcl
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
packer { | |
required_plugins { | |
amazon = { | |
version = ">= 0.0.2" | |
source = "github.com/hashicorp/amazon" | |
} | |
} | |
} | |
source "amazon-ebs" "centos7" { |
View Async.java
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
// 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(); |
View ansibledynamicinventory.sh
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
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 |
View FraudDetectionHopping.feature
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
@hopping | |
Scenario Outline: Accumulative transaction during 5 minutes interval: amount above $1500 then notify | |
Given Customer has a credit card with account number "<cc>" | |
When Customer transacts $<amount1> at "<event1>" | |
And Customer transacts $<amount2> at "<event2>" | |
And Customer transacts $<amount3> at "<event3>" | |
Then Fraud flag is "<flag>" | |
And total suspicious amount is $<total> | |
Examples: | |
|cc|amount1|amount2|amount3|event1|event2|event3|flag|total| |
View AuctionProcessor.java
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
public class AuctionProcessor implements Processor<String, AuctionDto> { | |
private KeyValueStore<String, AuctionDto> kvStore; | |
private ProcessorContext context; | |
@SuppressWarnings("unchecked") | |
@Override | |
public void init(ProcessorContext context) { | |
this.context = context; | |
kvStore = (KeyValueStore<String, AuctionDto>) context.getStateStore("action-key-store"); |
View HelloWorldJobProcessor.java
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
@EnableBatchProcessing | |
@Configuration | |
@ConditionalOnProperty(value = "features.job-processor.hello-world", havingValue = "active") | |
public class HelloWorldJobProcessor { | |
private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |
private JobBuilderFactory jobBuilderFactory; | |
private StepBuilderFactory stepBuilderFactory; |
View server.properties
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
############################# Server Basics ############################# | |
# The id of the broker. This must be set to a unique integer for each broker. | |
broker.id=2 | |
############################# Socket Server Settings ############################# | |
# The address the socket server listens on. It will get the value returned from | |
# java.net.InetAddress.getCanonicalHostName() if not configured. | |
# FORMAT: |
NewerOlder