Skip to content

Instantly share code, notes, and snippets.

@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
@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
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 / gist:d950f03c33eb31a7422e3f23d160ba6f
Created October 20, 2017 12:26
markdown source to convert to man page for pandoc-crossref
% PANDOC-CROSSREF(1)
% Nikolay Yakimov
% October 2017
# pandoc-crossref
pandoc-crossref is a pandoc filter for numbering figures, equations, tables and cross-references to them.
Input file (like [demo.md][demo-md]) can be converted into [html][html], [latex][latex], [pdf][pdf], [md][md] or other formats.
function! <sid>CCR()
    if getcmdtype() isnot# ':'
      return "\<CR>"
    endif
    let cmdline = getcmdline()
    if cmdline =~# '\v^\s*(ls|files|buffers)!?\s*(\s[+\-=auhx%#]+)?$'
        " like :ls but prompts for a buffer command
        return "\<CR>:b"
    elseif cmdline =~# '\v/(#|nu%[mber])$'
@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.
@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.
param(
[parameter(Position=0,Mandatory=$false)][string]$PSReadlineChordProvider = 'Ctrl+t',
[parameter(Position=1,Mandatory=$false)][string]$PSReadlineChordReverseHistory = 'Ctrl+r',
[parameter(Position=1,Mandatory=$false)][string]$PSReadlineChordSetLocation = 'Alt+c',
[parameter(Position=1,Mandatory=$false)][string]$PSReadlineChordReverseHistoryArgs = 'Alt+a')
function Invoke-FuzzyEdit() {
param($Directory=$null)
$files = @()