From d93f91a0e110ad78e0f06d039a5d3ef02fa3943d Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Sun, 15 Sep 2019 11:12:38 -0400 Subject: [PATCH] Add ngrok command --- emacs/init.org | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index a8507be..f7f4300 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -3111,3 +3111,18 @@ A fuzzy-finder for notes. #+BEGIN_SRC emacs-lisp (use-package pollen-mode) #+END_SRC +* Ngrok +#+BEGIN_SRC emacs-lisp + (defun ngrok (port &optional subdomain) + (interactive "nPort: \nsSubdomain: ") + (let ((buf (get-buffer-create + (concat "*ngrok-" + (number-to-string port) + "*"))) + (cmd (if (and subdomain (not (string-empty-p subdomain))) + (concat "ngrok http " + "--subdomain=" subdomain " " + (number-to-string port)) + (concat "ngrok http " (number-to-string port))))) + (async-shell-command cmd buf))) +#+END_SRC