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
| function fizzBuzz(n) { | |
| for(let i = 1; i <= n; i++) { | |
| //Is the number a multiple of 3 and 5 | |
| if(i % 3 === 0 && i % 5 === 0) { | |
| console.log('fizzBuzz'); | |
| } else if (i % 3 === 0) { | |
| //Is the number a multiple of 3 | |
| console.log('fizz'); |
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
| function maxChar(str) { | |
| const charMap = {}; | |
| let max = 0; | |
| let maxChar = ''; | |
| for(let char of str) { | |
| charMap[char] = charMap[char] + 1 || 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
| function reverseInt(n) { | |
| const sign = Math.sign(n); | |
| const revNum = parseInt(n.toString().split('').reverse().join('')); | |
| return sign * revNum; | |
| } |
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
| function palindrome(str) { | |
| const reved = [...str].reduce((reversed, char) => char + reversed, ''); | |
| return reved === str; | |
| } | |
| //Alternate solution | |
| //function palindrome(str) { | |
| // const reversed = str | |
| // .split('') | |
| // .reverse() |
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
| function reverse(str) { | |
| return [...str].reduce((reversed, char) => { | |
| return char + reversed; | |
| }, ''); | |
| } | |
| //Alternate solution | |
| // function reverse(str) { | |
| // const letters = [...str]; | |
| // let reved = ""; |
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
| var fetchRetry = (url, attempts) => { | |
| return new Promise((resolve, reject) => { | |
| var wrappedFetch = (triedAttempts) => { | |
| console.log('Try fetch, attempts left: ' + triedAttempts); | |
| fetch(url).then((response) => { | |
| resolve(response); | |
| }) | |
| .catch((err) => { | |
| if(triedAttempts > 0) { | |
| setTimeout(() => { |
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 Git's per-user configuration file. | |
| [user] | |
| # Please adapt and uncomment the following lines: | |
| # name = spektraldevelopment | |
| # email = [email protected] | |
| [user] | |
| email = [email protected] | |
| [credential] | |
| helper = osxkeychain | |
| [alias] |
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
| if (!window.console) console = {log: function() {}}; |
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
| var | |
| coordinates = [{ | |
| 'x': 149, | |
| 'y': 163 | |
| }, { | |
| 'x': 338, | |
| 'y': 110 | |
| }, { | |
| 'x': 690, | |
| 'y': 47 |
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
| module.exports = function(grunt) { | |
| // configure the tasks | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON("package.json"), | |
| dot: true, | |
| clean: { | |
| sass: ["files/to/clean", "other/files/to/clean"] | |
| }, | |
| watch: { |