Skip to content

Instantly share code, notes, and snippets.

View abelsromero's full-sized avatar

Abel Salgado Romero abelsromero

View GitHub Profile
@abelsromero
abelsromero / openTESArena-msys2-build.adoc
Last active July 15, 2017 16:06
First pass of installation and build manual for OpenTESArena

OpenTESArena build manual for MSYS2

mvn archetype:generate -DgroupId=org.kata -DartifactId=tictactoe -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>execute</goal>
</goals>
public class MemoryConsumer {
public static void main(String[] args) {
long seconds = 30000;
long start = System.currentTimeMillis();
Long sillyCounter = 0l;
while (start + seconds > System.currentTimeMillis())
sillyCounter++;
def extract(String text) {
(text =~ /([a-z]+)((\.[a-z]+)*?)/).collect { it[0] }
}
/**
* println extract('groovy.grails.ruby.rails')
*
* $> [groovy, grails, ruby, rails]
*/
@abelsromero
abelsromero / request.xml
Created July 26, 2016 10:48
CMIS timestamp auth token generation in SoapUI
USERNAME and PASSWORD are inserted using SoapUI feature
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<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>
<wsse:UsernameToken wsu:Id="UsernameToken-AD11234F3B4CF74705144724950372217">
<wsse:Username>USERNAME</wsse:Username>
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Asciidoctor PDF with theme Maven example 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ asciidoctor-pdf-with-theme-example ---
[INFO] Deleting C:\home\bin\cygwin64\home\ABEL.SALGADOROMERO\github\asciidoctor-maven-examples\asciidoctor-pdf-with-theme-example\target
[INFO]
@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>
@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 / 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 {