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 unique = (array) => Array.from( | |
| new Set(array.map(x => JSON.stringify(x))), | |
| x => JSON.parse(x) | |
| ) | |
| const combinations = (array) => new Array(1 << array.length) | |
| .fill() | |
| .map((_, i) => array.filter((_, j) => i & (1 << j))) | |
| const threeSum = (array) => combinations(array) |
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
| import { | |
| add, | |
| compose, | |
| concat, | |
| curry, | |
| join, | |
| length, | |
| map, | |
| nth, | |
| repeat, |
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 wait = () => new Promise(resolve => setTimeout(resolve, 1000)) | |
| const start = async () => { | |
| console.log('started') | |
| await [1, 2, 3] | |
| .map(index => async () => { | |
| await wait() | |
| console.log(index) | |
| }) |
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:document.querySelector('div.player-video video').webkitSetPresentationMode('picture-in-picture') |
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 zyxdAttack() | |
| -- If target exists, enemy | |
| if GetUnitName("target") and not UnitIsFriend("player", "target") and not IsCurrentAction(60) then | |
| UseAction(60); | |
| end | |
| end | |
| function zyxdWarriorCharge() | |
| -- If target exists and enemy | |
| if GetUnitName("target") and not UnitIsFriend("player", "target") then |
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 zyxdAttack() | |
| -- If target exists, enemy | |
| if GetUnitName("target") and not UnitIsFriend("player", "target") and not IsCurrentAction(60) then | |
| UseAction(60); | |
| end | |
| end | |
| function zyxdWarriorCharge() | |
| -- If target exists and enemy | |
| if GetUnitName("target") and not UnitIsFriend("player", "target") then |