This file contains hidden or 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 works | |
| (defmacro crap/1 () | |
| (cl-flet ((foobar (a) "hi")) | |
| `(list ,(foobar 1)))) | |
| ;; this does not | |
| ;; Symbols function definiton is void: foobar | |
| (defmacro crap/2 () | |
| (cl-flet ((foobar (a) "hi")) |
This file contains hidden or 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
| (defvar simplegv-syntax-table | |
| (let ((table (make-syntax-table))) | |
| (modify-syntax-entry ?\# "< b" table) | |
| (modify-syntax-entry ?\n "> b" table) | |
| table) | |
| "Syntax table for `simplegv-mode'.") |
This file contains hidden or 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 pdflatex() | |
| (interactive) | |
| (ispell-buffer) | |
| (with-temp-buffer | |
| (let ((max-mini-window-height 0)) | |
| (if (zerop (shell-command "yes x | pdflatex *.tex" (current-buffer))) | |
| (shell-command "open *.pdf" (current-buffer)) | |
| (message (propertize "pdf creation failed" | |
| 'face '(:foreground "red"))))))) |
This file contains hidden or 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
| Jordons-MacBook-Pro:server jordon$ node | |
| > var algorithm = require('./coordinate-algorithm') | |
| undefined | |
| > algorithm.autogenerateRelationsFile(4) // auto generated relations for a standard 4x4 cube | |
| undefined | |
| > generated: tile-auto-relations-4.json with 768 relations for 96 tiles | |
| size: 0.015MB | |
| > algorithm.autogenerateRelationsFile(10) | |
| undefined | |
| > generated: tile-auto-relations-10.json with 4800 relations for 600 tiles |
This file contains hidden or 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
| function autogenerateRelationsFileSafe(size, filename) { | |
| var cg = new CubeGrid(size); | |
| filename = (filename == undefined) ? 'tile-auto-relations-'+size+'.json' : filename; | |
| var fs = require('fs'); | |
| var stream = fs.createWriteStream(filename); | |
| stream.once('open', function(fd) { | |
| var tileCount = cg.size*cg.size*6; | |
| stream.write("{"); |
This file contains hidden or 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
| (add-hook 'shell-mode-hook | |
| (lambda() | |
| (make-local-variable 'face-remapping-alist) | |
| (face-remap-add-relative 'default :background "red"))) |
This file contains hidden or 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
| (eval-after-load "flyspell" | |
| `(add-hook 'flyspell-mode-hook | |
| (lambda () | |
| (define-key flyspell-mode-map (kbd "C-.") nil) | |
| (define-key flyspell-mode-map (kbd "C-,") nil)))) |
This file contains hidden or 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
| (eval-after-load "flyspell" | |
| `(add-hook 'flyspell-mode-hook | |
| (lambda () | |
| (define-key flyspell-mode-map (kbd "C-.") nil) | |
| (define-key flyspell-mode-map (kbd "C-,") nil)))) |
This file contains hidden or 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
| (defmacro varboundp (var) | |
| "Returns t if the symbol var is bound lexically, VAR must be unquoted." | |
| `(equal 'this-variable-is-bound (ignore-errors ,var 'this-variable-is-bound))) | |
| (let ((a 30) | |
| (b 3)) | |
| (assert (varboundp a)) | |
| (assert (varboundp b)) | |
| (assert (not (varboundp c)))) |
This file contains hidden or 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
| (defmacro unquote (v) | |
| "(unquote 'a) -> a" | |
| (intern (symbol-name (second v)))) | |
| (defmacro varp (symbol) | |
| "Return t if SYMBOLS's value is not void, nil otherwise. \ | |
| Works with lexically bound variables." | |
| `(ignore-errors (unquote ,symbol) t)) | |
| ;; lexical boundp |