Skip to content

Instantly share code, notes, and snippets.

@abrichr
abrichr / gpt4v.py
Last active January 29, 2024 13:04
Example usage of GPT4-V API
# from https://github.com/OpenAdaptAI/OpenAdapt/blob/44d4a55f332ef3b846933b38854372d4166fd2ea/experiments/gpt4v.py
"""Example usage of GPT4-V API.
Usage:
OPENAI_API_KEY=<your_api_key> python3 gpt4v.py \
[<path/to/image1.png>] [<path/to/image2.jpg>] [...] "text prompt"
Example:
@egmontkob
egmontkob / Terminal_Feature_Reporting.md
Last active October 8, 2023 21:07
Feature Reporting in Terminal Emulators
@paulirish
paulirish / what-forces-layout.md
Last active May 21, 2024 09:11
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
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'