Skip to content

Instantly share code, notes, and snippets.

Avatar

Bryan Rayner bryanerayner

View GitHub Profile
@bryanerayner
bryanerayner / immutableAggregateReduce.ts
Created Apr 10, 2017
This method returns an array of items which have changed
View immutableAggregateReduce.ts
/**
* This runs aggregate_reduce through a sequence, in an immutable, repeatable fashion.
*
* First, elements in the sequence which were not processed, are run through evaluate().
*
* Next, elements which still have to be processed, are run through aggregateReduce().
*
* Both the aggregate, and the full sequence, are returned after execution.
*
View StreamQueue.js
var StreamQueue = (function () {
function StreamQueue() {
// The factory
this.nextTaskFactory = null;
// The current task
this.currentTask = null;
// Tasks which must have end() called on them.
View generateTemplateString.js
/**
* Produces a function which uses template strings to do simple interpolation from objects.
*
* Usage:
* var makeMeKing = generateTemplateString('${name} is now the king of ${country}!');
*
* console.log(makeMeKing({ name: 'Bryan', country: 'Scotland'}));
* // Logs 'Bryan is now the king of Scotland!'
*/
var generateTemplateString = (function(){
View gist:269480242eaf461632a2
/**
* Created by bryanerayner on 2014-10-18.
*/
///<reference path = "types.d.ts" />
module graphs
{
export interface INode<T>
{
_getUId:()=>string; // The string
@bryanerayner
bryanerayner / jquery.classList.js
Last active Aug 29, 2015 — forked from RubaXa/jquery.classList.js
Change jQuery to use the more performant classList over string concatenation methods, when ClassList is available
View jquery.classList.js
/**
* jQuery extension, add support `classList`.
*
* @author RubaXa <trash@rubaxa.org>, bryanerayner <bryan@bryanerayner.ca>
* @license MIT
*/
(function ($) {
var
_rspace = /\s+/
View SASS Prefix Mixin
/**
Prefix - Prefixes a property with webkit, moz, or o.
Usage:
@include prefix(animation, slide 1s)
Outputs:
-webkit-animation: slide 1s;
-moz-animation: slide 1s;