Skip to content

Instantly share code, notes, and snippets.

@cryptorick
cryptorick / init.el
Last active June 10, 2023 16:23
Example Emacs init using Elpaso. (For my friend Raoul)
;;----------------------------------------------------------------------
;; Elpaso package manager
;; Bootstrap it outside of Emacs: these commands will install cask and elpaso,
;; respectively, to ~/.emacs.d/elpa.
;;
;; $ cd builds # go somewhere where you usually build software.
;; $ git clone https://github.com/cask/cask && make -C cask install
;; $ git clone https://github.com/commercial-emacs/elpaso && make -C elpaso install
@cryptorick
cryptorick / add-to-your-HOME.gitconfig
Created May 2, 2023 00:24
Impersonate people in git
;; Add this, if you want, to the bottom of your $HOME/.gitconfig.
;; Impersonate people: add personages (like the 3 below here); then say
;; $ git impersonate bob
;; Now, git thinks you are Bob (locally of course). This is good for helping
;; your team do git surgery on a branch (and retain the credit for the original
;; person's work). Don't forget to set yourself back (unmask) when you are done.
;; $ git impersonate me
;;
[user-me]
@cryptorick
cryptorick / ispell-with-org.el
Created December 8, 2018 15:22
Make ispell work better with Org
;;; Stolen from
;;; https://github.com/grettke/help/blob/master/help.org#spell-checking
;; Make ispell work better with Org by skipping parts you don't want
;; spellchecked like code blocks and metadata. This is a standalone
;; version of this from Grant's help repo. Thanks, Grant!
(defconst help/org-special-pre "^\s*#[+]")
(defun help/block-regex (special)
@cryptorick
cryptorick / lilypond-issue-no-lyrics-freebsd-11.2.md
Last active November 8, 2018 22:40
lilypond issue: no lyrics rendered (FreeBSD 11.2)

lilypond issue: no lyrics rendered (FreeBSD 11.2)

Yeah, I knew it was a missing font thing, but dang, there are a lot of moving parts.

First, make sure that the gsfonts package is installed (here's the FYI about it: https://www.freshports.org/print/gsfonts/)

$ sudo pkg install gsfonts
@cryptorick
cryptorick / stat-funcs.awk
Last active September 18, 2018 19:29
I stole some stat functions from the newLISP (C) source code; so I could compute a confidence interval in awk. :D
BEGIN {
ITMAX = 100
EPS7 = 3.0e-7
}
function fatalError(msg, errcode) {
print msg > "/dev/null"
exit(errcode+0)
}
@cryptorick
cryptorick / print-include-tree.oh
Created September 2, 2018 01:53
Print a tree of include filenames in depth-first order and indented
#!/usr/bin/env oh
#--------------------------------------------------------------------------
# Utilities
define defun: syntax (name args: body) e = {
e::eval: list define $name : list method (list @$args) = @$body
}
define fn: syntax (args: body) e = {
@cryptorick
cryptorick / lp2pass.l
Created January 2, 2018 05:02
lp2pass.l -- Convert LastPass vault to password store
#!/usr/local/bin/pil
#
# lp2pass.l -- Convert LastPass vault to password store (pass db).
# This script processes Secure Notes as well as regular site entries.
#
# Usage: Given the exported LastPass db (vault records) are in a CSV
# file called lp.csv, call this script in any one of the following
# ways.
#
# $ cat lp.csv | lp2pass.l
@cryptorick
cryptorick / Makefile-for-mg-nonGNU
Last active December 29, 2017 00:17
This makefile was designed as a "drop in" replacement for the file GNUmakefile in repo https://github.com/ibara/mg. The idea is to have a common makefile that can be used by both gmake and BSD make. Two problems I ran into: one, versions of gmake before Apr 2011 do NOT support `!=`; two, NetBSD system make's implicit rule for `.c.o` puts all `.o…
# Mg portable GNUmakefile
# This file written by Brian Callahan <bcallah@openbsd.org>
# and released into the Public Domain.
PROG = mg
PREFIX ?= /usr/local
MANDIR ?= ${PREFIX}/man
DOCDIR ?= ${PREFIX}/share/doc/mg
INSTALL = /usr/bin/install
@cryptorick
cryptorick / .sexy-sh-prompt.sh
Last active February 25, 2023 00:37
Sexy sh prompt ("Oh, behave!" :)
# "Sexy sh prompt" (modeled after "Sexy bash prompt")
#
# Tries to work on as many Bourne-style and Korn-style shells as
# possible and tries to be simple and not litter your environment.
#
# When you source this script in your (interactive) shell startup
# script (or on the command line), you can set some (transient)
# environment variables to configure a few extra options; see the
# examples below to get the full idea.
#
@cryptorick
cryptorick / XS-OpenBSD-notes.md
Last active February 26, 2017 19:06
Building XS on OpenBSD 6.0

Building XS on OpenBSD

These are some notes on building XS on OpenBSD 6.0. YMMV with other versions (maybe). They follow the build routine outlined in the INSTALL document.

NOTE: Prefixes for install target directories (established by the --prefix option in configure) are not discussed -- this seems to be more of a personal preference for people, even though I must mention that the OpenBSD package manager installs its bits into /usr/local/bin; so, you may not want to use that for your prefix. However, I gather, from reading the openbsd-misc mailing list, that some experienced users still install non-package-manager software there also. Your choice.

Prerequisite

As a prerequisite, you might have to pkg_add the following (I'm not sure, because I didn't start from a clean OpenBSD install; so this is a "best guess"): autoconf, automake, boehm-gc, boost, gmake.