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
# Initial tests | |
using BenchmarkTools | |
N = 1_000_000 | |
@btime let s = 0 | |
for i in 1:$N | |
s += i&1 | |
end |
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
(defun isend--perl (buf-name) | |
"Prepend 'x ' to normal perl instructions. | |
Leave 'print' instructions untouched." | |
(with-current-buffer buf-name | |
(goto-char (point-min)) | |
(unless (looking-at "[[:space:]]*print") | |
(insert "x "))) | |
(insert-buffer-substring buf-name)) | |
(defun isend-default-perl-setup () |
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
(defun my-select-bottom-window () | |
(let ((bottom-window (selected-window)) | |
window-below) | |
(while (setq window-below (window-in-direction 'below bottom-window)) | |
(setq bottom-window window-below)) | |
(select-window bottom-window))) | |
(defun my-compilation-hook () | |
(when (not (get-buffer-window "*compilation*")) | |
(save-selected-window |
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
(defun source (filename) | |
"Update environment variables from a shell source file." | |
(interactive "fSource file: ") | |
(message "Sourcing environment from `%s'..." filename) | |
(with-temp-buffer | |
(shell-command (format "diff -u <(true; export) <(source %s; export)" filename) '(4)) | |
(let ((envvar-re "declare -x \\([^=]+\\)=\\(.*\\)$")) |
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
#include "foo.hxx" | |
int main () { | |
return 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
;;; Desktop | |
(setq desktop-save 'ask) | |
(defvar desktop-base-dir "~/.emacs.d/desktops/" | |
"Base directory for desktop files") | |
(defun desktop--set-frame-title () | |
(setq frame-title-format | |
(list (concat "%b - Emacs [" | |
(file-name-nondirectory (directory-file-name desktop-dirname)) | |
"]")))) |
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
;; This macro creates new compilation commands | |
(defmacro ff/add-compilation-command (name &optional key) | |
(let ((buffer-name (concat "*" name "*")) | |
(compile-symbol (intern name)) | |
(recompile-symbol (intern (concat "re" name)))) | |
(when (fboundp compile-symbol) | |
(warn "redefining command `%s'" name)) | |
(when (fboundp recompile-symbol) | |
(warn "redefining command `re%s'" name)) | |
`(progn |
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
(defun clocktable-by-tag/shift-cell (n) | |
(let ((str "")) | |
(dotimes (i n) | |
(setq str (concat str "| "))) | |
str)) | |
(defun clocktable-by-tag/insert-tag (params) | |
(let ((tag (plist-get params :tags))) | |
(insert "|--\n") | |
(insert (format "| %s | *Tag time* |\n" tag)) |
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
(setq my-scroll-counter 0) | |
(setq my-scroll-limit 5) | |
(setq my-last-scroll 0) | |
(setq my-scroll-interval 0.1) | |
(defun up1() | |
(interactive) | |
(let ((now (float-time))) | |
(if (and (eq last-command this-command) | |
(< (- now my-last-scroll) my-scroll-interval)) |