Skip to content

Instantly share code, notes, and snippets.

View tholman's full-sized avatar
:octocat:
Like this? You could always sponsor me 😯

Tim Holman tholman

:octocat:
Like this? You could always sponsor me 😯
View GitHub Profile

preact-root-fragment: partial root rendering for Preact

This is a standalone Preact 10+ implementation of the deprecated replaceNode parameter from Preact 10.

It provides a way to render or hydrate a Preact tree using a subset of the children within the parent element passed to render():

<body>
  <div id="root">  ⬅ we pass this to render() as the parent DOM element...
@noisysocks
noisysocks / look-away.sh
Created January 30, 2018 04:21
Reminder to rest your eyes every 20 minutes
#!/bin/bash
# A little script to remind you to look away from your screen every so often.
#
# To install:
# 1. Save this script somewhere
# 2. Make the script executable: chmod +x /path/to/the/script.sh
# 3. crontab -e
# 4. Add this entry: */20 9-17 * * * /path/to/the/script.sh
@balint42
balint42 / README.md
Last active January 14, 2023 01:49
reflect point on line javascript function

Reflect point along line

Javascript function to reflect point p along line through points p0 and p1. Expects three point objects of the type { x: number1, y: number2 } as input and returns the first point p reflected on p0 and p1 as output.

@gthomas
gthomas / fun
Last active December 25, 2015 15:39 — forked from tholman/fun
cd ~/Library/Application\ Support/Google/Chrome/Default/User\ StyleSheets && echo aHRtbCxib2R5LGgxLGgyLGgzLGg0LGg1LHAsc3BhbixkaXYgeyAgZm9udC1mYW1pbHk6ICdDb21pYyBTYW5zIE1TJyAhaW1wb3J0YW50O30= | base64 --decode >> Custom.css