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/env python3 | |
def encode(content, output, scale): | |
import pyqrcode | |
qr = pyqrcode.create(content) | |
qr.png(output, scale) | |
def decode(file_path): |
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 -eu | |
max_days=5 | |
dev=hammerhead | |
cachedir="$XDG_CACHE_HOME/lineageos" | |
builds="$dev.builds" | |
dlpage=https://download.lineageos.org/ | |
targetdir=/data/data/org.lineageos.updater/app_updates/ |
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/sh | |
set -eu | |
# Determine module requirements of uninstalled PyPI packages. | |
# For installed modules, use `pip show package1 [ package2 ... ]` | |
script="$(basename "$0")" | |
[ $# -eq 0 ] && { | |
>&2 echo "Usage: $script package1 [ package2 ... ]" |
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/sh | |
pct_w="${PCT_W:-80}" pct_h="${PCT_H:-80}" # desired percent dimensions | |
pad_w="${PAD_W:-8}" pad_h="${PAD_H:-4}" # pixels of extra padding | |
chr_w="${CHR_W:-100}" chr_h="${CHR_H:-35}" # initial character dimensions | |
comment() { | |
cat <<'END' | |
usage: st-dropdown [gap] [position] |
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/sh | |
set -u | |
isoname="${ISONAME:-$(date +av-updates-%Y%m%d)}" | |
isofile="${ISOFILE:-/tmp/$isoname.iso}" | |
workdir="${WORKDIR:-/tmp/av-updates}" | |
dev="" && [ -n "${OPTDEV:-}" ] && dev="dev=$OPTDEV" | |
driveropts="" && [ -z "${NOBURNFREE:-}" ] && driveropts="driveropts=burnfree" |
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
// ==UserScript== | |
// @name citidirect session extender | |
// @namespace https://github.com/ncoop | |
// @description Stay logged in to the card account page | |
// @homepageURL https://gist.github.com/ncoop/3ff25127428ae0d4a83087656784ac14 | |
// @include https://home.cards.citidirect.com/CommercialCard/* | |
// @icon https://gist.github.com/ncoop/3ff25127428ae0d4a83087656784ac14/raw/9b072f92411cf2ef25d41dd75be340052162779c/svg-citi.png | |
// @version 0.1.0 | |
// @grant none | |
// ==/UserScript== |
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 | |
script="${0##*/}" | |
if [[ -z "${BASH_VERSINFO[0]}" || "${BASH_VERSINFO[0]}" -lt 4 ]]; then | |
2>&1 printf "%s requires bash>=4.\n" "$script" | |
exit 128 | |
fi | |
min=20 | |
declare -A retcode color |
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
#!/usr/bin/env python | |
""" | |
Get a notification summary and body from mpc, then send it through dbus. | |
https://developer.gnome.org/notification-spec/#protocol | |
""" | |
from subprocess import check_output | |
from dbus import SessionBus, Interface |
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/sh | |
set -eu | |
exclude="txt|nfo|bat|c|usflib|psflib" | |
invoke="$(basename "$0")" | |
if [ -d "$XDG_RUNTIME_DIR" ]; then | |
dest="$XDG_RUNTIME_DIR/$invoke" | |
else | |
dest="/tmp/$invoke-$USER" |
NewerOlder