Skip to content

Instantly share code, notes, and snippets.

document.body.innerHTML = document.body.innerHTML.replace(/([-'a-z\u4e00-\u9eff]+)《(.*?)》/g, '<ruby>$1<rt>$2</rt></ruby>')
@siikamiika
siikamiika / html2text-function.py
Created August 24, 2021 12:32
html2text-function
"""
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
basename "$(dirname "$(grep -rl '[serial or other identifier]' /sys/class/drm/card*/edid)")" | cut -d'-' -f2-
# --> DP-1
@siikamiika
siikamiika / obs_to_mpv.md
Created August 9, 2022 18:11
Stream from OBS to mpv
  1. Port forward $PORT on target
  2. nc -l -p $PORT | mpv - on target
  3. Stream to tcp://target:$PORT on source
  4. ???
  5. profit
@siikamiika
siikamiika / clipboard_sync.bat
Last active August 23, 2022 23:08
clipboard sync windows
powershell "$prev = Get-Clipboard -Raw; while ($true) { $cur = Get-Clipboard -Raw; if ($cur -ne $prev) { [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($cur)); $prev = $cur } else { Start-Sleep -Milliseconds 500 } }" | secure_bus --remote-server-addr <host>:<port> --sentinel-byte 10 | powershell "foreach ($line in $input) { $text = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($line)); if ($text -ne '') { Set-Clipboard -Value $text } }"