Skip to content

Instantly share code, notes, and snippets.

View lawrencejones's full-sized avatar

Lawrence Jones lawrencejones

View GitHub Profile

Dropin (tokenless)

The Dropin is a Javascript modal that allows integrators to initialise Billing Request Flows all from within their own websites.

Include the GoCardless Dropin initialise script on each page of your site:

<script src="https://pay.gocardless.com/billing/static/dropin/v2/initialise.js"></script>
@lawrencejones
lawrencejones / crypto.js
Created March 10, 2016 20:24
Exploitable crypto js code. Three exploits, one if you can load code before this module, one if you control the parameter passed to CryptoAPI.sha1.hash, and one if you can load code after this module
var CryptoAPI = (function() {
var encoding = {
a2b: function(a) { },
b2a: function(b) { }
};
var API = {
sha1: {
name: 'sha1',
identifier: '2b0e03021a',
@lawrencejones
lawrencejones / client.go
Created February 21, 2021 14:34
Building a goa client
package api
import (
"net/url"
goahttp "goa.design/goa/v3/http"
health "github.com/lawrencejones/pgsink/api/gen/health"
healthhttp "github.com/lawrencejones/pgsink/api/gen/http/health/client"
imports "github.com/lawrencejones/pgsink/api/gen/imports"
@lawrencejones
lawrencejones / connected-data.md
Last active December 31, 2020 14:29
Connected data: Using BigQuery to analyse user behaviour in response to webhooks
@lawrencejones
lawrencejones / consoles.go
Created October 5, 2020 15:22
Theatre consoles wrapper
package cmd
import (
"bytes"
"context"
"encoding/json"
"fmt"
"os"
"strings"
"text/template"
local app = import 'app.libsonnet';
app {
_config+:: {
release: 'release-bot',
namespace: 'connect-team',
environment: 'production',
app: 'release-bot',
image: 'eu.gcr.io/gc-containers/gocardless/release-bot',
tag: 'TODO',
@lawrencejones
lawrencejones / _hidden.libsonnet
Created June 1, 2020 16:18
Theatre auto-generated CRDs
{
local hidden = (import '_hidden.libsonnet'),
rbac:: {
v1alpha1:: {
local apiVersion = { apiVersion: 'rbac/v1alpha1' },
// Computer generated, description unknown
directoryRoleBinding:: {
new():: {},
withMetadata(metadata):: self + { metadata: metadata },
withMetadataMixin(metadata):: self + { metadata+: metadata },
@lawrencejones
lawrencejones / looker.bash
Last active March 26, 2020 16:16
Looker API helper
# Source this file ($ source <file-namne>) in your terminal to load all the
# functions.
# First run the looker-login using the client ID and client secret to generate
# an API token. Once you have your API token, run:
#
# $ export LOOKER_API_TOKEN=<your-token>
#
# This will enable use of looker-curl.
@lawrencejones
lawrencejones / README.md
Created March 25, 2020 13:57
Find indices that require forcemerging

Force-merge analysis

Find indicies that still require force-merging