Skip to content

Instantly share code, notes, and snippets.

View zyxd's full-sized avatar

Michael Afanasyev zyxd

View GitHub Profile
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
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
javascript:document.querySelector('div.player-video video').webkitSetPresentationMode('picture-in-picture')
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)
})
import {
add,
compose,
concat,
curry,
join,
length,
map,
nth,
repeat,
@zyxd
zyxd / 3sum.js
Last active May 8, 2023 14:50
One of 3Sum (https://leetcode.com/problems/3sum) solution
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)