Skip to content

Instantly share code, notes, and snippets.

View jordonbiondo's full-sized avatar
🤖
bzzzzzt

Jordon Biondo jordonbiondo

🤖
bzzzzzt
View GitHub Profile
@jordonbiondo
jordonbiondo / fmt.el
Last active February 27, 2024 16:21
Emacs string interpolation macro example
;; Example usage
;; (let ((a 5)
;; (b 6))
;; (message "%s" ($fmt "If you add ${a} and ${b}, you get ${(+ a b)}!")))
;;
;; Outputs: If you add 5 and 6 you get 11!
;;
;;
;; Expanding the macro:

Keybase proof

I hereby claim:

  • I am jordonbiondo on github.
  • I am jordonbiondo (https://keybase.io/jordonbiondo) on keybase.
  • I have a public key ASCCd4-UHvy4TTECd4YWbPT4I6f71E_KFwc-EItzhOqSwwo

To claim this, I am signing this object:

@jordonbiondo
jordonbiondo / use-package-later.el
Created September 13, 2016 13:08
Use Package :later keyword like the old :idle keyword
(eval-when-compile
(require 'use-package))
(add-to-list 'use-package-keywords :later t)
(defalias 'use-package-normalize/:later 'use-package-normalize-forms)
(defun use-package-handler/:later (name keyword arg rest state)
"Handler for `:later' keyword in `use-package'."
(let ((wrapped-arg
words :
word |
words word {
char* foo = malloc(sizeof(char) * 1000); // just for testing;
sprintf(foo, "(append %s %s)", $1, $2);
$$ = foo;
} |
words end {
printf("%s", $1);
exit(0);
DEBUG:pebble_tool.util.analytics:Queueing analytics data: {'platform': 'native_sdk', 'data': {}, 'event': 'invoke_command_install', 'identity': {'sdk_client_id': 'ce09c635-2e03-4bcb-a8a4-a14026384bfb'}, 'sdk': {'project': {'sdk': u'3', 'is_watchface': False, 'type': 'native', 'uuid': '1f2982ca-b174-4d71-94ca-e351322524e4', 'app_name': u'a-test-project'}, 'host': {'platform': 'Darwin-14.5.0-x86_64-i386-64bit', 'python_version': '2.7.10', 'is_vm': False}, 'version': u'3.8.2', 'tool_version': '4.0'}}
DEBUG:pebble_tool.util.analytics:Analytics disabled; not posting.
DEBUG:libpebble2.communication:-> WatchVersion(command=None, data=WatchVersionRequest())
DEBUG:libpebble2.communication:-> 0001001000
DEBUG:libpebble2.communication:<- 00960010015509b4fb76322e392e31000000000000000000000000000000000000000000000000000035343636346264000005015222545f76312e352e350000000000000000000000000000000000000000000000000000316331363237350001050152e2f832563352330000000000513135333332354530315043ee86fee9170026658a035509b4fb656e5f55530
@jordonbiondo
jordonbiondo / dll-fifo.el
Created December 30, 2015 15:17
A fifo queue in emacs lisp using a cyclic doubly linked list.
;; FIFO queue implementation using cyclic doubly linked lists
;;
;; This data structure is a bit overkill for a queue,
;; but it has many other uses
;; a doubly linked list cell look like (val . (prev-cell next-cell))
;;
;; a FIFO queue object looks like ('fifo . cyclic-doubly-linked-list)
;;
;; An empty FIFO queue would be: ('fifo . nil)
(defun jorbi/init.el-jump (&optional package)
"Jump to the top level use-package definition in the init file."
(interactive)
(unless package
(setq package
(ido-completing-read
"Package: "
(mapcar (lambda (p) (symbol-name (cadr p)))
(remove-if-not (lambda (f) (equal (car-safe f) 'use-package))
(with-temp-buffer
@jordonbiondo
jordonbiondo / imenu-use-packge.el
Last active December 15, 2022 10:45
have imenu include use-package
;; in action: http://i.imgur.com/Tt2M0LC.gif
(add-to-list 'imenu-generic-expression
'("Used Packages"
"\\(^\\s-*(use-package +\\)\\(\\_<.+\\_>\\)" 2))
;; I also highly recommend imenu-anywhere to make developing your config even easier
@jordonbiondo
jordonbiondo / se-spell.el
Last active August 29, 2015 14:20
Emacs spell check minor mode without external program
;; norvig checker in elisp
;; algorithm was barely modified from
;; https://github.com/mikaelj/snippets/blob/master/lisp/spellcheck/spellcheck.lisp
;;
;; usage:
;;
;; - You'll need a big text file of the english language
;;
;; - I suggest a novel or two concatenated together along with a dictionary
;;
@jordonbiondo
jordonbiondo / elisp-checker.el
Last active February 6, 2023 10:51
norvig elisp spell checker
;; norvig checker in elisp
;; barely modified from https://github.com/mikaelj/snippets/blob/master/lisp/spellcheck/spellcheck.lisp
;; watch it run here: http://i.imgur.com/guuVT2O.gif
(defun file-words (file)
(let ((words nil))
(with-temp-buffer
(insert-file-contents file)
(goto-char 1)