Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀
Rusting in the snow 🇸🇪

Jens Brimfors jensim

🦀
Rusting in the snow 🇸🇪
View GitHub Profile
@jensim
jensim / add_default_reviewers.sh
Last active Oct 14, 2021
Add default reviewers to bitbucket-server pull requests where there are currently 0 reviewers
View add_default_reviewers.sh
#!/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 Jul 3, 2020
private git repo homebrew tap template
View 1_README.md

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.

@jensim
jensim / README.md
Last active Oct 3, 2019
Run oracle18-XE and flyway
View README.md

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 / JarFileClassExtractor.kt
Last active May 26, 2019
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
View JarFileClassExtractor.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("$", ".")