Skip to content

Instantly share code, notes, and snippets.

RienNeVaPlus RienNeVaPlus

View GitHub Profile
@RienNeVaPlus
RienNeVaPlus / easing.js
Last active Mar 8, 2019 — forked from gre/easing.js
Simple Easing Functions in JavaScript using `export`
View easing.js
/**
* Easing functions
*
* https://gist.github.com/gre/1650294
* http://easings.net
*/
// no easing, no acceleration
export function easeLinear(t){ return t; }
// accelerating from zero velocity
export function easeInQuad(t){ return t*t; }
@RienNeVaPlus
RienNeVaPlus / dateDiff.ts
Last active Mar 4, 2019
dateDiff() - returns a detail object about the difference between two dates
View dateDiff.ts
/**
* ☃ dateDiff "Snowman Carl" (http://stackoverflow.com/questions/13903897)
* Returns a detail object about the difference between two dates
*
* When providing custom units, provide them in descending order (eg week,day,hour; not hour,day,week)
*
* @param {Date} dateStart - date to compare to
* @param {Date|string} [dateEnd=new Date()] - second date, can be used as unit param instead
* @param {...string} [units=Object.keys(dateDiffDef)] - limits the returned object to provided keys
*/
You can’t perform that action at this time.