Skip to content

Instantly share code, notes, and snippets.

View nadinengland's full-sized avatar
💭
Technical Director at @few-far

Thomas Nadin nadinengland

💭
Technical Director at @few-far
View GitHub Profile
@nadinengland
nadinengland / Builder.php
Last active August 30, 2018 08:44
How we simplified our development process: Code Snippets
<?php
abstract class Builder
{
/**
* Builds the array version on the input parameter.
*
* @param mixed $source
* @return mixed
*/
@nadinengland
nadinengland / queue.js
Created December 17, 2013 14:23
Queuing Deferred Tasks
var Queue = function () {
var previous = new $.Deferred().resolve();
return function (fn, fail) {
return previous = previous.then(fn, fail || fn);
};
};
@nadinengland
nadinengland / gist:5404126
Last active December 16, 2015 08:09
Parsing if expressions in CoffeeScript and JavaScript
var funcs = [
function () { if (true) if (true) return 0; else return 1; }, // 0
function () { if (true) { if (true) return 0; else return 1; } }, // 0
function () { if (true) { if (true) return 0; } else return 1; }, // 0
function () { if (false) if (true) return 0; else return 1; }, // undefined
function () { if (false) { if (true) return 0; else return 1; } }, // undefined
function () { if (false) { if (true) return 0; } else return 1; }, // 1
function () { if (true) if (false) return 0; else return 1; }, // 1
@nadinengland
nadinengland / StringBool.cpp
Created December 6, 2012 17:16
StringBool class useful for debugging when you want to know whether or not it was an int or bool.
//
// StringBool.hpp
// StringBool, Textual Cohesion Bool
//
// Created by Thomas Nadin on 06/12/2012.
// Useful for debugging when you want to know whether or not it was an int or bool.
//
#ifndef TNADIN_STRING_BOOL_HPP
#define TNADIN_STRING_BOOL_HPP
@nadinengland
nadinengland / virtual_operators.cpp
Created November 7, 2012 22:49
Virtual & Concrete operators in C++
//
// virtual_operators.cpp
// Virtual & Concrete operators in C++
//
// Created by Thomas Nadin on 07/11/2012.
// Copyright (c) 2012 Thomas Nadin. All rights reserved.
//
#include <iostream>