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
| # Shell | |
| > git reset --mixed HEAD~1 | |
| > git status | |
| On branch master Untracked files: | |
| (use "git add <file>..." to include in what will be committed) | |
| mappe/ | |
| stagingMappe/ | |
| > tree | |
| ├── mappe | |
| │ └── mappeFil |
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
| # Shell | |
| > git reset --hard HEAD~1 | |
| > git status | |
| On branch master Untracked files: | |
| (use "git add <file>..." to include in what will be committed) | |
| stagingMappe/ | |
| nothing added to commit but untracked files present | |
| (use "git add" to track) | |
| > tree | |
| ├── stagingMappe |
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
| <div class="castle"></div> | |
| <div class="castle"></div> | |
| <div class="castle"></div> | |
| <div class="castle"></div> |
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
| lazy($(".castle")).map(mapFunc) | |
| .reduce(reduceFunc) | |
| .each(eachFunc); |
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
| // Javascript console | |
| ObjectWrapper {source: jQuery.fn.init[4], root: function, get: function, each: function, watch: function…} | |
| ├──source: jQuery.fn.init[4] | |
| │ ├──0: div.castle | |
| │ ├──1: div.castle | |
| │ ├──2: div.castle | |
| │ ├──3: div.castle | |
| ├──context: document | |
| ├──length: 4 | |
| ├──prevObject: jQuery.fn.init[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
| //show the length of $(".castle") | |
| > lazy($(".castle")).size() | |
| 154 | |
| //show the length of functions in $(".castle") | |
| > lazy($(".castle")).functions().size() | |
| 145 |
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
| lazy($(".castle").toArray()).map(mapFunc) | |
| .reduce(reduceFunc) | |
| .each(eachFunc); |
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
| (defn debounce-chan | |
| "Taken from https://github.com/swannodette/async-tests | |
| A little different with original one, write to channel after the interval | |
| instead of doing it in the beginning" | |
| ([source msecs] | |
| (debounce-chan (chan) source msecs)) | |
| ([c source msecs] | |
| (go-loop [state ::init | |
| last-one nil | |
| cs [source]] |
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 timeout; | |
| $(window).resize(function () { | |
| function delayed () { | |
| //the operation needed | |
| timeout = null; | |
| } | |
| if (timeout) { | |
| clearTimeout(timeout); | |
| } | |
| timeout = setTimeout(delayed, 500); |
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 timeout; | |
| var immediate = true; | |
| var wait = 500; | |
| $(window).resize(function () { | |
| console.log("debounced"); | |
| function delayed () { | |
| if (!immediate) { | |
| //the operation needed | |
| } | |
| timeout = null; |