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 getCreditCardIssuer(number) { | |
| number = number.toString(); | |
| if (/^4[0-9]{12}(?:[0-9]{3})?$/.test(number)) { // Visa | |
| return { | |
| issuer : 'Visa', | |
| cidLength : 3, | |
| length : 16 | |
| }; | |
| } else if (/^5[1-5][0-9]{14}$/.test(number)) { // MasterCard | |
| return { |
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
| // Based on https://codepen.io/somethingkindawierd/post/react-mixin-scroll-lock | |
| // How this works is that it will lock the scroll of the component parents | |
| // and allow the current element to scroll | |
| import ReactDOM from "react-dom"; | |
| const ScrollLockMixin = { | |
| scrollLock: function (scrollElement) { | |
| let p; | |
| this.scrollElement = scrollElement || ReactDOM.findDOMNode(this); |
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
| const handlebars = require("handlebars"); | |
| const operators = { | |
| "+": (a, b) => a + b, | |
| "-": (a, b) => a - b, | |
| "*": (a, b) => a * b, | |
| "/": (a, b) => a / b, | |
| "%": (a, b) => a % b | |
| }; | |
| handlebars.registerHelper("math", function (a, op, b) { |
OlderNewer