diff --git a/.gitignore b/.gitignore index bc23f6a88..9fe5cb489 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules/ - currentSnippet\.js +*.md.temp.js diff --git a/README.md b/README.md index 3f3da1a6b..142e14a79 100644 --- a/README.md +++ b/README.md @@ -572,7 +572,7 @@ Calculate the difference (in days) between to `Date` objects. ```js const getDaysDiffBetweenDates = (dateInitial, dateFinal) => (dateFinal - dateInitial) / (1000 * 3600 * 24); -//getDaysDiffBetweenDates(new Date("2017-12-13"), new Date("2017-12-22")) -> 9 +// getDaysDiffBetweenDates(new Date("2017-12-13"), new Date("2017-12-22")) -> 9 ``` [⬆ back to top](#table-of-contents) @@ -606,7 +606,7 @@ If you want to curry a function that accepts a variable number of arguments (a v const curry = (fn, arity = fn.length, ...args) => arity <= args.length ? fn(...args) - : curry.bind(null, fn, arity, ...args) + : curry.bind(null, fn, arity, ...args); // curry(Math.pow)(2)(10) -> 1024 // curry(Math.min, 3)(10)(50)(2) -> 2 ``` @@ -830,7 +830,7 @@ const speak = message => { const msg = new SpeechSynthesisUtterance(message); msg.voice = window.speechSynthesis.getVoices()[0]; window.speechSynthesis.speak(msg); -} +}; // speak('Hello, World') -> plays the message ``` diff --git a/scripts/lint-script.js b/scripts/lint-script.js index 3aba12d27..5d6d8721e 100644 --- a/scripts/lint-script.js +++ b/scripts/lint-script.js @@ -3,7 +3,7 @@ Run using `npm run linter`. */ // Load modules -const fs = require('fs-extra'), cp = require('child_process'), path = require('path'); +const fs = require('fs-extra'), cp = require('child_process'), path = require('path'), chalk = require('chalk'); // Set variables for paths var snippetsPath = './snippets'; // Read files, lint each one individually and update @@ -32,7 +32,7 @@ try { fs.writeFile(path.join(snippetsPath,snippet), `${snippetData.slice(0, snippetData.indexOf('```js')+5)+lintedCode+'```\n'}`); fs.unlink(`${snippet}.temp.js`); // Log a success message - console.log(`${chalk.red('SUCCESS!')} Linted snippet: ${snippet}`); + console.log(`${chalk.green('SUCCESS!')} Linted snippet: ${snippet}`); // Log the time taken for the file console.timeEnd(`Linter (${snippet})`); }); diff --git a/snippets/curry.md b/snippets/curry.md index b47492721..bbee4086c 100644 --- a/snippets/curry.md +++ b/snippets/curry.md @@ -9,7 +9,7 @@ If you want to curry a function that accepts a variable number of arguments (a v const curry = (fn, arity = fn.length, ...args) => arity <= args.length ? fn(...args) - : curry.bind(null, fn, arity, ...args) + : curry.bind(null, fn, arity, ...args); // curry(Math.pow)(2)(10) -> 1024 // curry(Math.min, 3)(10)(50)(2) -> 2 ``` diff --git a/snippets/get-days-difference-between-dates.md b/snippets/get-days-difference-between-dates.md index d97463adb..ae93ce79d 100644 --- a/snippets/get-days-difference-between-dates.md +++ b/snippets/get-days-difference-between-dates.md @@ -4,5 +4,5 @@ Calculate the difference (in days) between to `Date` objects. ```js const getDaysDiffBetweenDates = (dateInitial, dateFinal) => (dateFinal - dateInitial) / (1000 * 3600 * 24); -//getDaysDiffBetweenDates(new Date("2017-12-13"), new Date("2017-12-22")) -> 9 +// getDaysDiffBetweenDates(new Date("2017-12-13"), new Date("2017-12-22")) -> 9 ``` diff --git a/snippets/speech_synthesis-(experimental).md b/snippets/speech_synthesis-(experimental).md index 74cdcf161..c9e6a288c 100644 --- a/snippets/speech_synthesis-(experimental).md +++ b/snippets/speech_synthesis-(experimental).md @@ -10,6 +10,6 @@ const speak = message => { const msg = new SpeechSynthesisUtterance(message); msg.voice = window.speechSynthesis.getVoices()[0]; window.speechSynthesis.speak(msg); -} +}; // speak('Hello, World') -> plays the message ```