Skip to content

Instantly share code, notes, and snippets.

View hansamlin's full-sized avatar
🎯
Focusing

Sam Lin hansamlin

🎯
Focusing
View GitHub Profile
class LinkedListNode {
constructor(value) {
this.next = null;
this.value = value;
}
}
class LinkedList {
constructor() {
this.head = null;
@hansamlin
hansamlin / isJavaScriptProtocol.js
Created December 29, 2023 08:57
check is javascript protocol
export const isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
@hansamlin
hansamlin / dom_performance_reflow_repaint.md
Created July 23, 2024 08:38 — forked from faressoft/dom_performance_reflow_repaint.md
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.
/* http://meyerweb.com/eric/tools/css/reset/
v5.0.2 | 20191019
License: none (public domain)
*/
html,
body,
div,
span,
applet,