Skip to content

Instantly share code, notes, and snippets.

View jordonbiondo's full-sized avatar
🤖
bzzzzzt

Jordon Biondo jordonbiondo

🤖
bzzzzzt
View GitHub Profile
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Win config stack
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar winstack-stack '()
"A Stack holding window configurations.
Use `winstack-push' and
`winstack-pop' to modify it.")
(defun winstack-push()
"Push the current window configuration onto `winstack-stack'."
@jordonbiondo
jordonbiondo / *scratch*.el
Created April 14, 2014 15:06
working windows omnisharp syntax checker for flycheck
(flycheck-define-checker omnisharp
"Flycheck checker for omnisharp"
:command ("curl"
"--silent" "-H"
"Content-type: application/json"
"--data-binary"
(eval (concat "@" (omnisharp--write-json-params-to-tmp-file
omnisharp--windows-curl-tmp-file-path
(json-encode (omnisharp--get-common-params))))) ;; do the work here, and get the path
(defun spam-matt ()
(interactive)
(let ((buffer (current-buffer)))
(jabber-chat-with (jabber-read-account) "matt.gritters@urgot")
(end-of-buffer)
(insert "lols")
(jabber-chat-buffer-send)
(switch-to-buffer buffer)))
(global-set-key (kbd "C-c C-m") 'spam-matt)
@jordonbiondo
jordonbiondo / *scratch*.el
Created April 9, 2014 20:54
My super cool gist!
description (begin end &optional description private callback)
"Post the current region as a new paste at gist.github.com
Copies the URL into the kill ring.
With a prefix argument, makes a private paste."
(interactive "r\nsGist Description: \nP")
(let* ((file (or (buff
@jordonbiondo
jordonbiondo / dired.el
Created April 9, 2014 20:48
foobar fizzbuzz
(dired-sort-R-check switches)
(setq dired-actual-switches switches)
(dired-sort-set-mode-line)
(or no-revert (revert-buffer)))
@jordonbiondo
jordonbiondo / gist.el
Created April 9, 2014 20:47
foobar fizzbuzz
(message "Paste created: %s" location)
(when gist-view-gist
(browse-url location))
(kill-new location)))
;;;###autoload
(defun gist-region-private (begin end)
"Post the current region as a new private paste at gist.github.com
les public description)
stub
(setq files (gh-object-list-read (oref stub file-cls)
(gh-read data 'files))
public (gh-read data 'public)
descrip
@jordonbiondo
jordonbiondo / *scratch*.el
Last active May 25, 2018 12:14
Create an async.el-friendly lambda that uses variables and functions bound in the current emacs instance.
(defmacro value-bound-lambda (args symbols &rest body)
"Returns a lambda expression with ARGS, where each symbol in SYMBOLS is
available for use and is bound to it's value at creation.
Symbols needs to be a list of variables or functions available globally."
(declare (indent defun))
(let ((vars (remove-if-not 'boundp symbols))
(funcs (remove-if-not 'functionp symbols)))
`(lambda ,args
(let ,(mapcar (lambda (sym) (list sym (symbol-value sym))) vars)
(defmacro value-bound-lambda (symbols &rest body)
(declare (indent defun))
(let ((vars (remove-if-not 'boundp symbols))
(funcs (remove-if-not 'functionp symbols)))
`(lambda ()
(let ,(mapcar (lambda (sym) (list sym (symbol-value sym))) vars)
,@(mapcar (lambda (sym) `(fset ',sym ,(symbol-function sym))) funcs)
,@body))))
(defun sendtext:escape-text(s):
(with-temp-buffer
(insert s)
(replace-string "\\" "\\\\" nil (point-min) (point-max))
(replace-string "\"" "\\\"" nil (point-min) (point-max))
(buffer-substring-no-properties (point-min) (point-max))))
(defun sendtext:send-iterm2(beg end)
(interactive "r")
(let ((text (buffer-substring-no-properties beg end)))