Skip to content

Instantly share code, notes, and snippets.

@johnnolan
johnnolan / crontab.sh
Created July 31, 2025 19:18
Example docker-compose to setup a fully self hosted Git, CI/CD and Docker Registry pipeline with renovate crontab command.
#!/bin/sh
docker run --rm --name renovate \
-e RENOVATE_PLATFORM=gitea \
-e RENOVATE_ENDPOINT=https://gitea.url.com \
-e RENOVATE_TOKEN="$RENOVATE_TOKEN" \
-e RENOVATE_GIT_AUTHOR="Renovate Bot <bot@renovateapp.com>" \
-e RENOVATE_AUTODISCOVERY=true \
-e RENOVATE_ONBOARDING=true \
-e RENOVATE_AUTODISCOVERYFILTER=johnnolan/* \
@johnnolan
johnnolan / .woodpecker.yml
Last active July 31, 2025 18:46
Self hosted VS Code Server Dockerfile with an example of installing tooling to be able to run tools such as pupeteer, pa11y, terraform, node, npm and yarn. This image can easily be changed to add more tooling specific to your setup such as Python or PHP. I also create my alias's here to easily call common commands such as `tf` instead of `terraf…
steps:
build:
image: woodpeckerci/plugin-docker-buildx:6.0.2
settings:
registry: registry.url.com
repo: registry.url.com/vscode-server-custom
tag: build-${CI_PIPELINE_NUMBER}
dockerfile: ./Dockerfile
when:
event:
@johnnolan
johnnolan / lpa.json
Last active November 2, 2022 14:04
ttl lpa
[
{
"@id": "http://w3id.org/lpa/",
"@type": ["http://www.w3.org/2002/07/owl#Ontology"],
"http://purl.org/dc/terms/title": [
{ "@value": "LPA ontology", "@language": "en" }
],
"http://purl.org/dc/terms/description": [
{
"@value": "The Lasting Power of Attorney ontology aims at describing the Lasting Power of Attorney document.",
@johnnolan
johnnolan / test.json
Last active September 16, 2022 13:58
testschema
{
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"LastingPowerOfAttorney": {
"@id": "https://www.opg.gov.uk.org/2022/LastingPowerOfAttorney",
"@context": {
"@version": 1.1,
@johnnolan
johnnolan / tech-ethics-adr.md
Created August 18, 2022 07:57
Tech Ethics Architectural Decision Record Template

NUMBER - TITLE

Date: DATE

Status

Accepted | Proposed | Deprecated | Superseded

Context

@johnnolan
johnnolan / example-response.json
Created March 8, 2021 09:04
Performance Platform API
[
{
"_id": "MjAyMC0wNi0wMVQwMDowMDowMCswMDowMG9wZy11c2UtYW4tbHBhbW9udGh0cmFuc2FjdGlvbnNkaWdpdGFs",
"_timestamp": "2020-06-01T00:00:00+00:00",
"service": "opg-use-an-lpa",
"channel": "digital",
"count": 456,
"dataType": "transactions",
"period": "month"
},

Keybase proof

I hereby claim:

  • I am johnnolan on github.
  • I am jb_moj (https://keybase.io/jb_moj) on keybase.
  • I have a public key ASCjbGsl86fHW4BRygZIlxzatF_SluEkb1xEyuuzq_asCAo

To claim this, I am signing this object:

@johnnolan
johnnolan / JestReactHOC.js
Last active April 9, 2024 10:03
Example on how to test a React Higher Order Component using react-testing-library
import React from 'react'
import {render, cleanup} from 'react-testing-library'
// withHOC.js
function withHOC (WrappedComponent) {
render() {
return (
<main>
<section>
<h1>HOC Example</h1>
import React from "react";
import Button from "Button";
import { mountWrap } from 'contextWrap';
describe("Given the button is rendered with just a label", () => {
const data = {
label: "My Button"
}
let wrapper, aElement;
@johnnolan
johnnolan / setPropsInReduxEnzymemount.js
Last active February 11, 2019 09:19
If you want to test a Connected Component within a Provider while using Enzyme's mount and set its props to test how it renders by using something like toMatchSnapshot then you can set the props like so.
import React from "react";
import { mount } from 'enzyme';
import renderer from 'react-test-renderer'
import { Provider } from 'react-redux'
describe("Given you have a component that is wrapped in a Redux store and mount it, then you want to update the props of the child component", () => {
it('renders correctly', () => {
const mockStore = configureStore();
let store = mockStore(initialState)
let wrapper = mount(<Provider store={ store }><ConnectedComponent /></Provider>)