Skip to content

Instantly share code, notes, and snippets.

View NigelGreenway's full-sized avatar

Nigel Greenway NigelGreenway

View GitHub Profile
<?php
$start = microtime(true);
/*
CREATE TABLE `employees` (
`sId` varchar(40) NOT NULL DEFAULT '',
`sUsername` varchar(255) NOT NULL DEFAULT '',
`sFirstname` varchar(255) NOT NULL DEFAULT '',
`sLastname` varchar(255) NOT NULL DEFAULT '',
@NigelGreenway
NigelGreenway / discussion.php
Last active August 29, 2015 14:21
Simple web to domain/application interface
<?php
final class EmployeeProfileAction
{
private $domain;
private $responseHandler;
public function __construct(
EmployeeService $domain,
ActiveEmployeeListingResponseHandler $responseHandler
@NigelGreenway
NigelGreenway / ajax.js
Created March 9, 2015 11:06
Trial of my own JS AJAX module
(function(window, document, undefined) {
/**
* @returns {XMLHttpRequest|ActiveXObject}
*/
function initialise () {
if (window.XMLHttpRequest) {
// [ IE7+, FireFox, Chrome, Opera, Safari ]
return new XMLHttpRequest();
} else {
@NigelGreenway
NigelGreenway / RouteCollection.php
Last active August 29, 2015 14:15
Example code for Route/FastRoute config...
<?php
/**
* This is simplistic code to illustrate how routing config files could be implemented.
*/
public function addRoutesFromConfig(
array $routes = [],
$namedRoutes = false,
Strategy\StrategyInterface $strategy = null
<?php
## Specification:
## A User needs to be able to manage tasks to help with their workflow and and self management.
## They will need the ability to add tasks, update a task and delete a task for themselves only.
## Concept:
## A user can have a collection of tasks attached to them.
## A task must consist of a `Title`, `Description` and a `User`