Generate animated frames of a hyperbolic tree of life. See the --help
output for info on using ffmpeg
to also generate a video file from the resulting rendered frames.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copied and minified from https://gist.github.com/JamieMason/c43e7ee1d078fc63e7c0f15746845c2e | |
console.log([].map.call(document.querySelectorAll('.anchor'), function(el) {var indents = ' '.repeat(parseFloat(el.parentNode.nodeName.charAt(1)) - 1);var label = el.parentNode.innerText;var link = el.getAttribute('href');return `${indents}* [${label}](${link})`}).join('\n')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
declare $(xdotool getmouselocation --shell) | |
declare _X=$X _Y=$Y | |
declare $(xdotool getwindowgeometry --shell $(xdotool search --class nm-applet | tail -1)) | |
xdotool \ | |
mousemove $X $Y \ | |
mousemove_relative 7 7 \ | |
click 1 \ | |
mousemove $_X $_Y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import termios | |
import atexit | |
def password_input(prompt="Enter password: "): | |
fd = sys.stdin.fileno() | |
iflag, oflag, cflag, lflag, ispeed, ospeed, cc = termios.tcgetattr(fd) | |
def _restore_tty(): | |
termios.tcsetattr(fd, termios.TCSANOW, [iflag,oflag,cflag,lflag|termios.ECHO|termios.ICANON,ispeed,ospeed,cc]) | |
atexit.register(_restore_tty) # restore tty on unexpected exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Usage: | |
# Multiple args: $ youtube-playlist https://youtu.be/############ https://youtu.be/############ ... | |
# Single delimited arg: $ youtube-playlist 'https://youtu.be/############ https://youtu.be/############ ...' | |
youtube-playlist() { | |
local urls=( $(IFS=$'\n'; <<<"$*" grep -o 'v=.*' | cut -f 2 -d=) ) | |
local comma_separated="$(IFS=,; echo "${urls[*]}")" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import i3ipc | |
from time import sleep | |
DROPDOWN_IDENTIFIER = "dropdown" | |
DROPDOWN_CHILD_IDENTIFIER = "dropdownchild" | |
INITIAL_TERMINAL_QUANTITY = 3 | |
TERMINAL_COMMAND = f"terminal -n {DROPDOWN_CHILD_IDENTIFIER}" | |
HEIGHT_PERCENTAGE = 39 | |
FRAME_STEP = 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import i3ipc | |
import subprocess | |
import json | |
def node_contains_point(node, x, y): | |
"""Determine if the given point (x,y) is contained by the given node's boundary""" | |
r = node.rect | |
return all((x > r.x, | |
x < (r.x + r.width), |
This tool uses the existing Python standard library as of 3.11, no external dependencies are needed.
Note
When I was initially began writing this tool I was using SHA256 to compute file hashes but later found empirically that BLAKE2 was considerably faster, and since filesystems can easily exceed millions of files to hash it was a significant speedup to change the hashing algorithm. However, I still feel this pun encapsulates the essence of the tool and couldn't think of a better name.
- Stores unique file contents in a "blob cache" where the content files are renamed after the hash of their contents (this is similar to how git stores files).
- Hardlinks files to these hashed blobs. The usefulness of this comes with subsequent snapshots, where presumably the majority of your filesystem is unchanged. Unchanged files will produce the same hash, and therefore can be hardlinked once again to the same blob which reuses the storage in the blob instead of creating a redundant copy o
OlderNewer