Skip to content

Instantly share code, notes, and snippets.

View marchpig's full-sized avatar

Sangwoo Lee marchpig

View GitHub Profile
@marchpig
marchpig / JacocoPrinter.groovy
Last active March 21, 2021 21:29
How to display Jacoco summary in Maven console output
def reportFile = new File("target/site/jacoco/index.html")
if (!reportFile.exists() || !reportFile.canRead()) {
println "[JacocoPrinter] Skipped due to missing report file."
return
}
reportFile.withReader('UTF-8') { reader ->
def html = getParser().parseText(reader.readLine())
def totalRow = html.body.table.tfoot.tr
const MongoClient = require('mongodb').MongoClient;
const url = "mongodb://mongo1:30001,mongo2:30002,mongo3:30003?replicaSet=my-rs";
MongoClient.connect(url, { useNewUrlParser: true })
.then(client => {
const db = client.db('test');
const collection = db.collection('engineers');
const changeStreamOptions = {
fullDocument: 'updateLookup',
resumeAfter: {
const MongoClient = require('mongodb').MongoClient;
const url = "mongodb://mongo1:30001,mongo2:30002,mongo3:30003?replicaSet=my-rs";
MongoClient.connect(url, { useNewUrlParser: true })
.then(client => {
const db = client.db('test');
const collection = db.collection('engineers');
const changeStreamOptions = {
fullDocument: 'updateLookup'
};