Skip to content

Instantly share code, notes, and snippets.

@Jegeva
Jegeva / emacs-nxml-comment-tag.el
Created March 19, 2020 13:53
emacs nxml comment atag
;;
(defun nxml-comment-next-tag (&optional arg)
(interactive "^p")
(or arg (setq arg 1))
(nxml-forward-element)
(nxml-backward-element)
(let (p1 p2)
(setq p1 (point))
(nxml-forward-element)
@Jegeva
Jegeva / httpcache.py
Last active August 15, 2022 07:55
a simple caching http proxy
#! /usr/bin/python3
# A simple HTTP proxy which does caching of requests.
# "Inspired" by: https://gist.github.com/justinmeiners/24dcf5904490b621220bed643651f681
# but updated with
#- a clean exit on signal allowing it to be easily popped by another script using subprocess
#- tcp socket reuse to avoid the tcp socket already in use if popped often
#- a cache directory to avoid a lot of files just being in the middle
#
# use it by getting 'http://localhost:8000/www.kernel.org' to get http://www.kernel.org