From 33c7ddb09e0eae0796686c64ffa022a181145cc1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 4 Jan 2023 23:21:15 -0600 Subject: Restart ... again ... again --- lisp/upload-junk.el | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 lisp/upload-junk.el (limited to 'lisp/upload-junk.el') diff --git a/lisp/upload-junk.el b/lisp/upload-junk.el deleted file mode 100644 index 5a9da84..0000000 --- a/lisp/upload-junk.el +++ /dev/null @@ -1,47 +0,0 @@ -;;; upload-junk.el --- Upload junk -*- lexical-binding: t; -*- - -;;; Code: - -(require 'tramp) - -(defvar upload-junk-ssh-host "hetzner" - "SSH host to upload to.") - -(defvar upload-junk-ssh-root "/junk" - "SSH root folder to upload to.") - -(defvar upload-junk-web-host "https://junk.acdw.net" - "Web host to link uploads to.") - -(defun upload-junk-file-name (&optional file) - "Return the uploaded filename for FILE." - (let ((file (or file "_.txt"))) - (format "tmp_%s_%x%x.%s" - (file-name-nondirectory (file-name-sans-extension file)) - (time-convert (current-time) 'integer) - (random (* 8 8 8 8)) - (or (file-name-extension file) "txt")))) - -(defun upload-junk-region (start end) - "Upload region from START to END to my server." - (interactive "r") - (let* ((s (buffer-substring-no-properties start end)) - (f (upload-junk-file-name (buffer-file-name))) - (w (format "%s/%s" upload-junk-web-host f))) - (with-temp-buffer - (insert s) - (write-file (format "/sshx:%s:%s/%s" - upload-junk-ssh-host - upload-junk-ssh-root - f))) - (kill-new w) - w)) - -(defun upload-junk-region-or-buffer () - (interactive) - (if (region-active-p) - (upload-junk-region (region-beginning) (region-end)) - (upload-junk-region (point-min) (point-max)))) - -(provide 'upload-junk) -;;; upload-junk.el ends here -- cgit 1.4.1-21-gabe81