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 () { | |
var exports = {}; | |
exports.makeArray = function (a, b) { | |
return function(chooser) { | |
return chooser(a, b); | |
}; | |
}; | |
exports.first = function (array) { |
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
(defpackage :lisp-oo | |
(:use :cl)) | |
(in-package :lisp-oo) | |
(defclass content () | |
((tags :initform nil :initarg :tags :accessor content-tags) | |
(slug :initform nil :initarg :slug :accessor content-slug) | |
(date :initform nil :initarg :date :accessor content-date) | |
(text :initform nil :initarg :text :accessor content-text))) |
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
(defpackage :cl-basics | |
;; Clauses we're not using: import-from, export, shadow | |
(:use :cl)) | |
(in-package :cl-basics) | |
(defvar *foo* "bar" | |
"A simple variable with docstring.") | |
(defun foo (bar) |
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
;; Stolen from Read-Eval-Print-Love by the inimitable Michael Fogus | |
(defmacro schemish (functions &body body) | |
`(macrolet ,(mapcar (lambda (function) | |
`(,function (&rest args) | |
`(funcall ,',function ,@args))) | |
functions) | |
,@body)) |
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 count-macro-expansions (&body body) | |
"Count the number of macro expansions required to execute | |
BODY. Return two values: the result of executing BODY and the | |
number of expansions." | |
(let ((closures (gensym "CLOSURES-"))) | |
`(let* ((,closures | |
(funcall | |
(compile nil | |
`(lambda () | |
(let ((count 0)) |
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
#!/bin/sh | |
wget http://libsdl.org/release/SDL2-2.0.0.tar.gz | |
tar zxvf SDL2-2*tar.gz | |
cd SDL2-2.0.0 | |
./configure && make -j 4 | |
# You may need to change the path to fez for this to work | |
rm ~/fez/lib64/libSDL2-2.0.so.0 | |
cp builds/.libs/libSDL2-2.0.so.0 ~/fez/lib64/ | |
sed -i s/Fullscreen/Windowed/g ~/.config/FEZ/Settings |
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
import smokesignal | |
from helga.client import helga | |
from helga.extensions.base import CommandExtension, ContextualExtension | |
class MemoExtension(CommandExtension, ContextualExtension): | |
""" | |
Memos are very useful in IRC to leave a note for someone presently offline. | |
""" | |
NAME = 'memo' |
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-when (:compile-toplevel :load-toplevel :execute) | |
(ql:quickload '(yason closer-mop alexandria))) | |
;; Turns out cl-json does this just as fast without all the fuss. | |
;; Just (cl-json:encode-json (romreader:load-rom "foo.nes") stream). | |
(defpackage #:json-export | |
(:use :cl) | |
(:import-from #:closer-mop #:class-slots | |
#:slot-definition-name) |
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
(ql:quickload '(cl-fad cl-ppcre)) | |
(defpackage :sloc | |
(:use :cl) | |
(:import-from :cl-fad #:walk-directory)) | |
(in-package :sloc) | |
(defvar *ext->syntax* | |
'(("factor" "^!.*")) |
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
git log master | grep -C 1 'Brit Butler' | grep 'commit ' | cut -d ' ' -f 2 | xargs git show > commits.txt | |
# I almost did this in lisp. Then I thought better of it. Update that resume! |