Skip to content

Instantly share code, notes, and snippets.

View robertpitt's full-sized avatar

Robert Pitt robertpitt

View GitHub Profile
import { pipeline } from 'pipe-and-compose';
import * as path from 'object-path';
/**
* A deduction can been seen as synonymous with a transformation, except that
* a deduction also performs movement of the source value(s) via a sequence of reducers
* to the destination in the output object.
*/
export type Deduction<I, O> = {
/**
/**
* Perform a async sleep operation, this is useful for testing
*/
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms))
/**
* Debounce a async function call
*/
const debounce = (fn, offsetMs = 0) => {
let timer = null
@robertpitt
robertpitt / data-example.json
Created October 17, 2019 17:23 — forked from swayvil/data-example.json
D3.js collapsing tree with boxes
{
"tree" : {
"nodeName" : "NODE NAME 1",
"name" : "NODE NAME 1",
"type" : "type3",
"code" : "N1",
"label" : "Node name 1",
"version" : "v1.0",
"link" : {
"name" : "Link NODE NAME 1",
/**
* Access Token
*/
_.extend(AccessToken, {
/**
* Update an access token
* @param {Function} callback Callback when token has been updated
*/
refreshAccessToken : function(service, force, callback) {
/**
/**
* require Kue
*/
var kue = Npm.require('kue'),
queue = kue.createQueue();
// Use Kue/queue here!
console.log(queue);
<?php
/**
* LightPHP Framework
* LitePHP is a framework that has been designed to be lite waight, extensible and fast.
*
* @author Robert Pitt <robertpitt1988@gmail.com>
* @category core
* @copyright 2013 Robert Pitt
* @license GPL v3 - GNU Public License v3
* @version 1.0.0
<?php
/**
* LightPHP Framework
* LitePHP is a framework that has been designed to be lite waight, extensible and fast.
*
* @author Robert Pitt <robertpitt1988@gmail.com>
* @category core
* @copyright 2013 Robert Pitt
* @license GPL v3 - GNU Public License v3
* @version 1.0.0
<?php
/**
* LightPHP Framework
* LitePHP is a framework that has been designed to be lite waight, extensible and fast.
*
* @author Robert Pitt <robertpitt1988@gmail.com>
* @category core
* @copyright 2013 Robert Pitt
* @license GPL v3 - GNU Public License v3
* @version 1.0.0
@robertpitt
robertpitt / jsondiff.js
Created September 10, 2013 17:25 — forked from bruth/jsondiff.js
var jsondiff = (function() {
// Patch helper functions
function getParent(paths, path) {
return paths[path.substr(0, path.match(/\//g).length)];
}
// Checks if `obj` is an array or object
function isContainer(obj) {
return _.isArray(obj) || _.isObject(obj);