Skip to content

Instantly share code, notes, and snippets.

View billinghamj's full-sized avatar
🏳️‍🌈
👀

James Billingham billinghamj

🏳️‍🌈
👀
View GitHub Profile
package polymorphism
type Type interface{ ~string }
type Base[TType Type] interface {
GetType() TType
SetType(TType)
}
type Params[TType Type] interface {
@billinghamj
billinghamj / terraform-providers.yml
Created April 13, 2022 13:53
.terraform.lock.hcl platforms
on:
pull_request_target:
paths:
- 'infra/**/.terraform.lock.hcl'
- '.github/workflows/terraform-providers.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@billinghamj
billinghamj / card-offline-outbound.json
Last active September 10, 2021 10:15
Monzo transaction types
{
"id": "tx_[transaction-id]",
"created": "2017-07-24T05:45:49.311Z",
"description": "TFL.GOV.UK/CP\\VICTORIA STREET\\TFL TRAVEL CH\\SW1H 0TL GBR",
"amount": -770,
"currency": "GBP",
"merchant": null,
"notes": "",
"metadata": {
"mastercard_clearing_message_id": "mcclearingmsg_[mastercard-clearing-message-id]",
@billinghamj
billinghamj / 1-preferred-format.json
Last active June 16, 2016 14:22
Example Policy Batch Files
[
{
"id": "46fe8500-52e2-11e5-ab91-9b1a2fe9338e",
"ref": "PWKJCDPA4",
"startDate": "2015-09-04T08:52:31.182Z",
"endDate": "2015-09-04T09:52:31.182Z",
"startLocation": {
"latitude": 51.5116821067071,
"longitude": -0.1326164101313357,
"postcode": "W1D 6LT"
@billinghamj
billinghamj / apple-pay.js
Created June 14, 2016 13:18
Apple Pay JS
const aps = new ApplePaySession(1, {
countryCode: 'GB',
currencyCode: 'GBP',
supportedNetworks: ['visa', 'masterCard', 'amex'],
merchantCapabilities: ['supports3DS', 'supportsEMV'],
total: { label: 'Test 2', amount: '10.00' },
});
someButton.on('click', () => aps.begin());
@billinghamj
billinghamj / body-codes.csv
Last active January 24, 2024 15:01
DVLA V355 - code mappings, normalized & cleaned, in CSV format
Code Category Subcategory Description
1 Cars & Light 4X4 Utilities Cars 2-Door Saloon
2 Cars & Light 4X4 Utilities Cars 4-Door Saloon
3 Cars & Light 4X4 Utilities Cars Saloon (for information only, no longer used)
4 Cars & Light 4X4 Utilities Cars Convertible
5 Cars & Light 4X4 Utilities Cars Coupe
6 Cars & Light 4X4 Utilities Cars Estate
11 Cars & Light 4X4 Utilities Cars Hearse
12 Cars & Light 4X4 Utilities Cars Limousine
13 Cars & Light 4X4 Utilities Cars 3-Door Hatchback
import express from 'express';
import request from 'request';
const app = express();
export default app;
const preRequestRouter = new express.Router();
const postRequestRouter = new express.Router();
// middleware is run in order

Keybase proof

I hereby claim:

  • I am billinghamj on github.
  • I am billinghamj (https://keybase.io/billinghamj) on keybase.
  • I have a public key ASAQvSgKR433Yc-RZa6Hdh33a5LcJNcbo6dnobEW5dmTsgo

To claim this, I am signing this object:

@billinghamj
billinghamj / main.go
Created April 6, 2016 11:38
Go JWT Generator - ES512 with OpenSSL PEM format keys
package main
import (
"crypto"
"crypto/x509"
"encoding/pem"
"fmt"
"github.com/dgrijalva/jwt-go"
"io/ioutil"
"time"
@billinghamj
billinghamj / storage.js
Created March 30, 2016 08:54
Light MongoDB Abstraction
import log from 'cuvva-log';
import {MongoClient, ObjectID} from 'mongodb';
export default class Storage {
static async create(url) {
// for this particular service, majority is worth having
// if copying, evaluate your write concern needs properly
const db = await MongoClient.connect(url, {
db: { w: 'majority' },
});