Skip to content

Instantly share code, notes, and snippets.

View NigelGreenway's full-sized avatar

Nigel Greenway NigelGreenway

View GitHub Profile
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 1.56 GB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
npm: 5.6.0 - ~/.nvm/versions/node/v8.11.1/bin/npm
Utilities:
CMake: 3.7.2 - /usr/local/bin/cmake
import * as React from 'react';
type Prop = {
title: string,
content: Array<string>
};
const MyComponentContent = ({title, content}: Prop): React.Node => (
<>
<h1>{title}</h1>
version: "2"
services:
composer:
image: prooph/composer:7.1
container_name: test__composer
volumes:
- .:/app
working_dir: /app
@NigelGreenway
NigelGreenway / tools--webpack.config.dev.babel.js
Created September 13, 2017 00:11
webpack config that works with both `SASS` => `CSS` file and hot loading the css within the `webpack-dev-server` watching for changes
import merge from 'webpack-merge';
import baseConfig from './../webpack.config.babel.js';
import path from 'path';
const ROOT_PATH = path.resolve(
path.join(__dirname, '/../')
);
module.exports = merge(baseConfig, {

Window manager

  • no "Always on top mode"
  • no decent snap mode by default (3rd party app required)
  • unable to snap a window to the screen with the keyboard

Package manager

  • none available on install (homebrew or Macports required)
@NigelGreenway
NigelGreenway / react.go
Last active June 1, 2017 13:03
File watcher for ReactPHP
# to run:
# ./react.go {path_to_server.php} ./dir_one ./dir_two ...
package main
import (
"log"
"os"
"os/exec"
"fmt"
## Pre-reqs
sudo apt-get install -y apt-transport-https ca-certificates
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
## Create docker sources list file
sudo touch /etc/apt/sources.list.d/docker.list
sudo echo "deb https://apt.dockerproject.org/repo debian-jessie main" >> /etc/apt/sources.list.d/docker.list
## Update sources
sudo apt-get update
## Install docker engine
sudo apt-cache policy docker-engine
@NigelGreenway
NigelGreenway / spl_subject.php
Created June 24, 2016 09:29
SplSubject playground
<?php
class Newspaper implements \SplSubject{
private $name;
private $observers = array();
private $content;
public function __construct($name) {
$this->name = $name;
}
@NigelGreenway
NigelGreenway / analyse.php
Last active January 23, 2016 02:35
check for return type hints with interfaces
<?php
require __DIR__.'/test.file.php';
$class = new ReflectionClass(Some\TheThing::class);
////
// Better way to find if the class has strict_type enabled
////
$tokens = token_get_all(file_get_contents(__DIR__.'/test.file.php'));
@NigelGreenway
NigelGreenway / RouteFinder.php
Last active August 29, 2015 14:23
A quick mock up of generating routes from a Route config
<?php
namespace League\Route\RouteGenerator;
final class RouteGenerator
{
private $routes;
public function __construct(
array $routes = []