Skip to content

Instantly share code, notes, and snippets.

@MrHen
MrHen / db_sizes.sql
Last active July 3, 2019 16:01
Postgres Debugging
SELECT
pg_database.datname,
pg_size_pretty(pg_database_size(pg_database.datname)) AS size
FROM pg_database;
@MrHen
MrHen / commands.md
Last active June 24, 2022 12:55
Scratchpad

AWS

KMS

aws kms encrypt --key-id '' --plaintext '' --query CiphertextBlob --output text
aws kms decrypt --ciphertext-blob fileb://<(echo '' | base64 -D)
aws kms decrypt --ciphertext-blob fileb://<(echo '' | base64 -D) --output text --query Plaintext | base64 -D
@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
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
@kwmiebach
kwmiebach / pytest.md
Last active April 28, 2024 22:34 — forked from amatellanes/pytest.sh
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help:

@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong