Skip to content

Instantly share code, notes, and snippets.

(font-lock-add-keywords
'lisp-mode
'(("\\<\\(bind\\)\\>" . font-lock-keyword-face)
("\\<\\(lambda-bind\\)\\>" . font-lock-keyword-face)
("\\<\\(lambda-registers\\)\\>" . font-lock-keyword-face)
("\\<\\(when-let\\)\\>" . font-lock-keyword-face)
("\\<\\(if-let\\)\\>" . font-lock-keyword-face)
;; fancy character for smaller lambda-bind
("(?\\(lambda-bind\\>\\)"
(0 (progn (compose-region (match-beginning 1) (match-end 1) ?\β) nil)))
@eschulte
eschulte / act_file.pl
Created February 16, 2012 03:07
irssi script to write window activity list to an external file for consumption by xmobar
#
# Prints a window activity line to a file with color markup for consumption by xmobar
#
# Based on activity_file and nicklist
#
#
# The script uses 3 variables:
# act_file_width: How many characters wide the act list can be
# act_file_path: Path to the file
# act_file_hilight: How to hilight the "ACT" in the beginning:
servers = (...
{
address = "irc.freenode.net";
chatnet = "freenode";
port = "6667";
use_ssl = "no";
ssl_verify = "no";
autoconnect = "no";
},
...);
@eschulte
eschulte / setf-it.lisp
Created December 22, 2011 22:46
setf not working as expected
(defun (setf it) (new tree) (setf tree new))
(let ((this :foo))
(setf (it this) :bar)
this) ;; => :foo (why does this return :foo and not :bar)
myKeys conf@(XConfig {XMonad.modMask = modm}) =
[ ((modm, xK_b), sendMessage ToggleStruts) -- Mod-b: toggle xmobar panel
, ((modm, xK_p), spawn "dmenu_run") -- needs explicit for completion
-- , ("<XF86AudioNext>", spawn "cmus-remote -n")
, ((0, xF86XK_AudioNext), spawn "cmus-remote -n")
, ((0, xF86XK_AudioPrev), spawn "cmus-remote -r")
, ((0, xF86XK_AudioPlay), spawn "cmus-remote -u")
, ((0, xF86XK_AudioStop), spawn "cmus-remote -s")
, ((0, xF86XK_AudioLowerVolume), spawn "amixer set Master 5%-")
, ((0, xF86XK_AudioRaiseVolume), spawn "amixer set Master 5%+")
(add-to-list 'org-export-latex-classes
'("twocolumn" "\\documentclass[10pt, twocolumn]{article}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
echo "(defvar tweets '(" > /tmp/tweet.lisp
cat tweet.TREC|sed 's/<TREC>//g; s/<\/TREC>/))/g; s/<DOC>//g; s/<\/DOC>//g; s/<DOCNO>/(:/g; s/<\/DOCNO>//g; s/\\/\\\\/g; s/"/\\"/g; s/<body>/"/g; s/<\/body>/")/g'>>/tmp/tweet.lisp
# then from CL
# (load "/tmp/tweet.lisp")
# (length tweets) ;; => 113201
@eschulte
eschulte / save-image.shen
Created October 18, 2011 19:43
save the current shen image as an executable (when platform=clisp)
(EXT:SAVEINITMEM "shen-w-libs"
:INIT-FUNCTION #'shen-shen
:NORC T
:SCRIPT T
:EXECUTABLE T
:QUIET T)
(define linear-pa
N -> (snd (reduce
(/. X Y
(let Pnt (pick (fst Y))
(@p [Pnt X|(fst Y)] (@p [X|(fst (snd Y))] [[X Pnt]|(snd (snd Y))]))))
(@p [0] (@p [0] [])) (range 1 (- N 1)))))
@eschulte
eschulte / setup-package.el
Created October 14, 2011 16:36
configuring package.el when running Emacs24
(setq package-archives
'(("original" . "http://tromey.com/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")))
(package-initialize)