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 multiprocessing as mp | |
def target(q): | |
while val := q.get(): | |
print(len(val)) | |
if __name__ == "__main__": | |
mp.set_start_method('forkserver') |
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
function _print_all_panes() { | |
for pane_id in $(tmux list-panes -F '#{pane_id}'); do | |
tmux capture-pane -p -J -S 0 -E - -t "$pane_id" | tr ' ' '\n' | sort -u | rg '[a-zA-Z0-9]+' | |
done | |
} | |
_tmux_pane_words() { | |
local current_word="${LBUFFER##* }" | |
local new_rbuffer="${RBUFFER/#[^ ]##/}" | |
local prompt="${LBUFFER% *} ␣ $new_rbuffer " |
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
_tmux_pane_words() { | |
local current_word="${${=LBUFFER}[-1]}" | |
local prompt="${LBUFFER% *} ␣ $RBUFFER " | |
local selected_word=$(tmux capture-pane -p -J -S 0 -E - | tr ' ' '\n' | sort -u | rg '[a-zA-Z0-9]+' | fzf --select-1 --exit-0 --query="$current_word" --prompt="$prompt" --height=20 --layout=reverse) | |
if [[ -n $selected_word ]]; then | |
BUFFER="${LBUFFER% *} $selected_word$RBUFFER" | |
fi | |
zle redisplay |
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/bash | |
set -u | |
suffixes=( "-" ":-" "+" ":+" "+x" ":+x" ) | |
function header { | |
printf "%10s | " "\$#" | |
printf "%10s | " "\$*" | |
for predicate in "-n" "-z"; do | |
for suffix in "${suffixes[@]}"; do |
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 ctypes | |
import os | |
import threading | |
class StderrCapture: | |
def __init__(self, f): | |
self.libc = ctypes.CDLL('libc.so.6') | |
self.memfd_create = self.libc.memfd_create | |
self.memfd_create.argtypes = [ctypes.c_char_p, ctypes.c_uint] | |
self.memfd_create.restype = ctypes.c_int |
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
--- /etc/systemd/logind.conf 2022-03-26 11:58:23.739031451 -0400 | |
+++ /etc/systemd/logind.conf.dpkg-new 2022-09-09 14:47:16.000000000 -0400 | |
@@ -1,13 +1,16 @@ | |
# This file is part of systemd. | |
# | |
-# systemd is free software; you can redistribute it and/or modify it | |
-# under the terms of the GNU Lesser General Public License as published by | |
-# the Free Software Foundation; either version 2.1 of the License, or | |
-# (at your option) any later version. | |
+# systemd is free software; you can redistribute it and/or modify it under the |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder