Instantly share code, notes, and snippets.


Place the Docker Compose config file in the root of a project folder.

Ensure you've got your Docker Machine setup to use a large amount of memory, try 8GB.

Then run docker-compose up.

Once you've seen the serving http/json on port 8081 message come up, run curl\?query\=Twatt,Scotland

View jquery-svg.js
$.fn.SVG = function() {
var $img = $(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
return new Promise(function(resolve, reject) {
$.get(imgURL, function(data) {
// Get the SVG tag, ignore the rest
var $svg = $(data).find('svg');
View proxy.js
var myObject = {
testing: 'Hello',
var myProxiedObject = new Proxy(myObject, {
get: function(target, prop) {
console.log({ type: 'get', target, prop });
return Reflect.get(target, prop);
set: function(target, prop, value) {
View color.go
package main
import (
type Hex string
type RGB struct {

Keybase proof

I hereby claim:

  • I am craigchilds94 on github.
  • I am arcraig ( on keybase.
  • I have a public key ASD9qZ1FWPt1mdf02cJu9ccRuq9vNivraONG7IBLkxSzKQo

To claim this, I am signing this object:

View dea_validate.php
if (!function_exists('dea_validate')) {
* Validate a provided DEA number is valid.
* @param string $deaNumber
* @return boolean
View main.go
import (
_ ""
// The model.
type User struct {
View Duplicator.js
* Duplicate a row by the click of an
* element. Pass a callback to grab the new
* row and handle it how you please.
* @param {string} selector
* @param {Function} callback
function Duplicator(selector, callback) {
this.selector = selector;
View Templater.js
* Templater instance, pass in the selector for your template. And
* a key'd object with your data. Use "{{ key }}" in your template
* to replace values from this array.
function Templater(template, data) {
this.template = template;
this.html = $(template).html(); = data;
View time_taken.php
* Work out time taken to run a block, give it a nice name/label
* and output a nice message.
* @param string $name
* @param callable $call
* @return mixed