Skip to content

Instantly share code, notes, and snippets.

@Renkai
Renkai / build.gradle.kts
Created August 22, 2018 08:17
create fat jar with gradle kotlin dsl
tasks.create<Jar>("fatJar") {
appendix = "fat"
setDuplicatesStrategy(DuplicatesStrategy.FAIL)
manifest {
attributes(mapOf("Main-Class" to "Main")) // replace it with your own
}
val sourceMain = java.sourceSets["main"]
from(sourceMain.output)
configurations.runtimeClasspath.filter {
@Makeshift
Makeshift / get-docker-stats.sh
Last active March 24, 2025 05:54
Docker stats in CSV with separated values in bytes
#!/bin/bash
function cleanLine() {
local line key field
line="$1"
key="$2"
field="$3"
echo "$line" | jq -r "$key" | tr -d 'BbIi' | awk "{print toupper(\$$field)}" | numfmt --from=auto
}