Skip to content

Instantly share code, notes, and snippets.

@MatMoore
MatMoore / cheat-sheet.md
Last active January 22, 2021 17:00
Javascript tools cheat sheet
@MatMoore
MatMoore / histogram.sql
Last active August 18, 2020 15:42
Creating a histogram in postgreSQL
with course_buckets as (
select
course_slug,
extract(days from open_for_enrolment_at - proposal_submitted_at) as days,
width_bucket(extract(days from open_for_enrolment_at - proposal_submitted_at), 0, 200,20) as bucket
from course_creation_milestones
where open_for_enrolment_at > current_timestamp - interval '3 months'
),
bucket_totals as (
@MatMoore
MatMoore / existing-process.plantuml
Created November 25, 2019 10:48
Deployment process for CCMS
@startuml
partition Development {
(*) --> "Write code in development environment"
"Write code in development environment" --> "Build for development environment"
"Build for development environment" --> "Deploy to development environment"
"Deploy to development environment" --> "Manual testing by developers"
"Manual testing by developers" --> "Push branch to github"
"Push branch to github" --> "Code review"
"Code review" --> "Merge code"
@MatMoore
MatMoore / Gems
Last active November 12, 2019 15:49
Libraries we reference in our Gemfiles and requirements.txt files
4 tzinfo-data
4 sass-rails
4 rails
3 uglifier
3 puma
3 govuk_notify_rails
3 bootsnap
2 wicked_pdf
2 sqlite3
2 simple_command
@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