Skip to content

Instantly share code, notes, and snippets.

@Konfekt
Konfekt / paronyms
Created November 15, 2016 14:43
script that takes a word list and groups into words that differ by a single letter
#!/usr/bin/perl
use utf8;
my (@list, @paronyms);
my $file = shift;
die "Usage: $0 LIST" unless $file;
open(LIST, "+<:encoding(UTF-8)", $file) or die "$0: Can't open $file $!";
push(@list, $_) while <LIST>; # Read whole list
@Konfekt
Konfekt / gist:ec7bb1360061ca130b51776bae586fc7
Last active November 16, 2016 14:40
portuguese substantives that became verbs
abrenúncio abrenuncio
absíntio absintio
abundância abundancia
abóbada abobada
abóbora abobora
acarícia acaricia
aciróloga acirologa
acirólogo acirologo
acróstica acrostica
acróstico acrostico
abacateiro
abade
abate
abafo
abalo
abano
aberta
@Konfekt
Konfekt / gist:06f5ab7252ec1685a85d1b75de59d249
Last active October 20, 2017 12:33
pandoc-crossref man page
.\" Automatically generated by Pandoc 1.19.2.1
.\"
.TH "PANDOC\-CROSSREF" "1" "Octobre 2017" "" ""
.hy
.SH pandoc\-crossref
.PP
pandoc\-crossref is a pandoc filter for numbering figures, equations,
tables and cross\-references to them.
.PP
Input file (like
@Konfekt
Konfekt / snippy.sh
Last active June 4, 2018 18:40 — forked from coderofsalvation/snippy.sh
modified version of snippy that does NOT use the clipboard and works thus everywhere
#!/usr/bin/env bash
# From
# Based on:
# https://github.com/BarbUk/dotfiles/blob/master/bin/snippy
# https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu
DIR=${HOME}/.snippy
MENU_ENGINE="rofi"
DMENU_ARGS='-dmenu -i -sort -lines 25'
@Konfekt
Konfekt / peco.1
Created November 17, 2018 12:12
peco manpage
.TH peco 1 "2018-11-17" "0.5.3" "https://github.com/peco/peco/"
.hy
.SH peco
.PP
Simplistic interactive filtering tool
.PP
\f[I]NOTE\f[R]: If you are viewing this on Github, this document refers
to the state of \f[C]peco\f[R] in whatever current branch you are
viewing, \f[I]not\f[R] necessarily the state of a currently released
version.
@Konfekt
Konfekt / highlight-unicode-homoglyphs.vim
Last active June 27, 2019 09:54
highlight common unicode homoglyphs as error in Vim
" TODO Update to list at https://www.irongeek.com/homoglyph-attack-generator.php
augroup vimrc
autocmd!
autocmd ColorScheme *
\ highlight homoglyphfg cterm=underline ctermfg=DarkGreen ctermbg=NONE gui=undercurl guifg=DarkGreen guibg=NONE |
\ highlight homoglyphbg ctermfg=NONE ctermbg=DarkGreen guifg=NONE guibg=DarkGreen
augroup END
silent doautocmd vimrc ColorScheme
" Highlight non-breaking white space characters
1match homoglyphbg '[\x0b\x0c\u00a0\u1680\u180e\u2000-\u200a\u2028\u202f\u205f\u3000\u3164\ufeff]'
@Konfekt
Konfekt / zathist.sh
Last active April 17, 2020 19:28
zathura MRU: filter in rofi all files viewed in zathura ordered by recency and view selection
#! /bin/sh
#
# Save this script as executable ~/bin/zathist.sh and
# add to ~/.xbindkeysrc the shortcut
#
# "$HOME/bin/zathist.sh"
# Control + Alt + z
#
# PDFs whose path matches this pattern will not be listed
@Konfekt
Konfekt / kc-sms.sh
Last active May 8, 2020 14:54
kc-sms - send SMS using KDEconnect on the command line
#!/bin/sh
if ! command -v kdeconnect-cli >/dev/null 2>&1; then
echo "kde-connect-cli not found! Please install KDE Connect."
exit 1
fi
if [ $# -eq 0 ] || [ "$1" = -h ] || [ "$1" = --help ]; then
echo "kc-sms - send SMS using KDE Connect on the command line"
echo "usage: kc-sms <Phone Number> <Message> [Parameters]"
@Konfekt
Konfekt / passy.md
Last active January 28, 2021 04:05
passy: pastes anywhere passwords managed by password-store selected from a fuzzy finder menu

Bind this shell script to a hotkey. On hitting the hotkey, you can fuzzy search a password among those managed by the command-line tool https://www.passwordstore.org/. On selecting one of them, it is pasted at the current cursor position.

This script depends on "rofi", "dmenu", "zenity", "xsel" and "xdotool" which most linux distros offer as install packages.

To bind this shell script to a hotkey, say Meta+P:

  1. Paste the below shell-script code into a file, say ~/bin/passy, make it executable.