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 zsh | |
# | |
# loc: mlocate + fzf integration | |
# | |
# https://gist.github.com/06dc1238b2fcbfb6c10bbad05ad79bc1 | |
# https://asciinema.org/a/102006 | |
# | |
# ~ trevorj <[email protected]> | |
# | |
setopt pipe_fail err_return err_exit |
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/zsh | |
# git-fshow - git commit browser | |
# | |
# https://gist.github.com/akatrevorjay/9fc061e8371529c4007689a696d33c62 | |
# https://asciinema.org/a/101366 | |
# | |
git-fshow() { | |
local g=( | |
git log |
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
import sys | |
import re | |
def format_dict_recursively(mapping, raise_unresolvable=True, strip_unresolvable=False, conversions={'True': True, 'False': False}): | |
"""Format each string value of dictionary using values contained within | |
itself, keeping track of dependencies as required. | |
Also converts any formatted values according to conversions dict. |
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 | |
# | |
# Given standard docker line variables, parses and waits for them to respond to SYNs in parallel with timeout. | |
# Works with tcp, udp, and unix sockets. | |
# | |
# @deps bash>=4 netcat | |
# @url https://github.com/akatrevorjay/wait-for-linked-services | |
# @author trevorj | |
# | |
set -eo pipefail |
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
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account. | |
Token for proof: | |
[Verifying my OpenPGP key: openpgp4fpr:f2bee065f8281c9a0092ef16928f139c9871f640] |
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
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account. | |
Token for proof: | |
[Verifying my OpenPGP key: openpgp4fpr:f2bee065f8281c9a0092ef16928f139c9871f640] |
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
# ^Xa to insert all matches | |
zle -C all-matches complete-word _generic | |
bindkey '^Xa' all-matches | |
zstyle ':completion:all-matches:*' old-matches only | |
zstyle ':completion:all-matches::::' completer _all_matches |
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 -e | |
# Blocksize to truncate to and buffer by | |
BS=${BS:-4096} | |
SELF="`basename $0`" | |
death() { echo "$SELF:" "$@" >&2; exit 1; } | |
[ $# -eq 2 ] || death "Usage: $SELF original copy" | |
SRC="$1"; DST="$2" |
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 | |
""" | |
Originally from: https://www.stavros.io/posts/python-fuse-filesystem/ | |
All credit goes to the author, not me. | |
""" | |
from __future__ import with_statement | |
import os | |
import sys |
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
import glob | |
import itertools | |
import os | |
# This is getting ridiculous | |
try: | |
from pip._internal.req import parse_requirements | |
from pip._internal.network.session import PipSession | |
except ImportError: | |
try: |