Skip to content

Instantly share code, notes, and snippets.

@MatMoore
MatMoore / barometer.md
Last active October 13, 2019 14:06
Career goals

Job Barometer

I want my job to give me:

  • Autonomy to decide what I work on and how I go about it ✅
  • Small feedback cycles and ability to experiment (e.g. being able to release frequently) ❌
  • Novelty (not doing the same thing over and over) ✅
  • Purpose (I can agree with the team's goals) ✅
  • People to collaborate with, learn from, and teach ✅

I want to avoid:

@MatMoore
MatMoore / roof_debug.py
Created July 5, 2019 13:27
Tool to show the ROOF view structure
from xml.etree.ElementTree import parse, tostring
from glob import glob
child_perspectives = {}
all_viewpoints = []
for filename in glob('pui/webroot/WEB-INF/config/view/*.xml'):
with open(filename) as f:
doc = parse(f)
@MatMoore
MatMoore / dockerindocker.md
Last active June 21, 2019 13:05
Remote docker problems

Problem

I want to build a container inside my circleci build and mount files from the outer build environment.

Running this docker command works outside of circleci, but not on circleci (when using the docker exectutor with setup_remote_docker).

circleci@07b4d1bb33c0:/tmp/workspace$ docker run -p 7001:7001 -p 9002:9002 -v $(pwd):/u01/oracle/properties store/oracle/weblogic:12.2.1.3
Domain Home is:  /u01/oracle/user_projects/domains/base_domain
awk: warning: command line argument `/u01/oracle/properties/domain.properties' is a directory: skipped
The domain username is blank. The Admin username must be set in the properties file.
@MatMoore
MatMoore / modernisation-patterns.md
Last active June 7, 2019 18:54
Modernisation patterns

Adopt a modern build tool

Context

  • The existing build scripts used ant
  • We had multiple build artefacts, ant scripts and property files
  • A lot of configuration was targeted at a specific environment and OS (windows)
  • Dependencies were bundled with the project

Problem

  • The build scripts were difficult to understand
  • Ant is not a technology we use for other projects so developers are unfamiliar with it
@MatMoore
MatMoore / gist:645a03f7b5debc11ae184a8ee231d60a
Last active April 25, 2019 14:34
Tools for detecting and removing sensitive information from code repositories
@MatMoore
MatMoore / constraint-sorter.rb
Created April 1, 2019 16:26
Scripts for getting schema exports into liquibase format
#!/usr/bin/env ruby
current_statement_lines = []
primary_keys = []
other_constraints = []
current_statement = :unknown
lines = File.readlines(ARGV.first)
lines.each do |line|
current_statement_lines << line.gsub("\r", '')
@MatMoore
MatMoore / accessibility.md
Last active December 21, 2018 11:28
Notes from (visiting) speakers at GDS

People that can not distinguish colours can understand all information

avoid instruction that rely on colour don't communicate through colour alone People that have low vision are able to see content

default text size is not too small default colour contrast is good the appearance of online content can be overridden (with browser and operating system settings) - and guidance is provided on how to do this is easy to find This also helps people experiencing a situational impairment such as bright sunlight

@MatMoore
MatMoore / registers_clients.csv
Created December 14, 2018 17:20
List of registers clients
URL Language
https://github.com/ministryofjustice/openregister-client Python
https://github.com/robmckinnon/openregister-ruby Ruby
https://github.com/nickcolley/registers.js Javascript
https://github.com/nacnudus/registr R
https://github.com/maxf/node-openregisters Javascript
https://github.com/benlaurie/gds-registers Go
https://www.nuget.org/packages/GovukRegistersApiClientNet/ .Net
#!/usr/bin/env ruby
require 'faraday'
require 'json'
response = Faraday.get 'https://www.gov.uk/api/content'
homepage = JSON.parse(response.body)
level_one = homepage['links']['level_one_taxons'].map do |item|
item["api_path"]
end
# Full code here:
# https://github.com/googleads/google-api-ads-ruby/blob/master/adwords_api/examples/solutions/conflicting_keywords/conflicting_keywords.rb
def compare_keywords(negatives, positive)
negatives.each do |negative|
match_type = negative.match_type.downcase
negative_text = negative.text.downcase
positive_text = positive.text.downcase
match = false
# If the negative keyword is more strict than the positive one, it cannot