Skip to content

Instantly share code, notes, and snippets.

View israelss's full-sized avatar
📚
Learning 📚

Israel Sant'Anna israelss

📚
Learning 📚
View GitHub Profile

How to compose React Providers with TypeScript

Tree and sunset

Photo by Sergei A on Unsplash

Hi guys 😁! Long time no new articles!

Today, I am going to show you how to compose React providers with TypeScript.

@israelss
israelss / README.md
Created July 2, 2024 15:55 — forked from gampleman/README.md
Algorithm to find a short unique CSS selector from an arbitrary node

This algorithm when passed a DOM node will find a very short selector for that element.

@israelss
israelss / rotate_desktop.sh
Created July 28, 2023 14:51 — forked from mildmojo/rotate_desktop.sh
Script to rotate the screen and touch devices on modern Linux desktops. Great for convertible laptops.
#!/bin/bash
#
# rotate_desktop.sh
#
# Rotates modern Linux desktop screen and input devices to match. Handy for
# convertible notebooks. Call this script from panel launchers, keyboard
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.).
#
# Using transformation matrix bits taken from:
# https://wiki.ubuntu.com/X/InputCoordinateTransformation
@israelss
israelss / clear-branches.sh
Created July 10, 2023 21:38 — forked from dchueri/clear-branches.sh
Clear Local Branches Script
echo "Starting..."
branch=$1
delete()
{
echo "Deleting branches..."
git branch --list | \
egrep --invert-match "($branch|\*)" | \
xargs git branch -D
echo "Done!"
}
@israelss
israelss / redis-clear
Created February 3, 2023 15:49 — forked from dimasch/redis-clear
Clear a redis cache in Docker
docker exec -it container-name redis-cli FLUSHALL
@israelss
israelss / range.js
Created May 29, 2017 16:45 — forked from Woodsphreaker/range.js
range.js
const range = (start = 0, end = 1) => Array.from({"length": (end + 1) - start})
.map((_, i) => start + i);
console.log(range(-10, 10)); // [ -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]