Skip to content

Instantly share code, notes, and snippets.

@DennisRippinger
DennisRippinger / PrintClassHierarchy
Created April 11, 2019 16:02
Prints the class hierarchy of a provided pojo
import java.lang.reflect.Field;
import java.util.LinkedList;
import java.util.List;
public class PrintClassHierarchy {
public static void main(String[] args) {
Class clazz = SomePoJo.class;
TreeNode<String> root = new TreeNode<>(clazz.getSimpleName());
[
{
"jmhVersion" : "1.21",
"benchmark" : "de.drippinger.fakegen.DataFillerBenchmark.fill_java_base_types_regular",
"mode" : "thrpt",
"threads" : 1,
"forks" : 2,
"jvm" : "C:\\Program Files\\Java\\jdk1.8.0_181\\jre\\bin\\java.exe",
"jvmArgs" : [
],
@DennisRippinger
DennisRippinger / uploadAllToNexus.sh
Created July 31, 2018 12:46
Upload entire local Maven Repo to Nexus
#!/usr/bin/env bash
REPO_LOCATION=~/.m2/repository/
find ${REPO_LOCATION} -type f \
-not -name "*repositories" \
-and -not -name '*.lastUpdated' \
-and -not -directory '*.cache*' \
-and -not -directory '*.meta*' | \
while read path; do
@DennisRippinger
DennisRippinger / Grafana Dashboard Exporter
Created March 7, 2018 16:10
Grafana Dashboard Exporter that works with Version 5
#!/usr/bin/env bash
# Exporter for Grafana Version 5
# jq is required https://stedolan.github.io/jq/
# Removal of dashboard.id, meta and shift of dashboard might be locale implementation details.
KEY=<API_Key>
HOST="https://grafanaHost.com"
for dash in $(curl --silent -k -H "Authorization: Bearer $KEY" $HOST/api/search | jq -r -c '.[].url'); do

Keybase proof

I hereby claim:

  • I am DennisRippinger on github.
  • I am dennisrippinger (https://keybase.io/dennisrippinger) on keybase.
  • I have a public key whose fingerprint is 33FA 64B2 3A11 29AC 8205 1976 FC8F 4CB8 3CAD 37E8

To claim this, I am signing this object:

@DennisRippinger
DennisRippinger / Empty Javadoc
Last active December 16, 2016 18:24
Finds empty javadoc blocks
# With CRLF
\/\*\*[\r\n\t \*]*\*\/
# With LF
\/\*\*[\n\t \*]*\*\/
@DennisRippinger
DennisRippinger / Find not used mvn packages
Last active July 18, 2016 14:48
Lists maven projects/modules which do not depend on a given
#!/bin/bash
find . -name pom.xml -not -path "*/target*" |
while read filename
do
mvn dependency:list -f $filename > .tmp
result=$(grep "$1" .tmp )
if [ -z "$result" ]; then
@DennisRippinger
DennisRippinger / search.regex
Created March 29, 2016 09:51
Search for files in Eclipse that do not contain search text
(?s)\A((?!YourSearchText).)*\Z
@DennisRippinger
DennisRippinger / Bibtex Download
Created November 6, 2013 21:06
This little script crawls all DOIs from a given page and creates a file 'result.bib' with all correspondent Bibtex entries.
wget -q http://www.pageWithDouUrls.com -O - | \
tr "\t\r\n'" ' "' | \
grep -i -o 'http://dx.doi.org[^"]\+' | \
sed -e 's/^.*"\([^"]\+\)".*$/\1/g' | while read -r line ; do
curl -LH "Accept: text/bibliography; style=bibtex" $line >> result.bib
echo -e "\n" >> result.bib
done
@DennisRippinger
DennisRippinger / Download DFG Formulars
Created October 10, 2013 19:05
The Formulas of the DFG change from time to time, unfortunately without a changelog. To properly do a pdf diff, run this script when you start working for your proposal and when you discover a change.
wget -e robots=off -A.pdf -r -l1 http://www.dfg.de/foerderung/programme/koordinierte_programme/graduiertenkollegs/formulare_merkblaetter/
mkdir DFG_PDFs-`date +%m.%d.%Y`
find . -name "*.pdf" -type f -exec cp {} ./DFG_PDFs-`date +%m.%d.%Y`/ \;
rm -R www.dfg.de/