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
/** | |
* Uses: | |
* HTMLTableBuilder htmlBuilder = new HTMLTableBuilder(null, true, 2, 3); | |
* htmlBuilder.addTableHeader("1H", "2H", "3H"); | |
* htmlBuilder.addRowValues("1", "2", "3"); | |
* htmlBuilder.addRowValues("4", "5", "6"); | |
* htmlBuilder.addRowValues("9", "8", "7"); | |
* String table = htmlBuilder.build(); | |
* System.out.println(table.toString()); | |
*/ |
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 makeRequest = () => { | |
try { | |
getJSON() | |
.then(result => { | |
// this parse may fail | |
const data = JSON.parse(result) | |
console.log(data) | |
}) | |
// uncomment this block to handle asynchronous errors | |
// .catch((err) => { |
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 makeRequest = async () => { | |
try { | |
// this parse may fail | |
const data = JSON.parse(await getJSON()) | |
console.log(data) | |
} catch (err) { | |
console.log(err) | |
} | |
} |
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 java.io.IOException; | |
import java.nio.charset.StandardCharsets; | |
import java.nio.file.Files; | |
import java.util.Arrays; | |
import java.util.Iterator; | |
import java.util.Properties; | |
import org.I0Itec.zkclient.ZkClient; | |
import org.apache.kafka.clients.consumer.ConsumerRecord; | |
import org.apache.kafka.clients.consumer.ConsumerRecords; | |
import org.apache.kafka.clients.consumer.KafkaConsumer; |
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
mysql -uroot -p --local-infile | |
LOAD DATA LOCAL INFILE "file.csv" | |
INTO TABLE db.table | |
FIELDS TERMINATED BY ',' | |
ENCLOSED BY '\"' | |
LINES TERMINATED BY '\n' |
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
KUBE_TOKEN=$(</var/run/secrets/kubernetes.io/serviceaccount/token) | |
NAMESPACE=myapp-dev | |
CONFIGMAP_NAME=testconfig | |
curl -sSk \ | |
-X PATCH \ | |
-d @- \ | |
-H "Authorization: Bearer $KUBE_TOKEN" \ | |
-H 'Accept: application/json' \ | |
-H'Content-Type: application/strategic-merge-patch+json' \ | |
https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/$NAMESPACE/configmaps/$CONFIGMAP_NAME <<'EOF' |
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 | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |