Skip to content

Instantly share code, notes, and snippets.

@romain-trotard
romain-trotard / UnderTheHoodOfReactEventListener.md
Last active May 18, 2025 14:57
Under the hood of event listeners in React

Recently, during the migration to React 17, I had a problem between event listeners handled by React and one added document manually. It was due to this part on the React 17 release note.

At this moment I understood that I had a misconception of how React handles event listener. So I decided to explore the React code to understand how it works.

The misconception

Before going deep in the React codebase, I would like to explain what was in my head about the management of event listeners.

For example when I write this simple code:

KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
T3ZWQ-P2738-3FJWS-YE7HT-6NA3K
KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
65Z2L-P36BY-YWJYC-TMJZL-YDZ2S
SFZHH-2Y246-Z483L-EU92B-LNYUA
GSZVS-5W4WA-T9F2E-L3XUX-68473
FTZ8A-R3CP8-AVHYW-KKRMQ-SYDLS
Q3ZWN-QWLZG-32G22-SCJXZ-9B5S4
DAZPH-G39D3-R4QY7-9PVAY-VQ6BU
KLZ5G-X37YY-65ZYN-EUSV7-WPPBS
@WebFreak001
WebFreak001 / valve-index-linux.md
Last active May 18, 2025 14:55
Getting my Valve Index to run flawlessly on ArchLinux with i3wm

Getting my Valve Index to run flawlessly on ArchLinux with i3wm

I've bought the Valve Index VR headset and wanted to play on Linux. I had done a lot of tinkering with my Linux Machine up to this point so quite a few things on the headset initially had issues working alright.

I have listed all of the problems I encountered on ArchLinux with Valve Index and Steam VR in this post and how I managed to solve nearly all of them.

When I first plugged in my headset, turned on the controllers and started

@jwodder
jwodder / ua.md
Last active May 18, 2025 14:54
D&D 5e Unearthed Arcana Index

D&D 5e Unearthed Arcana Index

Because finding anything in this page is harder than it should be

Date Article Contents
2015-02-02 Unearthed Arcana: Eberron [PDF] Changelings, shifters, warforged, Wizard (Artificer), rules for action points, dragonmarks
@alfianandinugraha
alfianandinugraha / build-args.sh
Created January 2, 2024 15:14
Passing an environment file to Docker build using --build-arg. This is useful for setting environment variables during build time.
# This file is used to read the env file and convert it into docker build args
# Usage: "docker build -t <tag-name> $(bash build-args.sh <env-file>) ."
# Example: "docker build -t my-image $(bash build-args.sh .env.development.local) ."
build_args=""
while read -r line || [ -n "$line" ];
do
# Remove comments (text after #)
line=$(echo "$line" | sed 's/\s*#.*//')
@phucleeuwu
phucleeuwu / copy-and-past
Created May 18, 2025 14:46
Vimium custom search engine
g: http://www.google.com/search?q=%s Google
gm: https://www.google.com/maps?q=%s Google maps
b: https://www.bing.com/search?q=%s Bing
d: https://duckduckgo.com/?q=%s DuckDuckGo
do: https://3g2upl4pq6kufc4m.onion/?q=%s&t=hf DuckDuckGo Tor
az: http://www.amazon.com/s/?field-keywords=%s Amazon
di: https://duckduckgo.com/?q=%s&iar=images&iax=images&ia=images DuckDuckGo Images
gi: https://www.google.com/search?tbm=isch&sa=1&btnG=Search&q=%s&oq=&gs_l= Google Images
osm: http://www.openstreetmap.org/search?query=%s Open Street Maps
flibusta: http://flibusta.is/booksearch?ask=%s Flibusta
@hmRemi
hmRemi / README.md
Last active May 18, 2025 14:45
Make Discord Server With Tags

Discord Guild ID Hash Targeter Script

Discord no longer provides the tags feature to new servers. This could change, so I'm keeping this active and seeking other ways to get a tag server. I still recommend trying create guilds within the specified hash ranges. Please support by starring this gist and joining our Discord (link below).

Also, selling a script for a fully customizable rotating clan tag. (colors and badge icon - join discord to buy)

Version: 1.2.5 (as per CONFIG.SCRIPT_VERSION in the script)
Discord: https://discord.gg/wSWYhQMdbA | @ziue
Telegram: https://t.me/reveredev/

@basperheim
basperheim / ffmpeg-merge-folder-of-videos.md
Last active May 18, 2025 14:45
Use FFmpeg to merge a directory of AVI files by appending each file name to a text file

FFmpeg: merge a folder of AVI files with names that include order number

You can merge a series of .avi files with ffmpeg using the concat filter. However, the concat filter requires that all inputs have the same streams (same codecs, same time base, etc.).

Here is an example of how you can do it (each video file should end in ..-01.avi, ..-02.avi, etc..):

Create the text file using echo

First, create a file that contains the list of all your .avi files. You can do this manually, but if your files are named in a sequence like 01.avi, 02.avi, 03.avi, and so on, you can generate this list automatically using a bash command. Here's how you can do it:

@mbo18
mbo18 / gestion_filtration_piscine.yaml
Last active May 18, 2025 14:45
Blueprint de gestion de la filtration de la piscine
blueprint:
name: "Gestion filtration piscine"
description: "Gestion automatique de la filtration/pompe de la piscine"
domain: automation
homeassistant:
min_version: 2024.6.0
input:
temperature_piscine:
name: "Capteur de température de la piscine"
@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active May 18, 2025 14:38
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27