Skip to content

Instantly share code, notes, and snippets.

Paul Hammant paul-hammant

Block or report user

Report or block paul-hammant

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
paul-hammant /
Last active Oct 21, 2019
Generate quickest Maven script for the pending changes in a Git checkout
# See
import sh, os
from pathlib import Path
log = sh.git.log("--oneline", "--no-color", "--decorate=short", _tty_out=False)
hashLine = ""
for line in log.split("\n"):
paul-hammant /
Created May 11, 2019
Showing JaCoCo coverage percentages inline in GitHub READMEs (Multi module Maven Projects)
# You will have needed to have installed 'xmlstarlet' first
# Each time you use this, you will have had to run tests "mvn clean install" first.
# In your README, have a line like so, to display the coverage.
# Code Coverage: ![](coverage-percentage.svg?raw=true&sanitize=true)%
paul-hammant /
Created Apr 12, 2019
MVC example for a single "text field" form
import javax.swing.*;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.PlainDocument;
public class Foo {
public static void main(String[] args) {
// setup model
paul-hammant /
Last active Apr 5, 2019
Demo of MVC concepts using Java's Swing.
import javax.swing.*;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class Swing_MVC_MultiCounterDemo extends JFrame {
View pizzaMakerServer.rb
# You may have to do:
# sudo gem install sinatra
require 'sinatra'
require 'json'
makers = {}
makers["66463882"] = JSON.parse '{
"name": "Elsie C",
paul-hammant /
Last active Mar 27, 2019
Linkedin alternative on Github?

Is anyone interested in an alternative to LinkedIn based on GitHub* (likely to mean a subset to just tech savvy users initially).

Decentralized data-centric GitHub repos

Your GitHub repo is a about you and your claims:

eg. "I worked at FoobarLLC as a Director of Engineering between CCYYMMDD1 and CCYYMMDD2 and did blah blah blah." 

files: claims/roles/foobarllc/ & claims/roles/all.json
paul-hammant / op.txt
Created Feb 6, 2018
Jooby reactor output
View op.txt
[INFO] ------------------------------------------------------------------------
[INFO] Building jooby-project 1.2.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ jooby-project ---
[INFO] org.jooby:jooby-project:pom:1.2.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Building jooby 1.2.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
View gist:cda6da1ee075424f28a8a76755f28d32
# RFC 822, updated by RFC 1123 - e.g. Sun, 06 Nov 1994 08:49:37 GMT
Date: ((Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-9]{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2} GMT)
# RFC 850 (obsoleted by RFC 1036) - e.g. Sunday, 06-Nov-94 08:49:37 GMT
Date: ((Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)day, [0-9]{2}-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} GMT)
# ANSI C's asctime() format - e.g. Sun Nov 6 08:49:37 1994
Date: ((Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) *[0-9]{1,2} [0-9]{1,2}:[0-9]{2}:[0-9]{2} [0-9]{4})
View svgdemo.html
<svg xmlns="" xmlns:xl="" version="1.1" viewBox="139 -165 728 472" width="728pt" height="472pt" xmlns:dc="">
<metadata> Produced by OmniGraffle 7.5
<dc:date>2017-12-17 12:55:15 +0000</dc:date>
<font-face font-family="Helvetica Neue" font-size="16" panose-1="2 0 5 3 0 0 0 2 0 4" units-per-em="1000" underline-position="-100" underline-thickness="50" slope="0" x-height="517" cap-height="714" ascent="951.9958" descent="-212.99744" font-weight="500">
<font-face-name name="HelveticaNeue"/>
paul-hammant /
Created Oct 10, 2017 — forked from printminion/
renew ssl letsencrypt certificate on bitnami server
#renew ssl letsencrypt certificate on bitnami server
sudo /opt/bitnami/ stop apache
cd /home/user/certbot
#./certbot-auto certonly --standalone -w /opt/bitnami/apache2/conf/ -d example
.com -d
./certbot-auto renew
sudo cp /etc/letsencrypt/live/ /opt/bitnami/apache2/conf/server.crt
You can’t perform that action at this time.