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 | |
# simple jq task: reduce list of objects with by workflow_id and job id | |
# into a object { workflow_id => [list of job ids] } | |
# | |
# .o(this seriously took like 2 whole hours ot figure out) | |
gh api repos/$owner_slash_repo/actions/runs?per_page=100 \ | |
| jq '[ .workflow_runs | group_by(.workflow_id)[] | {(.[0].workflow_id|tostring): [ .[] | .id ]} ] | |
| reduce .[] as $item ({}; . * $item)' |
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
In [8]: import re | |
...: import subprocess | |
...: def get_ext_info(dev): | |
...: try: | |
...: output = subprocess.check_output(['sudo', 'dumpe2fs', '-h', dev], stderr=subprocess.DEVNULL).decode() | |
...: except: | |
...: pass | |
...: data = dict() | |
...: for line in output.splitlines(): | |
...: if m := re.match(r'^([^:]+):\s+(.+)$', line): |
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
fun Blackify() | |
let l:bsave = winsaveview() | |
let l:tname = tempname() | |
exe 'keepjumps %!black --line-length 119 -q - 2>' . l:tname | |
if v:shell_error > 0 | |
let l:lines = readfile(l:tname) | |
for l:line in l:lines | |
echo l:line | |
endfor | |
call delete(l:tname) |
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 | |
set -e | |
curl -s https://api.github.com/repos/cli/cli/releases/latest \ | |
| grep "browser_download_url.*amd64.*deb" \ | |
| cut -d : -f 2,3 \ | |
| tr -d \" \ | |
| wget -O ~/Downloads/gh-latest-linux-amd64.deb --progress=bar:force -T15 -t100 -i - |
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
# Personally I feel completely blind without my various logs. Especially | |
# `ftlog` for when I just can't figure out where I am in the tree. | |
# | |
# Every now and again, when people I'm helping with git that are feeling | |
# totally lost, I wish they had these commands. in reality, they totally do, | |
# `mylog` could probably just be `log --oneline`; but my format reveals details | |
# to help me figure out where I actually am. In particular, the commit id (%h) | |
# -- and/or reflog selector (%ar), the committer email (%ae), and the head and | |
# branch names (%d) where they occur in the tree. I suppose it helps an awful | |
# lot to know the human relatable timestamp too (%ar). |
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 bash | |
# old http://billauer.co.il/blog/2013/02/usb-reset-ehci-uhci-linux/ | |
# old http://enc.com.au/2014/02/14/resetting-usb-devices/ | |
# | |
# http://www.linux.org/threads/resetting-the-usb-subsystem.6256/ | |
# (page was dead, used google cache) | |
# | |
# XXX This definitely worked (2016-08-21), the trouble is finding the serial | |
# number and the bind/unbind kernel interfaces |
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 bash | |
FMT=$'--pretty=format:{}%x1f%C(bold yellow) %h%C(bold blue) %ae%Creset: %s %C(bold black)%ar%Creset%n' | |
git tag -l | xargs -rn1 -I{} git log -1 "$FMT" {} | while read X | |
do commit="$(cut -d $'\x1f' -f1 <<< "$X")" | |
description="$(cut -d $'\x1f' -f2 <<< "$X")" | |
# use cat-file -t to add add [c] or [t] | |
# | |
# Wait, but why?? |
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/perl | |
use common::sense; | |
use IPC::System::Simple qw(systemx system); | |
use POSIX; | |
use Term::ReadLine; | |
use File::Basename; | |
use Data::Dump qw(dump); | |
use Date::Lima qw(beek_date); | |
use Digest::MD5 qw(md5_hex); |
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
SHELL=/bin/bash | |
key=my key | |
go: clean | |
@ make --no-print-directory `git ls-files | sed 's/$$/.ubf/'` | |
@ for i in *.ubf; do x=`basename $$i .ubf`; ./my_diff.pl $$x $$i; done | |
words.bf: enc | |
./enc "$(key)" $(words) $@ |
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
/* intended to be used with stylus (user-css add-on) or similar | |
** no copyright intended | |
** | |
** Basically the problem is that I use a minimum font size in firefox to ensure | |
** sites can't set fonts smaller than I can read. Zooming the sites is not an | |
** acceptable option because it also jacks up the layout. minimum font size | |
** works nearly everywhere except for single edge cases like tensorboard's SVG | |
** text ... and I can't think of a single other example at the moment. | |
** | |
** update: |
NewerOlder