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
| /*! Prefix flex for IE10 and Safari / iOS in LESS | |
| * https://gist.github.com/codler/2148ba4ff096a19f08ea | |
| * Copyright (c) 2014 Han Lin Yap http://yap.nu; MIT license */ | |
| .display(@value) when (@value = flex) { | |
| display: -ms-flexbox; // IE10 | |
| display: -webkit-flex; // Safari / iOS | |
| } | |
| .display(@value) when (@value = inline-flex) { |
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
| <html> | |
| <head> | |
| <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> | |
| <title>Select/Change option</title> | |
| <style type="text/css"> | |
| .red {color: red;} | |
| .black {color: black;} |
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
| //set -> accepts a string or an array of letters and numbers | |
| function removeRepeated(el) { | |
| return Array.from(new Set(el)).join(''); | |
| } | |
| //for loop -> accepts a string or an array of letters and numbers | |
| function removeRepeated(el){ | |
| let arr = [] | |
| for(let i = 0;i < el.length; i++){ | |
| if(arr.indexOf(el[i]) == -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 reverseNum(n) { | |
| var result = []; | |
| var reversed = n.toString().split('').reverse().join(''); | |
| for (var i = 0; i < reversed.length; i++) { | |
| result.push(+reversed.charAt(i)); | |
| } | |
| return result; | |
| } |
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 factorial(x) { | |
| if (x === 0) { | |
| return 1; } | |
| return x * factorial(x-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 factorial(num) { | |
| var result= 1; | |
| for (var i = 2; i <= num; i++) { | |
| result *= i; | |
| } | |
| return result; | |
| } |
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 test(value) { | |
| //test for an empty or null input and return null | |
| if(value === null || !value.length) { | |
| return null; | |
| } | |
| } |
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 removeVowels = function(str){ | |
| var vowels = [ "a", "e", "i", "o", "u"]; | |
| var newStr = []; | |
| for (var i in str) { | |
| if(!vowels.includes(str[i])) newStr.push(str[i]); | |
| } | |
| return newStr; | |
| } |
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 compareVowels = function(str){ | |
| var vowels = [ "a", "e", "i", "o", "u"]; | |
| var newStr = []; | |
| for(var i = 0;i<str.length;i++){ | |
| for(var j = 0; j<vowels.length;j++) { | |
| if(str[i] === vowels[j]) { | |
| newStr.push(str[i]); | |
| } |