Skip to content

Instantly share code, notes, and snippets.

View bactisme's full-sized avatar

Baptiste M. bactisme

View GitHub Profile
/**
* Unpivot a pivot table of any size.
* All credit to https://gist.github.com/philippchistyakov/57390ec98dcaea4502fabc5a32242b3a
*
* @param {A1:D30} data The pivot table.
* @param {1} fixColumns Number of columns, after which pivoted values begin. Default 1.
* @param {1} fixRows Number of rows (1 or 2), after which pivoted values begin. Default 1.
* @param {"city"} titlePivot The title of horizontal pivot values. Default "column".
* @param {"distance"[,...]} titleValue The title of pivot table values. Default "value".
<?php
// CONFIG
$servers = array(
array('Local', '127.0.0.1', 6379),
);
// END CONFIG
$server = 0;
if (isset($_GET['s']) && intval($_GET['s']) < count($servers)) {
$server = intval($_GET['s']);