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
| for (var i=1; i <= 100; i++) { | |
| if (i % 15 == 0) | |
| console.log("FizzBuzz"); | |
| else if (i % 3 == 0) | |
| console.log("Fizz"); | |
| else if (i % 5 == 0) | |
| console.log("Buzz"); | |
| else | |
| console.log(i); |
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 numeralCodes = [["","I","II","III","IV","V","VI","VII","VIII","IX"], // Ones | |
| ["","X","XX","XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"], // Tens | |
| ["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"]]; // Hundreds | |
| function convert(num) { | |
| var numeral = ""; | |
| var digits = num.toString().split('').reverse(); | |
| for (var i=0; i < digits.length; i++){ | |
| numeral = numeralCodes[i][parseInt(digits[i])] + numeral; | |
| } |
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 ordinalSuffix(i) { | |
| const j = i % 10, | |
| k = i % 100; | |
| if (j === 1 && k !== 11) { | |
| return i + 'st'; | |
| } | |
| if (j === 2 && k !== 12) { | |
| return i + 'nd'; | |
| } | |
| if (j === 3 && k !== 13) { |
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
| $('a[href*="#"]:not([href="#"], [href="#carousel"])') | |
| .click(function() { | |
| if (location.pathname.replace(/^\//, '') === | |
| this.pathname.replace(/^\//, '') && | |
| location.hostname === this.hostname) { | |
| var target = $(this.hash); | |
| target = target.length ? target : | |
| $('[name=' + this.hash.slice(1) + ']'); | |
| if (target.length) { | |
| $('html, body').animate({ |
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
| $ brew install putty | |
| Place the two keys in the .ssh folder in the user directory. | |
| Now convert the PPK keys to SSH keypairs | |
| $ cd ~/.ssh | |
| Private key generation: | |
| $ puttygen id_rsa.ppk -O private-openssh -o id_rsa |
NewerOlder