Skip to content

Instantly share code, notes, and snippets.

@bdargan
Last active December 28, 2015 20:29
Show Gist options
  • Save bdargan/7557930 to your computer and use it in GitHub Desktop.
Save bdargan/7557930 to your computer and use it in GitHub Desktop.
stuff, like curl and date utils find a number, that looks like a recent number of secs since the epoch and make it human readable
(defun epoch-to-iso ()
(interactive)
(re-search-forward "\\([0-9]\\{10,13\\}\\)")
(goto-char (match-beginning 0))
(replace-match (format-time-string "%Y-%m-%d" (seconds-to-time (/ (string-to-int (match-string 1)) 1000))))
)
(defun curl-something (begin end)
(interactive "r")
(shell-command (concat "curl " (buffer-substring begin end))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment