Skip to content

Instantly share code, notes, and snippets.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@jan-j
jan-j / Print an associative array as an ASCII table
Last active August 8, 2018 07:53
My solution to the task "Print an associative array as an ASCII table". More info can be found on task author page: http://phpixie.com/blog/test-tasks-for-php-interviews-that-developers-will-enjoy-solving/
<?php
const SPACING_X = 1;
const SPACING_Y = 0;
const JOINT_CHAR = '+';
const LINE_X_CHAR = '-';
const LINE_Y_CHAR = '|';
$table = array(
array(
@neoascetic
neoascetic / nestedtransactor.php
Last active August 1, 2016 13:04
[Laravel] Nested transactions wrapper class
<?php
/**
* Class for Laravel 3.x that provides ability to use nested transactions via SAVEPOINTs
* (inspired from http://www.kennynet.co.uk/2008/12/02/php-pdo-nested-transactions/).
* For now, only the default connection is supported.
*
* Useful in testing, when you want to start a transaction before running a test
* and revert all its changes after it finished.
*