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
; This is a shallow clipboard version of: | |
; https://www.autohotkey.com/board/topic/44064-copy-on-select-implementation/#entry274436 | |
cos_mousedrag_treshold := 20 ; pixels | |
cos_copied_text := "" | |
#IfWinNotActive ahk_class ConsoleWindowClass | |
~lButton:: | |
MouseGetPos, cos_mousedrag_x, cos_mousedrag_y |
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
import pathlib | |
from typing import List | |
import win32clipboard | |
def paste() -> str | List[pathlib.Path]: | |
try: | |
win32clipboard.OpenClipboard() | |
try: |
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
# modified from: https://superuser.com/a/175802/221425 | |
export LAST_COMMAND='' | |
preexec () { :; } | |
preexec_invoke_exec () { | |
[ -n "$COMP_LINE" ] && return # do nothing if completing | |
[ "$BASH_COMMAND" = "$PROMPT_COMMAND" ] && return # don't cause a preexec for $PROMPT_COMMAND | |
local this_command=`HISTTIMEFORMAT= history 1 | sed -e "s/^[ ]*[0-9]*[ ]*//"`; | |
if [ "$this_command" != '' ]; then | |
if [ "$LAST_COMMAND" != "$this_command" ]; then |
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
""" | |
PotPlayer Bookmark File (.pbf) | |
""" | |
from dataclasses import dataclass | |
import datetime | |
import pathlib | |
import re | |
import typing |
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 email | |
import io | |
import sys | |
def run(): | |
request_text = sys.stdin.read() | |
request_line, headers_raw = request_text.strip().split('\n', 1) |
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
# Python textual debugging tool | |
# A function wrapper to display PID, stack-size indented function name and arguments when it's called. | |
# Also display similar message when function ends. | |
# Example output for three wrapped class methods (skips `self` when displaying class method arguments): | |
21906 P300GuiPeer.send_blink | |
(blink_id=-1, blink_time=1544627502.9847314) | |
21906 P300GuiPeer.create_message | |
(blink_id=-1, blink_time=1544627502.9847314) |
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
#!/bin/bash -eu | |
pacmd list-sinks > /dev/null || pulseaudio -D | |
pacmd unload-module module-ladspa-sink || true | |
DEVICE_NAME=$(pacmd list-sinks | grep name: | egrep -o '<[^<>]+Chord[^<>]+>' | egrep -o '[^<>]+') | |
echo "Setting up PulseAudio to route into: $DEVICE_NAME..." | |
pacmd load-module module-ladspa-sink sink_name=dsp master=$DEVICE_NAME plugin=ladspa_dsp label=ladspa_dsp | |
echo "Done." | |
pacmd set-default-sink dsp |