Skip to content

Instantly share code, notes, and snippets.

View ahoffer's full-sized avatar

Aaron Hoffer ahoffer

  • Seattle
View GitHub Profile
@ahoffer
ahoffer / build.gradle.kts
Created October 15, 2021 19:24
Bad Gradle XJC
plugins {
id("com.github.bjornvester.xjc").version("1.4")
}
dependencies {
implementation(project(":pen:pen-api"))
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.2")
xjcPlugins("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.2")
xjcPlugins("org.jvnet.jaxb2_commons:jaxb2-basics:1.11.1")
}
@ahoffer
ahoffer / osgi_best_practices.md
Last active September 18, 2021 17:33
OSGi best practices in 2021

OSGi

The Promise

About six years ago I took a new job and started working with a large application that took advantage of an OSGi implementation and Karaf. OSGi offers some amazing benefits over baseline Java.

  • Runtime upgradability
  • Finer grained (package-level) dependencies
  • Escape from classpath problem
@ahoffer
ahoffer / dlog
Last active August 19, 2021 15:34
Python functions and programs for docker utilities
#!/usr/bin/env python3
# Tail the logs of a container, given the partial name of the container
import sys
from dockerutil import execute_docker
args = ' '.join(sys.argv[2:])
cmd = f'docker logs -f {args} $name'
ffmpeg started on 2020-07-28 at 15:14:03
Report written to "ffmpeg-20200728-151403.log"
Command line:
ffmpeg -stream_loop -1 -re -f lavfi -i "movie=snail.mp4" -f v4l2 /dev/video4 -report
ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-li
Thank you to everyone for providing so many thoughtful and insightful answers and comments.
I appreciate your perspectives and experience on the topic. I would like to pull together the
collected wisdom and summarize. I realize that summary answers are frowned upon, but
I think it is justified in this case [Questions is on hold -- cannot post new answers]
First off, the fact a convention like “underscore means private” indicates there is a real need
to designate some state or behavior as internal. Developers needed to communicate that
component contracts and postconditions might not hold true if the internal of a component are
modified.