Skip to content

Instantly share code, notes, and snippets.

Opening The Sauce

Andrew McLagan andrewmclagan

Opening The Sauce
  • Atomi
  • Melbourne, Australia
View GitHub Profile
andrewmclagan / igor-example.js
Created Aug 20, 2020
Dependancy mocking in JS
View igor-example.js
// addNumbers.js
import calculator from 'calculator';
export default function addNumbers(a, b) {
return calculator.add(a, b);
// addNumbers.spec.js
andrewmclagan /
Last active Jul 17, 2020
Beam Tech Interview - Bruno.

Below are general senior level full stack developer Q&As.

1. GraphQL vs RESTful

List some issues within RESTful APIs that GraphQL attempts to solve.

View tree-project.html
<div style="height: 700px; position: relative; overflow-y: hidden;">
height: 46px;
width: 150px;
position: absolute;
background: #536978;
z-index: 9999;
right: 5px;
andrewmclagan / is_rest.php
Created Sep 5, 2019 — forked from matzeeable/is_rest.php
Checks if the current request is a WP REST API request.
View is_rest.php
if ( !function_exists( 'is_rest' ) ) {
* Checks if the current request is a WP REST API request.
* Case #1: After WP_REST_Request initialisation
* Case #2: Support "plain" permalink settings
* Case #3: It can happen that WP_Rewrite is not yet initialized,
* so do this (wp-settings.php)
andrewmclagan /
Last active Nov 7, 2018
Search title translation reference


"All jobs"


"Jobs in Melbourne"

"Jobs in {location}"

andrewmclagan / criteriaQuery.php
Last active May 1, 2018
Style of naming and namespacing
View criteriaQuery.php
| Class has function only
use App\Criteria;
$jobs = $repository
gcloud container clusters create animals-app \
--zone=us-central1-a \
--machine-type=n1-standard-1 \
--num-nodes=3 \
View Dockerfile
FROM php:7.2-fpm-alpine3.7
MAINTAINER "Andrew McLagan"
RUN apk --no-cache add \
freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev \
wget \
git \
supervisor \
bash \
andrewmclagan / Dockerfile
Created Apr 11, 2018
docker package manager installation
View Dockerfile
FROM node:8-alpine
# Add package manger file and lock file
COPY package.json yarn.lock /usr/src
# Install dependancies from lockfile and clean package manager cache
RUN yarn install --pure-lockfile && \
yarn cache clean
# Add your application source
View Dockerfile
FROM node:8-alpine
MAINTAINER andrewmclagan
# ...