Skip to content

Instantly share code, notes, and snippets.

View maxehmookau's full-sized avatar

Max Woolf maxehmookau

View GitHub Profile
@maxehmookau
maxehmookau / gist:e1b018730571a9a95d088f24b9f8aad5
Created September 4, 2017 10:33
gitlab-ci autoscaling config
concurrent = 12
check_interval = 0
[[runners]]
name = "aws-gitlab-runner-spawner"
limit = 6
url = "https://git.substrakt.com/ci"
token = "xxxxx"
executor = "docker+machine"
[runners.docker]
version: '2'
services:
redis:
image: redis
db:
image: postgres
volumes:
- "./.data/db:/var/lib/postgresql"
@maxehmookau
maxehmookau / counties.json
Created August 3, 2017 15:20
UK Counties in YAML & JSON
[
{
"name": "England",
"counties": [
"Bedfordshire",
"Buckinghamshire",
"Cambridgeshire",
"Cheshire",
"Cleveland",
"Cornwall",
@maxehmookau
maxehmookau / bbc-reply.md
Created August 2, 2017 09:30
A prescription for murder? BBC Complaint Reply

Dear Mr Woolf

Thank you for contacting us regarding the Panorama investigation ‘A Prescription for Murder?’ as shown on July 26 on BBC One.

We’ve received a range of feedback on various aspects of the programme. We appreciate that it's a sensitive issue and have carefully monitored viewer reaction.

To allow us to reply promptly, and to ensure we use our TV Licence fee resources as efficiently as possible, we’re sending this response to everyone. We’re sorry we can’t reply individually, but we hope this reply from the team involved will address most of the points raised.

We took great care from the beginning of the film, and throughout, to ensure viewers were aware that these adverse side effects only apply to a small minority of patients, and that they are safe for the majority of people who use them. We made clear in the film that they help many and can be lifesaving.

$ rails test:system
Run options: --seed 39010
# Running:
Puma starting in single mode...
* Version 3.8.2 (ruby 2.3.3-p222), codename: Sassy Salamander
* Min threads: 0, max threads: 1
* Environment: test
require "test_helper"
require "capybara/poltergeist"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :poltergeist, screen_size: [1400, 1400], options: { js_errors: true }
end
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'capybara', '~> 2'
gem 'pry'
gem 'factory_girl_rails'
gem 'faker'
gem 'shoulda', '~> 3.5'
gem 'shoulda-matchers', '~> 2.0'
gem 'mocha'
gem 'poltergeist'
FROM ruby:2.3.3
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
... general setup
COPY test/phantomjs /usr/bin/phantomjs
@maxehmookau
maxehmookau / background.log
Last active July 11, 2017 15:22
Preloading patient details
web_1 | I, [2017-07-11T14:01:06.771698 #11] INFO -- : Enqueued PreloadPatientRecordsJob (Job ID: ba184519-ccdb-4486-8c58-2cbe53b5abec) to Sidekiq(default) with arguments: #<GlobalID:0x007efe11a29890 @uri=#<URI::GID gid://myhealthcare/User/1>>
sidekiq_1 | 2017-07-11T14:01:08.087Z 1 TID-gs5hwxk04 PreloadPatientRecordsJob JID-d4d16a61150c753aed7c75be INFO: start
sidekiq_1 | D, [2017-07-11T14:01:10.062434 #1] DEBUG -- : Setting cache key: details.
sidekiq_1 | D, [2017-07-11T14:01:10.082970 #1] DEBUG -- : Setting cache key: observations.
sidekiq_1 | D, [2017-07-11T14:01:10.149937 #1] DEBUG -- : Setting cache key: conditions.
sidekiq_1 | D, [2017-07-11T14:01:10.172276 #1] DEBUG -- : Setting cache key: allergies.
sidekiq_1 | D, [2017-07-11T14:01:10.194290 #1] DEBUG -- : Setting cache key: immunizations.
sidekiq_1 | D, [2017-07-11T14:01:10.214040 #1] DEBUG -- : Setting cache key: all_medications.
sidekiq_1 | D, [2017-07-11T14:01:10.252209 #1] DEBUG -- : Setting cache
@maxehmookau
maxehmookau / user.rb
Created July 11, 2017 15:10
Slow user model
class User < ApplicationRecord
# ...
def test_results
# This API endpoint is slow.
HTTParty.get('https://someapi.com/test_results/user_id')
end
end