Skip to content

Instantly share code, notes, and snippets.

Avatar

agum onkey agumonkey

  • NONE
  • Dark side of the moon @ ['tkf8-2-1', 'ay21-3', '3263-827']
View GitHub Profile
@agumonkey
agumonkey / oosax.py
Created Aug 19, 2021
oosax.py -- trying to play with sax again to make DOM tooling [WIP]
View oosax.py
import xml
from xml import sax
class Todo:
pass
class Node:
def __init__(self, name, attrs):
self.name = name
self.attrs = attrs
View zap-to-over.el
"
Bline lineM line lineE
K C D
D = C + BM - KC
asks for a template
finds M and yields M - C as offset
TODO: only moves to the first match.
@agumonkey
agumonkey / package-plus.el
Created Jun 9, 2021
quick hydra for package.el
View package-plus.el
(defhydra package-plus (:exit t)
("r" package-refresh-contents "Refresh" :column "Archives")
("a" package-autoremove "Auto-Remove")
("l" package-list-packages "List")
("u" package-list-packages "Mark and Update")
("i" package-install "Install" :column "Packages" :exit nil)
("d" package-delete "Delete"))
@agumonkey
agumonkey / ov1.el
Last active May 27, 2021
ov1 -- overlay helper lib #emacs #elisp #ux
View ov1.el
;;; ov1 -- overlay helper lib -*- lexical-binding: t; -*-
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x C-f and enter text in its buffer.
;;; MORE: https://www.youtube.com/watch?v=IWxCj5cr8rY (eieio font-lock Kitchin)
;;; TODO: use magit command minibuffer
;;; TODO: extend overlay
;;; TODO: adjoint overlay (f (ov-substring))
;;; have an overlay monad ? ov = Ov id , compose Ov f Ov g = shift (l|r|u|d) Ov g (f (ov-substring))
@agumonkey
agumonkey / cc.lisp
Created May 14, 2021
;;; coin-change problem in common-lisp
View cc.lisp
;;; coin-change problem in common-lisp
(defun remove-first (e l)
(cond ((null l) '())
(t (if (equal e (car l))
(cdr l)
(cons (car l) (remove-first e (cdr l)))))))
(remove-if (lambda (e) (equal e 1)) '(1 1 2 3 4))
;; (2 3 4)
View i3view.py
#!/usr/bin/env python
import tkinter
import os
import re
##################################################################### prelude
def always(v):
'''function always returning the same value (see clojure `constantly`)'''
View tcpcs.py
'''
tcpcs
'''
import sys
import time
import threading
import socket
View url.py
from urllib.parse import urlparse, urlunparse
"""
url helpers
"""
def isurl(o):
return o.startswith('http://') \
or o.startswith('https://')
View new.py
## based on airbnb proto interview
def rev(s):
return s[::-1]
# a .. b
# (a,b) .. (b,a)
def mir(a,b):
i = a
j = b
@agumonkey
agumonkey / fmt.el
Created Mar 14, 2019
fmt.el - ala python string formatting
View fmt.el
;;; ala python string formatting
;;;
;;; (let ((some "Object") (i 1)) (f "<{some}... [{i}:{i}>")) => "<Object... [1:1]>
;;;
;;; todo: {...} parser
;;; todo: wrapping defmacro
;;; todo: wrapping defun
;;;
;;; state: alpha²