Skip to content

Instantly share code, notes, and snippets.

@step-
step- / nameigo
Last active November 19, 2022 20:51
nameigo - grep-friendly namei(1) output groomer - This Linux filter walks the components of a pathname and prints symlinks and missing file errors.
#!/bin/bash
# nameigo - grep-friendly namei(1) output groomer
# license: GNU GPL version 3
# (C) 2022 step, https://github.com/step-
# Required: stdbuf (GNU coreutils) and namei (linux-utils)
# Further notes after main.
usage () {
@step-
step- / README.md
Last active November 6, 2020 09:31
A Linux shell wrapper for hastyScribe, which converts markdown to self-contained HTML with embedded images.

HastyScribe is a simple, cross-platform command-line program to convert markdown to self-contained HTML.

This script for Linux adds options --help and --no-clobber, and facilitates customizing CSS styles.

To install HastyScribe:

  • Download the latest release binary from the above repo
  • Extract the binary to a directory in your path
  • Rename the binary hastyscribe.bin
  • Copy hastyscribe.sh alongside the renamed binary
  • Make both files executable.
@step-
step- / enum1
Last active May 30, 2020 08:01
Print FreeType font family + style given font file name and language ID (Linux)
#!/bin/sh
# https://gist.github.com/step-/9d9c48e05f8290b52366a579811cd9f0
# enum1 - print FreeType font family + style $1 = font file basename with $2 = language ID
# example: ./enum1 DejaVuSerif.ttf en
# POSIX shell and POSIX awk feature set.
# Require fontconfig package.
: << \INFO_LANGUAGE
FreeType Language ID reflects the OpenType specification, mostly as ISO 639-2 and 639-3 codes.
@step-
step- / child_TOC.R
Last active August 29, 2019 15:13
Add Table of Contents to a xaringan R markdown presentation
#' Add a TOC to a xaringan presentation
#'
#' @seealso Started as a hack of <https://stackoverflow.com/a/57190718>.
#' @seealso This file <https://gist.github.com/step-/55d73f82291434c46e46c665d870c6e7>.
#'
#' @description
#' A TOC markdown child file is created while knitting.
#'
#' * A new TOC slide is automatically inserted at the _generator markdown_.
#' * The TOC heading is configurable.
@step-
step- / fzfz.bash
Created December 25, 2018 07:39
Fuzzy search jump-list of recently used directories with fzf and z
#gist-begin
# Copyright (C) step, 2018 - https://github.com/step-
# License: same as FZF itself - https://github.com/junegunn/fzf
# cd/pushd/yank selected directory listed by z 'frecency' {{{1}}}
# Requires: z.sh https://github.com/rupa/z
# Key bindings: [[cmd...] start-query] A-D
bind -x '"\ed": "__fzf_cd_step_z__"' # not for bash -o vi
# ENTER: cd selected-path
# A-P: pushd selected-path
@step-
step- / rm-yad-shmem.sh
Created September 18, 2018 08:50
Remove (yad) unreleased shared memory blocks (Linux).
#!/bin/sh
# rm-yad-shmem for yad 0.36.3 and possibly other versions.
# Motivation
#
# Some times, when you kill [-USR1/-USR2] a plugged dialog, or the paned/tabbed
# dialog that hosts the plugged dialog, its shared memory (shmem) may not be
# fully released. This tool aids in releasing shmem blocks interactively.
This is a Python script to extract GNOME/GTK's color scheme and apply it to Wine, so that the themes (approximately) match.
Instructions:
1. Set your Gnome theme as you would like it
2. Run with a command like "python wine_colors_from_gtk.py"
3. Restart any apps running in Wine. They should match the Gnome theme colors now.
Better description with screenshots here: http://www.endolith.com/wordpress/2008/08/03/wine-colors/
This is also stored on https://code.launchpad.net/~endolith/+junk/wine-color-scraper