Better HN
topnewbestaskshowjobs
Log inSign up

umutdev

6 karma · joined Oct 25, 2020 (6y ago) · 8 submissions

Submissions

comment 1y ago · link · parent

level 47 cheat ``` // Keep track of already hit notes const hitNotesSet = new WeakSet();

// Define hit zone (adjust based on your game layout) const hitZoneY = window.innerHeight - 150; // ~150px from bottom const tolerance = 20; // allowed error in pixels

function hitNotes() { document.querySelectorAll('.note').forEach(note => { if (hitNotesSet.has(note)) return; // already triggered

    const rect = note.getBoundingClientRect();
    const noteY = rect.top;

    // Check if note is in hit zone
    if (Math.abs(noteY - hitZoneY) <= tolerance) {
      let arrow = note.innerText.trim();

      let keyMap = {
        '↑': 'ArrowUp',
        '↓': 'ArrowDown',
        '←': 'ArrowLeft',
        '→': 'ArrowRight'
      };

      let key = keyMap[arrow];
      if (key) {
        document.dispatchEvent(new KeyboardEvent('keydown', { key }));
        document.dispatchEvent(new KeyboardEvent('keyup', { key }));

        hitNotesSet.add(note); // mark as hit
      }
    }
  });
}

setInterval(hitNotes, 20); // check 50x per second ```

comment 1y ago · link · parent

go error handling bla bla shitpost

comment 1y ago · link · parent

why not real MSN

comment 1y ago · link · parent

this kind of thing used to be made for touchbar

5.

Privacy Sandbox current status is vulnerable to Entropy and Timing attacks(github.com ↗)

3 points · by umutdev · 2y ago · discuss

6.

Golang Vimgo Snippets for Vscode(github.com ↗)

1 points · by umutdev · 5y ago · discuss

7.

Wide Go Snippets Extension for vs Code(marketplace.visualstudio.com ↗)

2 points · by umutdev · 6y ago · discuss