[2019-02-01 Fri]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env hy3 | |
(import [requests [get :as fetch]]) | |
(require [hy.extra.anaphoric [ap-each :as aeach | |
ap-map :as amap]] | |
[hy.contrib.walk [let]]) | |
(defmacro try* [&rest body] | |
`(try ~@body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Moved to dedicated repo: https://github.com/alphapapa/snow.el |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cl-defmacro bench-lexical-binding (&key (times 1) forms ensure-equal) | |
"FIXME docstring" | |
(declare (indent defun)) | |
`(let ((dynamic (bench-multi :times ,times :ensure-equal ,ensure-equal :raw t | |
:forms ,forms)) | |
(lexical (bench-multi-lexical :times ,times :ensure-equal ,ensure-equal :raw t | |
:forms ,forms)) | |
(header '("Form" "x faster than next" "Total runtime" "# of GCs" "Total GC runtime")) | |
combined-results) | |
(cl-loop for result in-ref dynamic |
(test-it)
Form | x faster than next | Total runtime | # of GCs | Total GC runtime |
---|---|---|---|---|
buffer-local-value | 82.16 | 0.015201458999999999 | 0 | 0.0 |
with-current-buffer | slowest | 1.2490068650000001 | 0 | 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; org-kbd | |
;; (setq org-emphasis-alist '(("%" org-kbd verbatim) | |
;; ("*" bold) | |
;; ("/" italic) | |
;; ("_" underline) | |
;; ("=" org-verbatim verbatim) | |
;; ("~" org-code verbatim) | |
;; ("+" | |
;; (:strike-through t)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# * Defaults | |
compression=xz | |
subdir="web" | |
# * Functions | |
function debug { |