Skip to content

Instantly share code, notes, and snippets.

View davidshepherd7's full-sized avatar

David Nikel-Shepherd davidshepherd7

View GitHub Profile
@davidshepherd7
davidshepherd7 / Makefile
Created April 12, 2015 10:25
coursera crypto assignment 4: fixed Makefile
all: vrfy mac
vrfy: vrfy.o cbcmac.o aes_core.o
gcc -o vrfy vrfy.o cbcmac.o aes_core.o -lpthread
mac: mac.o cbcmac.o aes_core.o
gcc -o mac mac.o cbcmac.o aes_core.o -lpthread
clean:
rm -f mac.o aes_core.o cbcmac.o mac.o vrfy.o vrfy mac
@davidshepherd7
davidshepherd7 / gist:d9fe1ae929e3dde22c1d
Created February 10, 2015 14:40
Scaled block matrices in LaTeX
\newcommand{\scalemath}[2]{\scalebox{#1}{\begin{math} {#2} \end{math}}}
\newcommand{\Aprime}{\scalemath{0.5}{\begin{matrix} \Amm & \Abound \\ \zm & -\Idm \end{matrix}}}
\newcommand{\Gprime}{\scalemath{0.5}{\begin{matrix} \zm & \zm \\ \zm & \bm \end{matrix}}}
\newcommand{\Qprime}{\scalemath{0.5}{\begin{matrix} \Qm \\ \zm \end{matrix}}}
Combining the above with the Jacobian matrix as derived in \cref{sec:llg-magn-coupl}, the complete Jacobian is
\begin{equation}
\Jm =
\scalemath{2}{
@davidshepherd7
davidshepherd7 / gist:579fd585b891a81eec73
Created January 26, 2015 20:36
better comment-dwim
(defun dwim-entire-line (function)
(if (region-active-p)
(funcall function (region-beginning) (region-end))
;; else
(funcall function (point-at-bol) (point-at-beginning-of-next-line))))
(global-set-key (kbd "M-;") (lambda () (interactive)
(dwim-entire-line 'comment-or-uncomment-region)))
(defun true1 () t)
(setq function-list (list #'true1))
(cons 'or function-list)
(eval (cons 'or function-list))