Skip to content

Instantly share code, notes, and snippets.

View paul-hammant's full-sized avatar

Paul Hammant paul-hammant

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Interaction 0: GET /todos

Request headers recorded for playback:

accept-language: en-US,en;q=0.9
accept-encoding: gzip, deflate, br
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
origin: https://www.todobackend.com
import tkinter
from tkinter import messagebox
import platform
import os
import subprocess
import sys
import datetime
import sqlite3
from os.path import expanduser
@paul-hammant
paul-hammant / genMavenImpactScript.py
Last active October 21, 2019 10:21
Generate quickest Maven script for the pending changes in a Git checkout
#!/bin/python3
# See https://paulhammant.com/2019/10/20/quicker-local-maven-builds
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
paul-hammant / jacoco-coverage-percentage-svg.sh
Created May 11, 2019 06:35
Showing JaCoCo coverage percentages inline in GitHub READMEs (Multi module Maven Projects)
#!/bin/bash
# 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
paul-hammant / Foo.java
Created April 12, 2019 10:34
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
paul-hammant / Swing_MVC_MultiCounterDemo.java
Last active April 5, 2019 08:24
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 {
# You may have to do:
# sudo gem install sinatra
require 'sinatra'
require 'json'
makers = {}
makers["66463882"] = JSON.parse '{
"name": "Elsie C",
@paul-hammant
paul-hammant / linkedin_alternative_on_github.md
Last active March 27, 2019 16:51
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/CCYYMMDD1.md & claims/roles/all.json
@paul-hammant
paul-hammant / op.txt
Created February 6, 2018 01:51
Jooby reactor output
[INFO] ------------------------------------------------------------------------
[INFO] Building jooby-project 1.2.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ jooby-project ---
[INFO] org.jooby:jooby-project:pom:1.2.4-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jooby 1.2.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------