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
object PascalsTriangle extends App { | |
/** | |
* 1 | |
* 1 1 | |
* 1 2 1 | |
* 1 3 3 1 | |
* 1 4 6 4 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
@ControllerAdvice(annotations = RestController.class) | |
public class ExceptionHandlerAdvice { | |
@ExceptionHandler(InvalidDataException.class) | |
@ResponseStatus(HttpStatus.BAD_REQUEST) | |
public ResponseEntity<String> handleInvalidDataExceptions(InvalidDataException e) { | |
HttpHeaders headers = new HttpHeaders(); | |
headers.setContentType(MediaType.TEXT_PLAIN); | |
return new ResponseEntity<>(e.getMessage(), headers, HttpStatus.BAD_REQUEST); | |
} |
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
#!/bin/bash | |
CLUSTER_NAME=`eksctl get cluster --region ap-southeast-2 -o json | jq -r '.[0].name'` | |
ISSUER_URL=$(aws eks describe-cluster \ | |
--name $CLUSTER_NAME \ | |
--query cluster.identity.oidc.issuer \ | |
--output text \ | |
--region ap-southeast-2) | |
ISSUER_HOSTPATH=$(echo $ISSUER_URL | cut -f 3- -d'/') | |
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) |
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
node { | |
def mvnHome | |
env.JAVA_HOME="${tool 'JDK12'}" | |
env.MAVEN_HOME="${tool 'M3'}" | |
env.PATH="${env.JAVA_HOME}/bin:${env.MAVEN_HOME}/bin:${env.PATH}" | |
stage('Checkout source') { | |
git( | |
url: "${repo}", | |
credentialsId: "${GithubCredentialsId}", |