Skip to content

Instantly share code, notes, and snippets.

@yavorski
yavorski / what-forces-layout.md
Created December 16, 2021 00:23 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@yavorski
yavorski / gh-search-user-pulls.md
Created April 14, 2021 20:17
Search for pull requests from a given user in Gitgub
  • is:pr involves:yavorski
  • https://github.com/search?q=is%3Apr+involves%3Ayavorski
@yavorski
yavorski / gnome-fractional-scalling.sh
Created April 13, 2021 16:58
gnome-fractional-scalling
#!/usr/bin/env bash
# wayland
$ gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"
# x11
$ gsettings set org.gnome.mutter experimental-features "['x11-randr-fractional-scaling']"
# reset on both x11/wayland
$ gsettings reset org.gnome.mutter experimental-features
@yavorski
yavorski / wsl-nat-fix.ps1
Created January 29, 2021 15:45
WSL NAT FIX
# Add to -> Task Scheduler
# WSL 2 TPC NETWORK FORWARDING
# Introduction
# With the introduction of WSL 2 Beta, Microsoft has made changes to the system architecture.
# The changes include changing from the default bridged network adapter to a hyper-v virtual network adapter.
# The implementation was not completed during the launch of the beta program. This makes accessing of network resources under WSL 2 complex.
# The work around is to forward the TCP ports of WSL 2 services to the host OS.
# The virtual adapter on WSL 2 machine changes it's ip address during reboot which makes it tough to implement a run once solution.
" WSL yank support
" ==============================================================
" change this path according to your mount point
let s:clip = '/mnt/c/Windows/System32/clip.exe'
if executable(s:clip)
augroup WSLYank
autocmd!
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
augroup END
endif
@yavorski
yavorski / fix-ts-space.sh
Created May 5, 2020 21:41
TypeScript set output indentation to 2 spaces FIX
#!/usr/bin/env bash
sed -i 's/indentStrings = \["", " "\]/indentStrings = \["", " "\]/g' node_modules/typescript/lib/*.js
grep "indentStrings =" node_modules/typescript -R
@yavorski
yavorski / terminal-control.sh
Created March 20, 2020 00:25 — forked from bcap/terminal-control.sh
Useful terminal control characters
# Terminal output control (http://www.termsys.demon.co.uk/vtansi.htm)
TC='\e['
CLR_LINE_START="${TC}1K"
CLR_LINE_END="${TC}K"
CLR_LINE="${TC}2K"
# Hope no terminal is greater than 1k columns
RESET_LINE="${CLR_LINE}${TC}1000D"
[Trigger]
Operation=Install
Operation=Upgrade
Operation=Remove
Type=Package
Target=nvidia
Target=linux
# Change the linux part above and in the Exec line if a different kernel is used
[Action]
@yavorski
yavorski / all.txt
Created January 13, 2020 19:35 — forked from jhaddix/all.txt
all wordlists from every dns enumeration tool... ever. Please excuse the lewd entries =/
This file has been truncated, but you can view the full file.
.
..
........
@
*
*.*
*.*.*
🐎