Skip to content

Instantly share code, notes, and snippets.

View abelsromero's full-sized avatar

Abel Salgado Romero abelsromero

View GitHub Profile
@abelsromero
abelsromero / gist:f7c5b9dead83ba607b5c
Created September 18, 2014 22:48
asciidoctor-maven-plugin build failure when redirecting the console to a file
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.771 s
[INFO] Finished at: 2014-09-18T23:50:11+02:00
[INFO] Final Memory: 19M/250M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:1.5.0:process-asciidoc (output-html) on project asciidoctor-maven: Execution output-html of goal org.asciidoctor:asciidoctor-maven-plugin:1.5.0:process-asciidoc failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:1.5.0:process-asciidoc (output-html) on project asciidoctor-maven: Execution output-html of goal org.asciidoctor:asciidoctor-maven-plugin:1.5.0:process-asciidoc failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
# add this to your .bashrc in cygwin's folder
antr_path=$(cygpath -w /home/asalgadr/libs/antlr-4.5-complete.jar)
export CLASSPATH=".;$antr_path;$CLASSPATH"
alias antlr4='java -jar $antr_path'
alias grun='java org.antlr.v4.runtime.misc.TestRig'

Document meta-model

:toc:macro

We deal with documents every day, sometimes in some ways we are not aware of. The idea of sharing ideas in a persistent support has been one the first thing that made the human kind what is it. From Altamira’s paintings in Spain to modern Wikipedia documents are about sharing knowledge.

So, it should be normal to assume that we are familiar with them and we know how to deal with them. I mean, is just a few words and images in a linear structure. Once it’s finished, just press btn:[Save] and btn:[Send] them.

Well, this is not true and this article talks about the complexity about dealing with groups of documents especially in digital system. In this article you will find an example model to help analyse document’s repositories.

@abelsromero
abelsromero / jruby-gradle-jar-stacktrace.txt
Created August 22, 2015 13:30
Error when setting jrubyJar as library()
* Exception is:
org.gradle.api.tasks.TaskValidationException: A problem was found with the configuration of task ':jruby-with-jar:jrubyJar'.
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
$ walkmod apply clean -e
INFO [main] - Java version: 1.7.0
INFO [main] - Java Home: C:\home\bin\jdk1.7.0_x64\jre
INFO [main] - OS: Windows 7, Vesion: 6.1
--------------------------------------------------------------------------------
_ _ _ _ ___ ___ _
| | | | | | | | \/ | | |
| | | | __ _| | | _| . . | ___ __| |
| |/\| |/ _` | | |/ / |\/| |/ _ \ / _` |
\ /\ / (_| | | <| | | | (_) | (_| |
$ walkmod apply script -e
INFO [main] - Java version: 1.7.0
INFO [main] - Java Home: C:\home\bin\jdk1.7.0_x64\jre
INFO [main] - OS: Windows 7, Vesion: 6.1
--------------------------------------------------------------------------------
_ _ _ _ ___ ___ _
| | | | | | | | \/ | | |
| | | | __ _| | | _| . . | ___ __| |
| |/\| |/ _` | | |/ / |\/| |/ _ \ / _` |
\ /\ / (_| | | <| | | | (_) | (_| |
@abelsromero
abelsromero / request_head.xml
Created November 12, 2015 10:53
Dynamic timestamp for CMIS in SoapUI: sets the timezone to ensure no problem occurs if the server is in another timezone
<wsu:Timestamp wsu:Id="TS-AD11234F3B4CF74705144725809787932">
<wsu:Created>${=TimeZone.setDefault(TimeZone.getTimeZone("UTC")); (new Date()).format("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")}</wsu:Created>
<wsu:Expires>${=(new Date()).format("yyyy-MM-dd'T23:59:59.999Z'")}</wsu:Expires>
</wsu:Timestamp>
@abelsromero
abelsromero / PdfSplitter.java
Created February 16, 2016 07:15
PDF splitter with Apache PDFBox ('org.apache.pdfbox:pdfbox:1.8.11')
import org.apache.pdfbox.exceptions.COSVisitorException;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.util.Splitter;
import java.io.File;
import java.io.IOException;
import java.util.List;
public class PdfSplitter {
@abelsromero
abelsromero / pom.xml
Created February 18, 2016 20:30
Asciidoctorj
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.asciidoctor.maven</groupId>
<artifactId>asciidoctor-diagram-example</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Asciidoctor Diagram Maven example</name>
<description>An example project that demonstrates how to integrate Asciidoctor Diagram with the Asciidoctor Maven plugin.</description>
@abelsromero
abelsromero / pom.xml
Last active July 18, 2017 13:52
Asciidoctorj + diagram + pdf
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.asciidoctor.maven</groupId>
<artifactId>asciidoctor-diagram-example</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Asciidoctor Diagram Maven example</name>
<description>An example project that demonstrates how to integrate Asciidoctor Diagram with the Asciidoctor Maven plugin.</description>