Skip to content

Instantly share code, notes, and snippets.

View mechmillan's full-sized avatar
💭
👨‍💻

Alfonso Millan mechmillan

💭
👨‍💻
View GitHub Profile
@glebec
glebec / debugging.md
Last active May 31, 2023 21:18
Debugging

Debugging JavaScript Applications

A practical distillation for Fullstack Academy students

Faults in computer problems were theorized as far back as 1843, when Ada Lovelace noted of Babbage's Analytical Engine, "Granted that the actual mechanism is unerring in its processes, the cards may give it wrong orders." Almost 160 years later, NIST reported that software errors cost the US $59 billion annually. Clearly, some of the cards are wrong. However, unlike Grace Hopper's famous moth, most of the time the culprit is ourselves.

Debugging is a sanitization procedure consisting of:

  • Preventing bugs in the first place, through good practices and assistive tooling.
  • Detecting bugs when they first arise, through proper error handling and testing.

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

@tannerlinsley
tannerlinsley / onWindowFocus.ts
Last active January 30, 2024 09:37
A utility function to detect window focusing without false positives from iframe focus events
type State = {
added: boolean;
interval: false | ReturnType<typeof setInterval>;
inFrame: boolean;
callbacks: Array<SetFocusedCallback>;
};
type EnrichedHTMLIFrameElement = HTMLIFrameElement & { ___onWindowFocusHandled: boolean };
type SetFocusedCallback = (focused?: boolean) => void;