Skip to content

Instantly share code, notes, and snippets.

View datibbaw's full-sized avatar

Tjerk Anne Meesters datibbaw

View GitHub Profile
@DaveRandom
DaveRandom / build_url.php
Last active December 20, 2015 05:28
PHP build_url()
<?php
function build_url($parts)
{
$result = '';
if (isset($parts['scheme'])) {
$result .= $parts['scheme'] . ':';
}
@datibbaw
datibbaw / monad.php
Last active December 23, 2015 07:58
Playing with monads, inspired by Crockford's implementation: https://github.com/douglascrockford/monad/blob/master/monad.js
<?php
// A silly prototype chain until I can think of something better
class prototype
{
private $inherited;
private $instance;
public function __construct(prototype $prototype = null)