Skip to content

Instantly share code, notes, and snippets.

View jensim's full-sized avatar
🦀
Rusting in the snow 🇸🇪

Jens Brimfors jensim

🦀
Rusting in the snow 🇸🇪
View GitHub Profile
@jensim
jensim / JarFileClassExtractor.kt
Last active May 26, 2019 06:11
Extract any and all class references from a jar, and its nested jars recursively with the beauty of Kotlin. Standalone version from https://github.com/jensim/refleKt/blob/master/src/main/kotlin/se/jensim/reflekt/internal/JarFileClassLocator.kt
import java.io.File
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import java.util.zip.ZipInputStream
object JarFileClassLocator {
private val classRegexp = Regex("^.*/([A-Z]+[A-Za-z0-9]${"$"})*[A-Z]+[A-Za-z0-9]*\\.class$")
private fun String.fileToClassRef() = dropLast(6).replace("/", ".").replace("$", ".")
@jensim
jensim / README.md
Last active October 3, 2019 13:24
Run oracle18-XE and flyway

Create docker container

docker run -d -p 1521:1521 --name=oracle-xe --volume ~/docker/oracle-xe:/opt/oracle/oradata paddan66/oracle-xe

Connection string

jdbc:oracle:thin:system/Oracle18@//localhost:1521/XEPDB1

maven migrate

mvn flyway:migrate -N
#mvn flyway:clean -N
@jensim
jensim / add_default_reviewers.sh
Last active January 6, 2023 15:22
Add default reviewers to bitbucket-server pull requests where there are currently 0 reviewers
#!/bin/bash
#set -x
set -e
host='https://my-code.local'
if ! which jq ; then
echo 'jq not installed.' >&2
exit 1
@jensim
jensim / 1_README.md
Last active November 16, 2023 19:40
private git repo homebrew tap template

Closed source distribution of scripts via homebrew

Why?

Manual work is a bug. so, have someone automate the crap out of your migrations (or w/e task you are drowning in) in script-form, and deliver it like superpowers to all your developers with a tool they already know how to use.
Brew has built in updateability.