Skip to content

Instantly share code, notes, and snippets.


Clément Fournier oowekyala

View GitHub Profile
oowekyala /
Created Aug 23, 2017
Simple screen launcer for the PMD jekyll site
# Assuming GNU screen and bundler are installed, and `bundle install` has been run,
# this script starts the PMD documentation site server as a background screen.
# Kill the screen with option -k or --kill
# Install: change the PMD_GIT_DIR to match your pmd working directory, put in path and make executable
SCRIPT_NAME=$(basename $0)
oowekyala / fix-mvn
Created Mar 20, 2018
Fix PMD maven import setting all the modules to 1.7
View fix-mvn
sed -i -e 's/1.5/1.7/g' .idea/compiler.xml
find . -name "*.iml" -exec sed -i -e 's/LANGUAGE_LEVEL="JDK_1_5"/LANGUAGE_LEVEL="JDK_1_7"/g' {} +
oowekyala /
Last active Mar 27, 2018
MWE RTFX style overlay
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import org.fxmisc.richtext.InlineCssTextArea;
import org.fxmisc.richtext.model.StyleSpans;
import org.fxmisc.richtext.model.StyleSpansBuilder;
import javafx.application.Application;
import javafx.scene.Scene;
View sitemap.xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="">
oowekyala / app.css
Created Jul 15, 2018
Removing scroll arrows on JavaFX context menu
View app.css
// Works at least on JFX 8 and 9
.context-menu .scroll-arrow {
-fx-padding: 0 0 0 0;
.context-menu .menu-item {
// OK this is weird but it does solve a padding bug on the context menu.
// Without it, items are offset to the bottom, and the last one is partially hidden
oowekyala /
Created May 22, 2019
Generic metric reporter for PMD
package net.sourceforge.pmd.lang.metrics.internal;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import net.sourceforge.pmd.RuleContext;
import net.sourceforge.pmd.lang.ast.Node;
import spoon.Launcher;
import spoon.reflect.declaration.CtClass;
public class MWE {
oowekyala /
Last active Aug 6, 2019
GSoC 2017 report -- Bringing Object-Oriented Metrics to PMD
oowekyala /
Last active Jan 8, 2020
Generic contract test for a class implementing java.util.Comparator
import static java.lang.Integer.signum;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
/** A generic test class to test the contract of a Comparator. */
public abstract class BaseComparatorTest<T> {
oowekyala /
Created Jan 22, 2020
Escape routines for java text
class JavaEscapeUtil {
* Replaces unprintable characters by their escaped (or unicode escaped)
* equivalents in the given string
public static String escapeJava(String str) {
StringBuilder retval = new StringBuilder();
for (int i = 0; i < str.length(); i++) {
final char ch = str.charAt(i);
You can’t perform that action at this time.