Chrome stores .user.js
scripts in a .ldb
, which isn't in a user accessible format to recovery. On some versions of macOS the provided python script can't compile the leveldb package. As a workaround, we can use the node level package to recover our userscripts.
This file contains 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
(() => { | |
const CURRENT_USER_NAME = document.querySelector('.dwSJ2e'); | |
const $messages = Array.from(document.querySelectorAll('.Ss4fHf')); | |
const messages = $messages | |
.map($element => { | |
const time = $element.querySelector('.MuzmKe').innerText; | |
const author = $element.querySelector('.poVWob').innerText; | |
const lines = Array.from($element.querySelectorAll('.ptNLrf')).map(x => x.innerText); | |
// duplicate fields rapid successive messages for easier formatting | |
return lines.map(message => ({ |
This file contains 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 | |
from __future__ import annotations | |
import argparse | |
import configparser as ConfigParser | |
import json | |
import re | |
from enum import Enum | |
from pathlib import Path |
extracted via dotfiles commit
fish: wrap/split funced to avoid temp files
By design, funced
uses a temporary file to make changes to functions.
While this is useful so users don't overwrite key functionality in
share/fish/functions
ensuring the edited function can be parsed by
fish
. However, this adds friction (e.g. save, exit, load, run) during
This file contains 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 | |
script_name="${0##*/}" | |
# By default `fzf` uses `find`, try using one of the options listed here | |
# https://github.com/junegunn/fzf#tips to ignore .gitignore files | |
check_fzf_default_command() { | |
if [ -x "$(command -v gfind)" ]; then | |
export FZF_DEFAULT_COMMAND='gfind . -path "*__tests__*" -iname "*.ts" -o -path "*__tests__*" -iname "*.tsx"' | |
else |
This file contains 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 | |
# macOS/homebrew: | |
# - hardcoded via `man` -> /opt/homebrew/Cellar/toilet/0.3/share/figlet | |
# - dynamic: `ls $(realpath $(which toilet)"/../../share/figlet")` | |
# Linux: /usr/share/figlet | |
# render fonts using their own name | |
find "$1" -type f | | |
sort -V | |
This file contains 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 argparse | |
import datetime | |
import json | |
import logging | |
import os | |
import re | |
import requests | |
import sys |
This file contains 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
const triggerMouseEvent = (node, eventType) => { | |
const clickEvent = document.createEvent('MouseEvents'); | |
clickEvent.initEvent(eventType, true, true); | |
node.dispatchEvent(clickEvent); | |
}; | |
const clapButton = document.querySelector('[aria-label="clap"]').parentNode; | |
const click = button => { | |
triggerMouseEvent(button, 'mousedown'); | |
triggerMouseEvent(button, 'mouseup'); | |
}; |
NewerOlder