Skip to content

Instantly share code, notes, and snippets.

@jmini
jmini / Input.java
Created April 14, 2018 16:27
Simple tool to do java renamings
package rename;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
public class Input {
final Path root;
final Map<String, String> projectNames;
final String oldRootPackageName;
@jmini
jmini / .travis.yml
Last active March 1, 2018 09:19
asciidoctorj travis
# current version on asciidoctorj-1.6.0 branch https://github.com/asciidoctor/asciidoctorj/blob/asciidoctorj-1.6.0/.travis.yml
os: linux
dist: trusty
language: java
matrix:
include:
- jdk: oraclejdk9
dist: trusty
- jdk: oraclejdk8
- jdk: oraclejdk7
@jmini
jmini / gist:de392ab96391581c52f66285c333548d
Created February 3, 2018 08:34
Git ignore all the .DS_Store files in every folder and subfolder globally
echo ".DS_Store" >> ~/Git/.gitignore_global
echo "._.DS_Store" >> ~/Git/.gitignore_global
echo "**/.DS_Store" >> ~/Git/.gitignore_global
echo "**/._.DS_Store" >> ~/Git/.gitignore_global
git config --global core.excludesfile ~/Git/.gitignore_global
@jmini
jmini / pom.xml
Last active August 16, 2016 05:50
Load the GIT commit id and reuse it in your maven build
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>sample-pom</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
@jmini
jmini / CheckLink.java
Created April 7, 2016 05:11
Check HTML links to local pages, using JSoup
@jmini
jmini / CheckLink.java
Created March 15, 2016 21:03
Java Main class to verify that local HTML links point to existing files
@jmini
jmini / MarkdownHelloWorld.java
Last active October 6, 2015 10:08
Mylyn Wikitext example (plain java, using maven)
import java.io.StringWriter;
import org.eclipse.mylyn.wikitext.core.parser.MarkupParser;
import org.eclipse.mylyn.wikitext.core.parser.builder.HtmlDocumentBuilder;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;
import org.eclipse.mylyn.wikitext.markdown.core.MarkdownLanguage;
public class MarkdownHelloWorld {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
@jmini
jmini / WorkaroundAsciidoctor858.java
Last active February 15, 2019 23:41
Workaround for Asciidoctor #858 (fix the HTML Ouptu)
//Workaround using JSoup to obtain the desired behavior described in #858 for the HTML output.
//see https://github.com/asciidoctor/asciidoctor/issues/858
static private Pattern pattern = Pattern.compile("Figure ([0-9]+)\\.");
/**
* Main method for the #858 workaround.
*
* @param doc
* JSoup document (type is {@link org.jsoup.nodes.Document})
@jmini
jmini / AbstractTableWithDetail.java
Created January 22, 2015 07:07
AbstractTableWithDetail template: implementation of the master/detail pattern.
/*******************************************************************************
* Copyright (c) 2015 BSI Business Systems Integration AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* BSI Business Systems Integration AG - initial API and implementation
******************************************************************************/
@jmini
jmini / Main
Created January 11, 2015 06:57
Main for the Stackoverflow a question http://stackoverflow.com/q/27884534/91497
//see http://stackoverflow.com/q/27884534/91497
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class Main {
public static void main(String[] args) {