Skip to content

Instantly share code, notes, and snippets.

@clsn
clsn / hebcalscriptst.lua
Created July 21, 2015 01:52
Hebrew calendar math in lua for WatchMaker
--[==[
Calculations for Hebrew dates and temporal hours (for WatchMaker).
Calendar math from Edward M. Dershowitz and Nachum Reingold,
see http://emr.cs.uiuc.edu/~reingold/calendar-book/index.html
Translated into Lua from emacs-lisp by Mark Shoulson, mark@shoulson.com
The MIT License (MIT)
Copyright (c) 2015 Mark E. Shoulson
@clsn
clsn / islcalscript.lua
Created July 21, 2015 01:54
Islamic calendar support in lua for WatchMaker
--[==[
Calculations for the Islamic Calendar (for WatchMaker)
Calendar math from Edward M. Dershowitz and Nachum Reingold,
see http://emr.cs.uiuc.edu/~reingold/calendar-book/index.html
Translated into Lua from emacs-lisp by Mark Shoulson, mark@shoulson.com
The MIT License (MIT)
Copyright (c) 2015 Mark E. Shoulson
@clsn
clsn / org-pop.el
Last active March 11, 2020 00:51
PoC of org-pop-mode, which allows (effectively) "popping" back up to a higher org-mode level without a new heading.
;;; org-pop.el --- Allow popping back up from a sublevel without a heading -*- lexical-binding: t -*-
;; Author: Mark Shoulson <mark@shoulson.com>
;; Url: XXXXXX
;; Package-Version: XXXX
;; Version: 0.01
;; Package-Requires: ((emacs "24.4") (org "8.3.5"))
;; Keywords: hypermedia, outlines, Org
;;; Commentary:
@clsn
clsn / org-flash-emph.el
Created March 18, 2020 20:43
Hide emphasis markers when point is distant, but leave the space for them, so when they reappear things don't jump. Scale markers down a little if using org-variable-pitch-mode. Extremely rough-cut.
;; Someone needs to lock me up...
(defun org-conceal-emph-pairs (limit)
(save-excursion
(org-conceal-pairs limit org-verbatim-re))
(org-conceal-pairs limit org-emph-re)
)
(defconst org-conceal-vp-scale 0.7) ; as if scaling were a good idea.
(defconst org-conceal-distance 7)
@clsn
clsn / outfuse.py
Created January 10, 2024 22:32
FUSE for browsing output of invokeai as directories
#!/usr/bin/env python3
# Motivation: browse the "boards" created by InvokeAI as if they were subdirectories.
# To extend: do better than that. Basically, this is the idea:
# - root/
# - UNSORTED
# - models
# - <model name1>
# - <"hashed" prompt1>
@clsn
clsn / tomacdict.py
Created March 18, 2025 01:14
Draft python script for converting UNIX .XCompose to MacOS DefaultKeyBinding.dict
#!/usr/bin/env python3
# Basically a form of treeprint that prints out in a format accessible as
# MacOS DefaultKeyBinding.dict file.
# Still buggy, see XXXXs below. Result will want some hand-editing.
from readcompose import readcomposefiles
import re
@clsn
clsn / readcompose.py
Created March 18, 2025 01:16
Utilities for reading .XCompose files
import fileinput
import re
def processline(line):
name = []
comments = ''
startpos=0
while True:
m=re.match("\\s*<(\\w+)>",line[startpos:])