jest --collectCoverageFrom='[\"**/*.js\",\"!src/js/vue/**/*.js\"]' --coverage
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 doSomething = () => { /* Do something */ } | |
| let onResizeEnd; | |
| window.addEventListener('resize', () => { | |
| if (onResizeEnd) { | |
| clearTimeout(onResizeEnd); | |
| } | |
| onResizeEnd = setTimeout(() => doSomething(), 400); | |
| }); |
git checkout --orphan new-squashed-branch master
git commit
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.history.replaceState(null, null, `${location.pathname}?abcd=1234`); |
# Rebase the master branch
git checkout master
git pull --rebase# Checkout the branch you want to rebase with master
git pull --rebase origin master
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
| /** | |
| * @param element The element to add the event | |
| * @param type Event type (i.e. 'click') | |
| * @param callback Function to execute when event is triggered | |
| */ | |
| function (element, type, callback) { | |
| try { | |
| element.addEventListener(type, callback, false); | |
| } catch (e) { | |
| element.attachEvent('on' + type, callback); |
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
| export enum ExampleStringEnum { | |
| PROPERTY_A = 'property-a' as any as ExampleStringEnum, | |
| PROPERTY_B = 'property-b' as any as ExampleStringEnum, | |
| } |
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 myTransitionSettings(transition) { | |
| transition | |
| .delay(0) | |
| .duration(100) | |
| .style('background', 'blue') | |
| } | |
| d3.transition().call(myTransitionSettings) |
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 checkScheduledTransitions(element) { | |
| const transitions = element.__transition | |
| if (transitions) { | |
| return Object.keys(transitions).length | |
| } else { | |
| return false | |
| } | |
| } |