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 tl = new TimelineMax() | |
| .from(myObj, 1, { /* ...values... */ }, 0) // Will play in every loop | |
| .call(loopCheck) // End loop after X times | |
| .from(myObj, 1, { /* ...values... */ }, 0) // Will not play on the last loop | |
| .repeat(-1) | |
| var loop = 0; | |
| var loopMax = 3; | |
| function loopCheck() { | |
| loop++; |
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
| [].slice.call(document.querySelectorAll('table tr td:nth-child(2)')).reduce((total, num) => { | |
| let numValue = parseInt(num.innerHTML.replace('$', '')); | |
| return total + numValue; | |
| }, 0) + '$'; |
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://adripofjavascript.com/blog/drips/making-deep-property-access-safe-in-javascript.html | |
| function deepGet (obj, props, defaultValue) { | |
| // If we have reached an undefined/null property | |
| // then stop executing and return the default value. | |
| // If no default was provided it will be undefined. | |
| if (obj === undefined || obj === null) { | |
| return defaultValue; | |
| } | |
| // If the path array has no more elements, we've reached |
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
| window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0) |
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
| if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)) { | |
| }; |
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
| ls -l zsh_demo/**/*(Lk+3) |
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
| // Test file list | |
| let fileList = [ | |
| 'myFile.js', | |
| 'myImage.png', | |
| './subdir/image.jpg', | |
| ]; | |
| // Filter images from the changed files list | |
| let imageFiles = fileList.filter(fileName => { | |
| return fileName.match(/\.(jpg|png|gif)$/); |
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
| git diff-tree -r --name-only 5410a6d 10de24d | tr '\n' ' ' |
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 a = document.querySelectorAll('*'); | |
| for (var i = 0; i < a.length; i++) { | |
| var n = a[i]; | |
| n.setAttribute('contenteditable', true); | |
| } |
OlderNewer