Skip to content

Instantly share code, notes, and snippets.

View suniladityajatni's full-sized avatar

Aditya Agarwal suniladityajatni

View GitHub Profile
@faressoft
faressoft / dom_performance_reflow_repaint.md
Last active September 11, 2024 15:18
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.
@naotokui
naotokui / midi_playback.py
Last active April 21, 2022 11:27
Play MIDI file in Python
# see: https://www.daniweb.com/programming/software-development/code/216976/play-a-midi-music-file-using-pygame
# sudo pip install pygame
# on ubuntu
# sudo apt-get install python-pygame
import pygame
def play_music(music_file):