I hereby claim:
- I am yyogo on github.
- I am yyogo (https://keybase.io/yyogo) on keybase.
- I have a public key ASBoezTXmapIvgewk-XhFriszvIc-VfNpPd7VJ9AZhiYIgo
To claim this, I am signing this object:
class HexDump(object): | |
""" | |
HexDump(data, width=16, groups=(2,4), prefix='') | |
Dump hex. | |
width - Number of bytes per dump line | |
groups - How to group the bytes, i.e where to put spaces. Ex: | |
(1,) - space after every byte |
def bytes2int(data, byteorder='little', signed=False): | |
""" replicate int.from_bytes from python3 """ | |
if byteorder == 'little': | |
data = reversed(data) | |
elif byteorder != 'big': | |
raise ValueError("byteorder must be either 'little' or 'big'") | |
bl = bytearray(data) |
__get_tmux_pane_contents() { | |
local cmd='for pane in `tmux list-panes -F "#{pane_id}"`; do tmux capture-pane -p -t $pane; done' | |
for word in `eval "$cmd"`; do | |
if [ ${#word} -ge ${FZF_MIN_WORD_LENGTH:-4} ]; then | |
echo "$word" | |
fi | |
done | awk '{ print length, $0 }' | sort -rn | cut -d' ' -f2- | uniq | |
} |
#!/bin/bash | |
# remove shit from downloads | |
shopt -s nullglob dotglob | |
current_time=`date +%s` | |
max_age_days=${1:-30} | |
max_age_days=$((max_age_days)) |
""" ASN1 DER/BER symmetric parser/encoder. """ | |
import enum | |
def decode_varint(bytearr): | |
value = bytearr[0] & 0x7f | |
while bytearr.pop(0) & 0x80: | |
value = (value << 7) | (bytearr[0] & 0x7f) | |
return value | |
def encode_varint(n): |
import inspect | |
try: | |
unichr | |
except NameError: | |
unichr = chr | |
def f(s): | |
# find all {}'s | |
stack = [] |
#![feature(min_const_generics,maybe_uninit_extra)] | |
// VERY UNTESTED AND NOT REVIEWED | |
// THIS CODE USES UNSAFE RUST AND COULD LEAD TO UB | |
use std::mem::{self, MaybeUninit}; | |
#[derive(Clone,Debug)] | |
enum ToArrayError { | |
TooShort(usize, usize), |
enum TakeWhileInclusive<I, P> { | |
Taking(I, P), | |
Done, | |
} | |
impl<I, P> Iterator for TakeWhileInclusive<I, P> | |
where | |
P: FnMut(&I::Item) -> bool, | |
I: Iterator, |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
set -m | |
showhelp() { | |
echo "Usage: $0 [-ohvrc] <command>" | |
echo "Pipes stderr from command to a new tmux pane." | |
echo " -h | -v split horizontally or vertically (default vertically)" | |
echo " -r send stdout to pane instead of stderr" | |
echo " -o send both stdout and stderr to new panes" | |
echo " -c close pane automatically after program terminates" |