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
@XmlType(name = "LanguageType") | |
@XmlEnum | |
public enum LanguageType { | |
@XmlEnumValue("de") | |
DE("de"), | |
@XmlEnumValue("fr") | |
FR("fr"), | |
@XmlEnumValue("it") | |
IT("it"), |
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
#list current releases | |
helm ls | |
#list of helm repositories | |
helm repo list | |
#show all charts in the `chartmuseum` repo | |
helm search chartmusem | |
#start chartmuseum with port and file (local storage) (for localtesting) | |
chartmuseum --port=8090 --storage="local" --storage-local-rootdir="~/chart-storage" |
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
const immutableRemoval = (list, index) => { | |
return [ | |
...list.slice(0, index), | |
...list.slice(index+1) | |
]; | |
}; | |
const v = [1,2,3]; | |
console.log(immutableRemoval(v,1)); | |
// [1,3] |
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
# install and delete keycloak helm chart | |
## install | |
cd /Users/maad4/projects/training/codecentric-helm-charts/charts/keycloak; | |
helm install --name keycloak . | |
## delete | |
helm delete --purge keycloak | |
# secrets | |
## create cloudsql-instance-credentials secret | |
kubectl create secret generic cloudsql-instance-credentials --from-file=credentials.json |
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
# docker | |
## inspect | |
# - get ip address of the container named "my_container" | |
$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' my_container | |
$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' fb4d0e863eb0 # same but with container_id | |
## stop | |
$ docker stop my_container # stop conatainer named "my_container" | |
$ docker stop $(docker ps -a -q) # stop all running containers |
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
docker run --name mongo -p 27017:27017 -v /data/db:/data/db mongo:3.4.17-jessie |
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
/** | |
* In this example we'll GET a codingmark identified by its location callling the following REST resource | |
* https://www.codingmarks.org/public/codingmarks?location={myLocation} | |
* which is protected with Basic-Authentication | |
**/ | |
import javax.ws.rs.NotFoundException; | |
import javax.ws.rs.client.Client; | |
import javax.ws.rs.client.ClientBuilder; | |
import javax.ws.rs.core.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
curl \ | |
-d 'client_id=YOUR_KEYCLOAK_CLIENT' \ | |
-d 'username=YOUR_USERNAME' \ | |
-d 'password=YOUR_PASSWORD' \ | |
-d 'grant_type=password' \ | |
'https://YOUR_KEYCLOAK_SERVER_HOST/auth/realms/YOUR_REALM/protocol/openid-connect/token' \ | |
| python -m json.tool |
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
var Person = function (firstName) { | |
this.firstName = firstName; | |
}; | |
Person.prototype.sayHello = function() { | |
console.log("Hello, I'm " + this.firstName); | |
}; | |
var person1 = new Person("Alice"); | |
var person2 = new Person("Bob"); |
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
private static String getOutputFilePath() throws Exception { | |
//create if not existent a "weeknum" directory in the given "output.directory.base" directory | |
Date now = new Date(); | |
Calendar calendar = Calendar.getInstance(); | |
calendar.setTime(now); | |
int weeknum = calendar.get(Calendar.WEEK_OF_YEAR); | |
String targetDirPath = System.getProperty("output.directory.base") + String.valueOf(weeknum); | |
File targetDirectory = new File(targetDirPath); | |
if(!targetDirectory.exists()){ |