Skip to content

Instantly share code, notes, and snippets.

View andrewmclagan's full-sized avatar
:octocat:
Opening The Sauce

(Rew) Andrew McLagan andrewmclagan

:octocat:
Opening The Sauce
  • Atomi
  • Melbourne, Australia
View GitHub Profile
@andrewmclagan
andrewmclagan / Normalizr.php
Last active August 3, 2018 22:21
Normalized fractal response
<?php
namespace App\Http;
use League\Fractal\Pagination\CursorInterface;
use League\Fractal\Pagination\PaginatorInterface;
use League\Fractal\Resource\ResourceInterface;
use League\Fractal\Serializer\ArraySerializer;
class Normalizr extends ArraySerializer
@andrewmclagan
andrewmclagan / criteriaQuery.php
Last active May 1, 2018 00:36
Style of naming and namespacing
/*
|--------------------------------------------------------------------------
| Class has function only
|--------------------------------------------------------------------------
*/
use App\Criteria;
$jobs = $repository
->addCriteria(Criteria\Jobs\Approved::class)
gcloud container clusters create animals-app \
--zone=us-central1-a \
--machine-type=n1-standard-1 \
--num-nodes=3 \
--no-enable-autorepair
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
andrewmclagan / Dockerfile
Created April 11, 2018 11:44
docker package manager installation
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
FROM node:8-alpine
MAINTAINER andrewmclagan
# ...
@andrewmclagan
andrewmclagan / docker-compose.yml
Last active February 12, 2018 13:31
Horizontal Laravel with Docker Compose
load_balancer:
image: tutum/haproxy
links:
- web
ports:
- "80:80"
cache:
image: redis
@andrewmclagan
andrewmclagan / entrypoint.sh
Created October 12, 2016 22:04
Laravel artisan docker entrypoint script
#!/bin/bash
set -e
cd /var/www
php artisan optimize --force
php artisan config:cache
@andrewmclagan
andrewmclagan / Nginx, PHP-FPM, Supervisord: Installation steps
Last active June 6, 2017 08:56
Install PHP-FPM, Extensions, Nginx and supervisor in Alpine linux
#
#--------------------------------------------------------------------------
# Install
#--------------------------------------------------------------------------
#
RUN apk --no-cache add \
libmcrypt-dev \
freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev \
wget \
import React from 'react';
import PropTypes from 'prop-types';
import DataTable from 'components/DataTable';
import CollectionViewControls from 'components/CollectionViewControls';
/**
* Entity collection view
* @author Andrew McLagan <andrewmclagan@gmail.com>
*/
export default ({ collection, children, filters, className }) => (