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
| /* | |
| * Doubly-nested timeout ensures we run after browser render. (Sometimes needs | |
| * to be triply-nested timeout in IE/Edge, for reasons unknown to me.) | |
| * Explanation below. | |
| * | |
| * 1. $watch runs, sets up $timeout to be run later (see NOTE below) | |
| * 2. $watch finishes (i.e., Angular has finished manipulating the DOM) | |
| * 3. First $timeout runs, sets up $timeout to be run later (see NOTE below) | |
| * 4. Browser renders | |
| * 5. Second $timeout runs! |
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
| *.ip | |
| *.log |
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
| #!/bin/bash | |
| set -e | |
| USAGE=$(cat <<"EOF" | |
| Usage: | |
| git-cherry-pick-merge <destination_branch> <merge_commit_ref> | |
| git-cherry-pick-merge --continue | |
| Cherry-pick a merge commit (and its ancestors from the merged branch) onto |
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
| 'use strict'; | |
| // | |
| // Usage: | |
| // jscodeshift -t find-lodash-method.js /path/to/dir/or/file --method-name=<lodash_method> [--min-args=<min_num_args>] [--chain-only=1] | |
| // | |
| // Prints all locations of matching uses of the lodash method (e.g., `map`). | |
| // | |
| // Function copied from https://github.com/jfmengels/lodash-codemods/blob/v1.0.1/lib/method-calls-conditional-name-changes.js#L163-L179 |
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
| // Simple, single run | |
| (function() {var body = angular.element('body'); var start = Date.now(); body.scope().$apply(); console.log((Date.now() - start) + 'ms digest');})(); | |
| // Average of 50 | |
| (function() { var body = angular.element('body'); var numRuns = 50; var totalRunTime = 0; for (var i = 0; i < numRuns; i++) { var start = Date.now(); body.scope().$apply(); totalRunTime += Date.now() - start; } console.log((totalRunTime / numRuns) + 'ms average over ' + numRuns + ' digests'); })(); |
NewerOlder