Hi guys 😁! Long time no new articles!
Today, I am going to show you how to compose React providers with TypeScript.
| // https://gist.github.com/tkrotoff/b0b1d39da340f5fc6c5e2a79a8b6cec0 | |
| // WTF! | |
| // parseFloat('-0') => -0 vs parseFloat(-0) => 0 | |
| // -0 === 0 => true vs Object.is(-0, 0) => false | |
| const minus0Hack = (value: number) => (Object.is(value, -0) ? '-0' : value); | |
| export const operators: { | |
| [operator: string]: | |
| | { |
This algorithm when passed a DOM node will find a very short selector for that element.
| #!/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 |
| echo "Starting..." | |
| branch=$1 | |
| delete() | |
| { | |
| echo "Deleting branches..." | |
| git branch --list | \ | |
| egrep --invert-match "($branch|\*)" | \ | |
| xargs git branch -D | |
| echo "Done!" | |
| } |
| docker exec -it container-name redis-cli FLUSHALL |
| 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 ] |