Skip to content

Instantly share code, notes, and snippets.

View ar's full-sized avatar

Alejandro Revilla ar

View GitHub Profile
@ar
ar / XLabel.java
Last active June 25, 2016 20:51
XLabel
// XLabel.java
// When used with PREFORMATTED mode, elements are appended to the DOM on the client side without consuming server memory
// When combined with server push, it can be used to monitor large logs with a user experience similar to tail -f (quite responsive)
// The reload button works as a "clear", because of course we just have state on the server for the last setState call
// Known issues pending fix: if one calls setState twice with exactly the same content, Vaadin is smart enought to avoid the
// client-side update, but in this case, we do want the update anyway (i.e. adding a line with the same content).
package org.jpos.server.ui;
import com.vaadin.ui.Label;
@ar
ar / HttpQuery.java
Created July 31, 2016 21:41
Sample HTTP client participant
package org.jpos.rest.client;
import java.io.IOException;
import java.io.Serializable;
import java.io.ByteArrayInputStream;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
import org.apache.commons.httpclient.methods.GetMethod;
@ar
ar / keybase.md
Created October 4, 2017 18:22
Keybase Proof

Keybase proof

I hereby claim:

  • I am ar on github.
  • I am aprc (https://keybase.io/aprc) on keybase.
  • I have a public key ASC55VZP5deUr53yTueYy5OZ-1qK2ltK1vV_o6DWLmknZgo

To claim this, I am signing this object:

///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.jpos:jpos:2.1.5
//
import org.jpos.iso.*;
import org.jpos.space.*;
import org.jpos.iso.packager.*;
class isomsg {
public static void main(String... args) throws Exception {
@ar
ar / Q2.java
Last active May 15, 2022 23:13
Q2 next
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.jpos:jpos:3.0.0-SNAPSHOT
//REPOS mavenCentral,jpos=https://jpos.org/maven
//JAVA 17+
class Q2 {
public static void main(String... args) throws Exception {
org.jpos.q2.Q2.main(args);
}
}
@ar
ar / Q2Boot.java
Last active October 19, 2023 01:24
Q2Boot
/*
* jPOS Project [http://jpos.org]
* Copyright (C) 2000-2022 jPOS Software SRL
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@ar
ar / install-jpos-systemd
Created August 24, 2022 02:22
jPOS Systemd install script
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This install script must be run as root" 1>&2
exit 1
fi
id -u jpos &>/dev/null || useradd --no-create-home -s /bin/false jpos
umask 027 && mkdir -p /opt/jpos
chown -R jpos.jpos /opt/jpos
@ar
ar / q2
Created October 7, 2022 20:52
Handy q2 start script
#!/bin/bash
exec build/install/${PWD##*/}/bin/q2 "$@"
@ar
ar / PackagerDebug.java
Created December 7, 2022 14:50
Packager Debug JBang script
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.jpos:jpos:2.1.8-SNAPSHOT
//REPOS mavenCentral,jpos=https://jpos.org/maven
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOUtil;
import org.jpos.iso.packager.GenericPackager;
import org.jpos.util.Logger;
import org.jpos.util.SimpleLogListener;
@ar
ar / QStart.java
Created January 30, 2023 22:14
Simple Quarkus Q2 launcher
package org.jpos.qjpos;
import io.quarkus.runtime.QuarkusApplication;
import io.quarkus.runtime.annotations.QuarkusMain;
import org.jpos.q2.Q2;
@QuarkusMain
public class QStart implements QuarkusApplication {
@Override
public int run(String... args) throws Exception {