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/python3 | |
| # coding=utf-8 | |
| """Configures and maintain PipeWire links between sets of queries for input/output ports""" | |
| # The following example configures links between output ports whose application | |
| # name starts with "Firefox" and channel is "Front-Right", and input ports whose | |
| # application name is "ardour" and port name starts with "Track name" and ends | |
| # with "2". Links are automatically created whenver a new port appears for | |
| # either of these queries. |
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
| #!/bin/sh | |
| # requires the github binary, authorized, to list open PRs. Probably could get | |
| # them from the API anonymously since its a public repo. | |
| [ -e prs.json ] || gh -R qutebrowser/qutebrowser pr list -s open --json number,title,mergeable,updatedAt -L 100 > prs.json | |
| [ -e qutebrowser/app.py ] && { | |
| echo "don't run this from your qutebrowser checkout. Run it from a tmp dir, it'll checkout out a new copy to work on" | |
| exit 1 | |
| } | |
| [ -d qutebrowser ] || { |
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 sh | |
| # Symlink drive_c/user directories from Steam wine prefixes to a common | |
| # location. | |
| # To mitigate https://github.com/ValveSoftware/Proton/issues/428 | |
| # Run it from cron every day or week or whatever. | |
| # Doesn't currently handle the case of reinstalling an application and a | |
| # prefix being recreated (will print '... already exists' to stderr). | |
| # todo: try other common dirs |
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
| const watchFor = function(container, selector, callback) { | |
| let observer = new MutationObserver(function(mutations) { | |
| for (let mindx = 0; mindx < mutations.length; mindx++) { | |
| let mutation = mutations[mindx] | |
| let found = new Set(Array.from(mutation.addedNodes).filter( | |
| (node) => node.matches(selector) | |
| )) | |
| if (found.size === 0) | |
| found = new Set( | |
| Array.from(mutation.addedNodes).map( |
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
| # pause all the `QtWebEngineProc`s except one, inject JS into each of the tabs | |
| # to see which one returns something. | |
| # :activate-pid <pid> | |
| import os, signal, functools | |
| from PyQt5.QtCore import QTimer | |
| from qutebrowser.misc import objects | |
| from qutebrowser.utils import objreg |
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
| #!/bin/sh | |
| ## Listen on localhost and send to notifyd | |
| # Daemonize it however you like | |
| while test 1;do | |
| printf 'HTTP 204 No Content\r\nAccess-Control-Allow-Origin: *\r\n\r\n' |\ | |
| nc -lp 5587 | sed -n '/==BEGIN==/,$p' | ( | |
| read header; read icon; read title; body="$(cat)"; | |
| ct="none" | |
| case "$icon" in | |
| "data:image/"*) |
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
| // Expected output: | |
| // > "setting one to 2" | |
| // > 2 | |
| // > 2 | |
| const store = { one: 1 }; | |
| const myProxyHandler = { | |
| set: function(target, key, value) { | |
| console.log(`setting ${key} to ${value}`); | |
| target[key] = value; | |
| } |
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
| maybefile () { | |
| case "$1" in | |
| */*|/*|*/) | |
| return 0;; | |
| esac | |
| return 1 | |
| } | |
| # Parse shell commands (eg from `history`) and look for parameters that look | |
| # like files, that is they contain a '/'. Handles quoting and backslash |
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 sys | |
| import fileinput, zbase32 | |
| # TODO: Parse args properly. | |
| # TODO: | fold -s76 like base64 | |
| # TODO: padding? | |
| if len(sys.argv) > 1 and sys.argv[1] == '-d': |
NewerOlder