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/python3 | |
""" | |
Generate cheatsheet of possible combinations of numbers in killer sudoku cells | |
""" | |
from itertools import chain, combinations | |
import sys | |
def powerset(iterable): | |
"""https://stackoverflow.com/questions/464864/""" | |
s = list(iterable) # allows duplicate elements |
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 | |
set +H | |
# Using STDIN, check LINES of FILES and use the test command to filter by EXPRESSION | |
# Supports all EXPRESSIONS that test does. | |
# fn | test_stdin -f \! -d -L -s \! -ot FILEARG | |
# Use '!' to negate results. -ef, -ot, -nt will be read as "LINE -nt FILEARG" | |
if [[ $# -eq 0 ]] ; then | |
# An omitted EXPRESSION defaults to false (see manpage for test) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Test Monitor FPS in Browser</title> | |
<style> | |
html { | |
background-color: #000; |
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 | |
# Crop image using the CSS method top-right-bottom-left | |
# Uses get_tmp_hash.py | |
declare -i e_c=1 img_w=0 img_h=0 i=0 x=0 c_t=0 c_r=0 c_b=0 c_l=0 arglen=0 form_w=0 form_h=0 form_x=0 form_y=0 gui_input=0 | |
declare -a args=() im_cmd=() | |
declare img mime_type jpeg_re='jpe?g' jpeg_quality tmp_file num_re='^[0-9]+$' output_name | |
parse_gui_args(){ |
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 | |
# NOTE! This script checks card 1, yours may be different | |
declare -i CARD=1 | |
if amixer -c "$CARD" contents | grep -A2 'Headphone' | grep -q 'values=on' | |
then | |
mkdir /tmp/.audio-cable-connected &>/dev/null | |
fi |
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 | |
declare tageditor=/home/user/bin/tageditor-latest-x86_64.AppImage | |
if ! command -v chafa &>/dev/null || [[ ! -x "$tageditor" ]] ; then | |
echo "Missing programs" | |
exit 1 | |
fi | |
declare -a args=() error_files=() |
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 python3 | |
""" | |
i3wm Python Script: Jump fwd/backward N positions in app windows sharing the | |
same 'class' | |
Download: https://gist.github.com/elundmark/f1f5cdee35a6305af23b62847ae79386 | |
Updated: 2020-09-21 13:28:54 | |
""" | |
import sys | |
import json | |
import subprocess |
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 | |
# curl 'https://unicode.org/Public/emoji/13.0/emoji-test.txt' > Public_emoji_13.0_emoji-test.txt | |
declare title_re='^# (sub)?group[: ]+(.+)' | |
declare e_line_re='^([0-9A-Z]+ )+[ ]+;[ ]*(fully-qualified|unqualified|minimally-qualified|qualified|component)[ ]+#[ ]*(.+)[ ]+(E[0-9.]+)[ ]+(.+)$' | |
declare work_dir | |
work_dir="$(dirname "$(realpath "$0")")" | |
while read -r; do |
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 python3.8 | |
"""Magic Media Sorter - Sort your media correctly!""" | |
import argparse | |
import operator | |
import sys | |
import re | |
def main(imported=None, importedList=None): | |
"""main function""" |
NewerOlder