Skip to content

Instantly share code, notes, and snippets.

@kva1966
kva1966 / keybase.md
Created June 9, 2023 06:39
keybase.md

Keybase proof

I hereby claim:

  • I am kva1966 on github.
  • I am kva1966 (https://keybase.io/kva1966) on keybase.
  • I have a public key ASBc4yknwYD-5i9RQSSZQLLFs-9ZW4-CYMv6ULu6FlqJ9Qo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am kva1966 on github.
  • I am kvasd (https://keybase.io/kvasd) on keybase.
  • I have a public key ASCS-KgpQstLUO7VizyEmJxwHhjsymenJ8-_MpSeBc-byAo

To claim this, I am signing this object:

@kva1966
kva1966 / watch.sh
Last active October 25, 2019 00:41
Perl watch
# cpanm App::watchdo
# https://metacpan.org/pod/distribution/App-watchdo/bin/watch-do
# watch-do -w <file|dir> -- <cmd>
# E.g. https://metacpan.org/pod/Pod::Perldoc::ToMarkdown
watch-do -w Foo.pm -- perldoc -o Markdown Foo.pm
@kva1966
kva1966 / sql-fmt.py
Created October 16, 2019 03:44
Very basic SQL Formatter
#!/usr/bin/env python3
## Simple, regex-based SQL formatter. The core idea is to not muck around
## with any indenting, but to simply convert keywords to uppercase. What an
## utterly annoying convention today.
## Reads stdin, writes to stdout, allowing for use in IDE processes or similar.
import sys
import re
@kva1966
kva1966 / metadata.yml
Created September 16, 2019 08:47
Pandoc Metadata
---
# Fonts
# General Fonts -- URW Palladio L, URW Chancery L, Reminga Pro
# To find proper names, use fc-list (Font Config)
# E.g. Reminga has the following:
# $ fc-list | grep -i reminga
# (look at fc-cache if fc-list does not return anything)
# /home/xxx/.fonts/FF Reminga Pro/FontFont - RemingaPro.otf: Reminga Pro:style=Regular
# /home/xxx/.fonts/FF Reminga Pro/FontFont - RemingaPro-MediumIta.otf: Reminga Pro,RemingaPro\-MediumIta:style=Medium Italic,Regular
@kva1966
kva1966 / d-prune-all.sh
Last active October 14, 2019 07:08
Docker Dangling Object Prunes
#!/bin/bash
docker system prune --volumes
@kva1966
kva1966 / repl.rc
Created August 13, 2019 06:59
Perl `Devel::REPL` RC file
# Run Control file for https://metacpan.org/pod/Devel::REPL
# Place in ~/.re.pl/repl.rc
# Picked up by the installed re.pl script.
# Install missing packages like:
# cpanm Devel::REPL::Plugin::<PluginName>
# e.g. cpanm Devel::REPL::Plugin::DataPrinter
print("Loading RC file[" . $ENV{HOME} . "/.re.pl/repl.rc]\n");
@kva1966
kva1966 / slapd.conf.snippet
Last active September 26, 2019 21:04
slapd-sock-overlay configuration
# For 'overlay sock' capability.
moduleload back_sock
# Running in overlay mode rather than as a database.
overlay sock
extensions connid
# Path to Unix Domain Socket created by a listening client, to which slapd
# will connect.
@kva1966
kva1966 / tree.ts
Last active July 28, 2017 07:47
TypeScript Interesting Tidbits, e.g. Index Types!
// Quick, simple enums -- typechecked!
type TraversalOrder = "inorder" | "preorder" | "postorder";
type NodePosition = "root" | "left" | "right";
// Of course TypeScript has proper enums, but this might be a good way of
// doing interop without writing wrapper types.
// Type Aliases for complex function types
type VisitorFn<T, N extends Node<T>> = (node: N, depth: number, position: NodePosition) => void;
type TraversalFn<T> = (node: BstNode<T>, depth: number, position: NodePosition) => void;
@kva1966
kva1966 / 1-notes.txt
Last active July 26, 2017 05:17
tsconfig.json and webpack module aliasing Notes
PWD ~/projects/checkouts/my-projects/code-snippets/datastruc-vis
Directory Structure: 'node_modules' excluded, 'dist' is the output/build folder
├── dist
│   ├── bundles
│   │   ├── bundle.js
│   │   └── bundle.js.map
│   └── index.html
├── package.json