This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a simple GitHub action to deploy a Single Page App to GitHub pages | |
| # Change the branch name according to your needs. | |
| # The npm package gh-pages is required as dev-dependency in your package.json for this to work | |
| # You must set a homepage field in package.json | |
| # Your deploy script must work properly | |
| name: Deploy To Github Pages | |
| on: | |
| push: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Returns an alhabatized string. | |
| * @param {String} str - String to be alphabatized? | |
| */ | |
| function alphabatize(str){ | |
| const keepCase = (a,b)=> a.toLowerCase().localeCompare(b.toLowerCase()) | |
| return str.split('').sort(keepCase).join('') | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Returns the factorial of the num passed. | |
| * @param {Number} num - What number do we need the factorial for? | |
| */ | |
| const factorial = (num) => num === 0 ? 1 : (num * factorial(num-1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Removes duplicate values from an array | |
| * @param {Array} arr - An array of numbers | |
| */ | |
| const removeDuplicates = (arr) => [...new Set(arr)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Returns the day of week based on number | |
| * @param {number} num - a number representing a day of the week. | |
| */ | |
| const dayOfWeek = (num) => ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][num-1] |