Skip to content

Instantly share code, notes, and snippets.

View marekkowalczyk's full-sized avatar

Marek Kowalczyk marekkowalczyk

View GitHub Profile
@marekkowalczyk
marekkowalczyk / Makefile
Created May 21, 2019 10:46 — forked from kristopherjohnson/Makefile
Makefile that uses Pandoc to generate HTML, PDF, DOCX, etc. from Markdown source files
# Makefile
#
# Converts Markdown to other formats (HTML, PDF, DOCX, RTF, ODT, EPUB) using Pandoc
# <http://johnmacfarlane.net/pandoc/>
#
# Run "make" (or "make all") to convert to all other formats
#
# Run "make clean" to delete converted files
# Convert all files in this directory that have a .md suffix
@marekkowalczyk
marekkowalczyk / zathurarc
Last active July 27, 2020 21:32 — forked from michaelmrose/zathu
zathura config
# Zathura configuration file
# See man `man zathurarc'
set selection-clipboard clipboard
set scroll-wrap true
set scroll-page-aware true
set window-title-page true
# Open document in fit-width mode by default
set adjust-open "best-fit"
@marekkowalczyk
marekkowalczyk / read.go
Last active November 15, 2020 02:05
Helper command: returns input from command line OR pipe --- but not both
package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
"time"
)
@marekkowalczyk
marekkowalczyk / DevonThink Search operators
Last active November 28, 2020 00:13 — forked from florido/DevonThink Search operators
DevonThink Search operators (formatted as Pandoc Markdown)
---
header-includes: \usepackage{noto}\urlstyle{tt}\usepackage{titlesec}\titlelabel{\thetitle.\quad}
numbersections: true
papersize: a4
lang: en
documentclass: article
title: DevonThink Search Operators
---
In the toolbar search field, as well as in both the interactive and the simple
@marekkowalczyk
marekkowalczyk / rpn.awk
Last active July 23, 2022 00:08
Basic CLI RPN (Reverse Polish Notation) calculator in AWK
#! /usr/bin/awk -f
# Basic interactive CLI RPN (Reverse Polish Notation) calculator
# v1.1
# input: arithmetic expressions in RPN
# output: values of expressions
# Adapted by mko1971@gmail.com from Aho, Kernighan, and Weinberger, The AWK Programming Language, 143.
# 2021-01-26 CC0 1.0 Universal (CC0 1.0)
# https://gist.github.com/marekkowalczyk/06eb0d7d850fd50497b0f65d350d0003
-- Import a man page into DEVONthink as PDF
-- Created by Christian Grunenberg on Sat Apr 16 2005. Copyright (c) 2005-2019. All rights reserved.
-- Edited by Houthakker 2011 Feb 12 to import PDF (rather than text) version of man page (to preserve highlighting of keywords and headers)
-- Modified on 2021-01-25 by https://discourse.devontechnologies.com/u/pete31/ and https://discourse.devontechnologies.com/u/marekkowalczyk/ to add auto tagging of imported PDFs
tell application id "DNtp"
try
repeat
set page to display name editor "Man page" info "Enter the man page to import:"
if page is not "" then exit repeat
@marekkowalczyk
marekkowalczyk / define.sh
Last active January 28, 2021 10:50
Print definition of COMMAND, i.e. the line following NAME in its manpage
#!/usr/bin/env bash
# Print definition of COMMAND, i.e. the line following NAME in its manpage
# https://gist.github.com/marekkowalczyk/5dcae326d2148c2757c386776ae455d7
man $1 | col -b | grep -A 3 ^NAME | sed -n 2,3p | sed -E 's/^ +//' | tr '\n' ' '
printf "\n"
@marekkowalczyk
marekkowalczyk / comdefs.tsv
Last active December 10, 2022 01:49
Definitions of assorted commands, extracted from NAME sections of respective manpages
COMMAND DEFINITION
a2x A toolchain manager for AsciiDoc (converts Asciidoc text files to other file formats)
abduco terminal session manager
abook text-based address book program
abs integer absolute value function
ack grep-like text finder
aclocal manual page for aclocal 1.16.3
acountry print the country where an IPv4 address or host is located
acyclic make directed graph acyclic
addftinfo add information to troff font files for use with groff
CODE EFFECT NOTE
0 Reset / Normal all attributes off
1 Bold or increased intensity
2 Faint (decreased intensity) Not widely supported.
3 Italic Not widely supported. Sometimes treated as inverse.
4 Underline
5 Slow Blink less than 150 per minute
6 Rapid Blink MS-DOS ANSI.SYS; 150+ per minute; not widely supported
7 [[reverse video]] swap foreground and background colors
8 Conceal Not widely supported.
@marekkowalczyk
marekkowalczyk / .rc.sh
Last active March 10, 2021 22:53
Bash function to edit and source *rc files; best included in .bashrc
function rc(){
# TODO XDG Path
EDITORRC="$EDITOR"
FILE=""
case "$1" in
help)
printf "aliasesicalbuddy\n"
printf "aliasestask\n"
printf "aliases\n"