Skip to content

Instantly share code, notes, and snippets.

@Sohalt
Sohalt / checkback.sh
Created September 13, 2020 15:09
searches for comments to github issues and reports if there was any activity since the time the comment was added (inspired by https://github.com/ogham/checkback)
#!/usr/bin/env bash
# searches for comments to github issues and reports if there was any activity since the time the comment was added
# inspired by https://github.com/ogham/checkback
rg --with-filename --line-number --only-matching "(https?://)?github.com/([^/]+)/([^/]+)/issues/(\d+)" | while read -r issue; do
file=$(echo "$issue" | sed -e 's,\([^:]\+\):[^:]\+:\(.*\),\1,')
line=$(echo "$issue" | sed -e 's,[^:]\+:\([^:]\+\):\(.*\),\1,')
author_time=$(git blame -L"$line","$line" -p "$file" 2>/dev/null | rg --replace='$1' 'author-time (\d+)')
api=$(echo "$issue" | sed -ne 's,\([^:]\+:[^:]\+\):\(https\?://\)\?github.com/\([^/]\+\)/\([^/]\+\)/issues/\([[:digit:]]\+\),https://api.github.com/repos/\3/\4/issues/\5,p')
@Sohalt
Sohalt / .block
Last active May 28, 2020 10:45
d3 v4 realtime line chart
license: mit
@Sohalt
Sohalt / mpd-suspend-on-pause
Created January 11, 2019 11:50
suspends the computer using systemctl suspend when music on mpd is paused, needs mpc
#!/bin/bash
#suspends the computer when mpd gets paused
if ! command -v > /dev/null mpc
then
echo "error: this needs mpc to be installed"
exit 1
fi
uid=$(id -u)
pidfile="/var/run/user/$uid/mpd-suspend-on-pause.pid"
if [[ "$1" == "-k" ]] # kill
@Sohalt
Sohalt / termite-solarized
Created October 17, 2014 18:40
The solarized colorscheme by Ethan Schoonover for the Termite terminal emulator.
#Solarized colorscheme (http://ethanschoonover.com/solarized) for termite
[colors]
foreground = #839496
#foreground_bold = #ffffff
background = #fdf6e3
cursor = #586e75
# if unset, will reverse foreground and background
#highlight = #2f2f2f
# colors from color0 to color254 can be set