Skip to content

Instantly share code, notes, and snippets.

Taras Kharuk TuxujPes

Block or report user

Report or block TuxujPes

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
View sass-vars-to-json.js
module.exports = (sheet) => {
const variableRegex = /\$(.+):\s+(.+);?/;
const variables = {};
sheet.split('\n').forEach((line) => {
const variable = variableRegex.exec(line);
if (!variable) return;
const name = variable[1].trim();
const value = variable[2].replace(/!default|!important/g, '').trim();
@TuxujPes
TuxujPes / Plural.js
Last active Jun 6, 2016 — forked from kjantzer/Plural.js
JavaScript: Plural - create a plural or singluar sentence based on a number
View Plural.js
/**
* naive implementation of singular/plural sentence based on count.
* e.g.:
* var str = "Do you want to delete this? There {are|is} [num] book{s} attached."
*
* pluralize(str, 1); // => Do you want to delete this? There is 1 book attached."
* pluralize(str, 2); // => "Do you want to delete this? There are 2 books attached."
*
* @method function
*
You can’t perform that action at this time.