Skip to content

Instantly share code, notes, and snippets.

🔌
Plugged in

RienNeVaPlus RienNeVaPlus

🔌
Plugged in
Block or report user

Report or block RienNeVaPlus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@RienNeVaPlus
RienNeVaPlus / emojiFlag.ts
Last active Jul 6, 2019
A TypeScript function that returns the unicode flag icon for a two-digit country code or a locale
View emojiFlag.ts
/**
* 🏁 Returns an unicode-emoji-flag-icon for a two digit country code or a locale (eg. en-US)
* - Supports 239 countries
*
* @param {String} countryCode - the country code to display a flag for (eg. US)
* @param {String} [fallback=🏳] - fallback icon when no matching flag has been found
* @param {Object} [countryFlagData] - an object of country code : flag
*/
export function emojiFlag(countryCode: string, fallback: string = '🏳', countryFlagData: {[key: string]: string} = {
AD: '🇦🇩', AE: '🇦🇪', AF: '🇦🇫', AG: '🇦🇬', AI: '🇦🇮', AL: '🇦🇱', AM: '🇦🇲', AO: '🇦🇴', AQ: '🇦🇶', AR: '🇦🇷',
@RienNeVaPlus
RienNeVaPlus / easing.js
Last active Jul 11, 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.