Go to File -> Settings -> Tools -> Terminal and change Shell path based on the the installed git version.
for 64bit:
"C:\Program Files\Git\bin\sh.exe" --login -ifor 32bit:
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i| // https://juejin.im/post/5cc55eb5e51d456e577f93f0 | |
| // 随机更改数组元素顺序,混淆数组 | |
| const shuffleArr = (arr) => arr.slice().sort(() => Math.random() - 0.5) | |
| // 方便快捷创建特定大小的数组 | |
| const createArr = (n) => [...Array(n).keys()] | |
| // 3 --> [0, 1, 2] |
| // Forked from https://codepen.io/gapcode/pen/vEJNZN | |
| // Get IE or Edge browser version | |
| var version = detectIE(); | |
| if (version === false) { | |
| document.getElementById('result').innerHTML = '<s>IE/Edge</s>'; | |
| } else if (version >= 12) { | |
| document.getElementById('result').innerHTML = 'Edge ' + version; | |
| } else { |
| // UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that | |
| // does not support `nomodule` is probably not being used anywhere. The code below is left | |
| // for posterity. | |
| /** | |
| * Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will | |
| * load <script nomodule> anyway. This snippet solve this problem, but only for script | |
| * tags that load external code, e.g.: <script nomodule src="nomodule.js"></script> | |
| * | |
| * Again: this will **not** prevent inline script, e.g.: |
Go to File -> Settings -> Tools -> Terminal and change Shell path based on the the installed git version.
for 64bit:
"C:\Program Files\Git\bin\sh.exe" --login -ifor 32bit:
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i| /** | |
| * Detects if two elements are colliding | |
| * | |
| * Credit goes to BC on Stack Overflow, cleaned up a little bit | |
| * | |
| * @link http://stackoverflow.com/questions/5419134/how-to-detect-if-two-divs-touch-with-jquery | |
| * @param $div1 | |
| * @param $div2 | |
| * @returns {boolean} | |
| */ |
| // Determine if an element is in the visible viewport | |
| function isInViewport(element) { | |
| var rect = element.getBoundingClientRect(); | |
| var html = document.documentElement; | |
| return ( | |
| rect.top >= 0 && | |
| rect.left >= 0 && | |
| rect.bottom <= (window.innerHeight || html.clientHeight) && | |
| rect.right <= (window.innerWidth || html.clientWidth) | |
| ); |