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
| operations = | |
| '*': (a, b) -> a*b | |
| '+': (a, b) -> a+b | |
| evaluate = (arr) -> | |
| calc = (operation, refArr) -> | |
| hasOperation = (index = arr.indexOf(operation)) isnt -1 | |
| return refArr unless hasOperation | |
| pos = index - 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
| # http://www.1758.com/hlmy/yanse2.htm | |
| $ -> | |
| timeEl = $('.time') | |
| boxEl = $('#box') | |
| interval = null | |
| eachTime = 1 # ms | |
| replaceRE = /[^\d]+/g | |
| getColor = (str) -> |
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
| 'wkjkjd fsk fsdjk\nbbb sss fasdf'.replace(/(bbb|sss)(\s)?/g, function(match, p1, p2){ | |
| var min = 1, max = p1.length - 1, | |
| pos = Math.floor(Math.random() * (max - min + 1)) + min; //randint | |
| return p1.substr(0, pos) + 'a' + p1.substr(pos, p1.length - 1) + p2; | |
| }); |
NewerOlder