Skip to content

Instantly share code, notes, and snippets.

View RCrowt's full-sized avatar

Richard Crowther RCrowt

View GitHub Profile
/**
* Convert a multidimensional array/object to a single dimenstion object.
* @param data {array|object} Input data.
* @param prefix {string} key prefix.
*/
var fn_dotArray = function (data, prefix) {
var out = {};
$.each(data, function (k, v) {
if (v !== null && typeof v == 'object') {
$.extend(out, fn_dotArray(v, prefix + k + '.'));
@RCrowt
RCrowt / addresses.php
Created February 6, 2018 08:20
A list of weird and edge-case UK addresses for testing
<?php
/**
* A list of weird and edge-case UK addresses for testing based on https://www.mjt.me.uk/posts/falsehoods-programmers-believe-about-addresses/
*/
return [
// Building with name.
'Royal Opera House, Covent Garden, London, WC2E 9DD',
// Numeric range building number.