Skip to content

Instantly share code, notes, and snippets.

View Talk-Option-Summaries.txt
Deploying straight to Production: A Scientist approach with Experiments
Deploying directly to production and testing in live can be scary, especially when your business can’t afford to lose any of
its traffic; but having a staging environment isn’t always an option, and with the right approach, the risks of deploying
straight to production can be mitigated.
View Moneo
Home Page
Today’s tech, tomorrow’s mindset, yesterday’s problems. => Todays tech, tomorrows mindset, yesterdays problems.
(no apostrophes)
You ideate, validate and prototype. => You bring the ideas,
Unsure exactly what you're saying here
on fluffy clouds
??? in the cloud?
MarkBaker /
Last active Aug 22, 2018
The following code can be used to submit an issue with the PHPSpreadsheet calculation engine

use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;


MarkBaker /
Last active Apr 17, 2018
PHPExcel formula debugging (prior to 1.7.9)

PHPExcel formula debugging

Prior to version 1.7.9

/** Error reporting */
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
View Laravel Controller
class evidenceController {
public function getDetails($id){
$course = Course::with(['courseType'])
$view = View::make('courses/parts/details')
->with('course', $course);
MarkBaker /
Last active Mar 31, 2016
Iterating over an SPLHeap appears to remove entries from the heap

Trying a little experiment with PHP's SPLHeap, but puzzled by the fact that iterating over the heap seems to be removing each entry as I access it.

The code

class ExtendedSPLHeap extends \SPLHeap {

    protected function compare($a, $b) {
        if ($a->latitude == $b->latitude) {
            return 0;
MarkBaker / anonymousFactory.php
Created Jan 29, 2016
Dynamic Instantiation of a class with optional Traits
View anonymousFactory.php
class baseClass {
protected $a;
protected $b;
public function __construct($a, $b = null) {
$this->a = $a;
$this->b = $b;
View Blockchain ID
Verifying that +markbaker is my blockchain ID.
MarkBaker / PHPExcel PHPNW13 Hackathon
Last active Dec 22, 2015
Objectives for the PHPNW13 Hackathon
View PHPExcel PHPNW13 Hackathon

For the Open Source PHPExcel library (

  • Autodetect separator, enclosure and line endings for CSV Reader

    An autodetect option that will identify the separator (e.g. comma, semicolon, pipe, tab, etc), the enclosure (e.g. quote, double quote), enclosure escape character (e.g. "" or ") and line endings for csv files, and set them up for the CSV reader.

  • Helper Wizards for number format masks

MarkBaker / Duplicate Keys in Array
Created Jul 20, 2013
Using PHP 5.5 Generators to simulate an array with duplicate keys
View Duplicate Keys in Array
function duplicateKeys($string) {
$string = strtolower($string);
$length = strlen($string);
for ($i = 0; $i < $length; ++$i) {
yield ord(strpos($string, $string[$i])) => $string[$i];
foreach (duplicateKeys('badass') as $i => $value) {
echo $i , ' -> ' , $value, PHP_EOL;