Skip to content

Instantly share code, notes, and snippets.

@steinarb

steinarb/.emacs Secret

Created March 11, 2022 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steinarb/61ccca486827f84a08cbc3f414cfda27 to your computer and use it in GitHub Desktop.
Save steinarb/61ccca486827f84a08cbc3f414cfda27 to your computer and use it in GitHub Desktop.
;; restclient from git to get restclient-jq
(add-to-list 'load-path (expand-file-name "~/git/restclient.el"))
(when (locate-library "restclient")
(require 'restclient)
(require 'restclient-jq)
(restclient-register-result-func "save-body" #'restclient-save-body "Save body to filename given as arg"))
(defun restclient-save-body (args args-offset)
(save-match-data
(let ((filename (expand-file-name args)))
(lambda ()
(with-current-buffer restclient-same-buffer-response-name
(write-region (point-min) (restclient-jq-result-end-point) "~/.stinkyAuthtoken"))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment