Skip to content

Instantly share code, notes, and snippets.

@priyadarshan
priyadarshan / lambda.txt
Created July 11, 2019 06:14
lambda.txt -- the ultimate fortune file
This is the file LAMBDA.TXT, version 11.
Last Edit: 2005-Sep-13
To install on systems using BSD fortune(6), rename this file "lambda" and
store it in the appropriate fortunes directory, usually /usr/games/fortune
or /usr/share/fortune or something like that. Then in that directory run
strfile(8) on the "lambda" file which should produce a "lambda.dat". To
test, go to some other directory with no file called "lambda" in it, and
say "fortune lambda". If you get a lispy fortune you win. If not you lose.
To install on other systems simply find a fortune program, install it, and
; https://github.com/netb258/clj-maze/blob/master/src/maze/core.clj
; CL version, by Rainer Joswig, [email protected], 2019
; changes
; maze is a 2d array, contents are symbols/numbers
; pass directions as symbols
; use paths as position histories
@alphapapa
alphapapa / bench.org
Last active August 17, 2019 06:47
Emacs: Benchmarking sequence shuffling

Benchmarking sequence shuffling

See melpa/melpa#6191 (comment)

(defun key-quiz--shuffle-list (list)
  "Shuffles LIST randomly, modying it in-place."
  (dolist (i (reverse (number-sequence 1 (1- (length list)))))
    (let ((j (random (1+ i)))
	  (tmp (elt list i)))
@j3pic
j3pic / slow.lisp
Last active May 20, 2019 14:48
Program to test the performance of Lisp file I/O.
;; It is often said that Lisp macros need not be used for optimization purposes. This
;; is an exception. SBCL issued the following warning when compiling the MAKE-ARRAY call
;; below:
;; ; note: unable to optimize because: ELEMENT-TYPE is not constant.
;; I don't want to lose the ability to decide which ELEMENT-TYPE to use by using
;; an :ELEMENT-TYPE argument, so I have to arrange for this argument to be processed
;; at compile time.
@emres
emres / compare-monospace-fonts-ms-windows.el
Created May 9, 2019 09:50
Compare mono spaced fonts in MS Windows by printing the same string of text in all of them
;; see also:
;; https://gist.github.com/emres/917ffc60f4fe209a6a1bad6b3abd4fa1
(defun font-is-mono-p (font-name)
(string-match "-mono-" font-name))
(defun compare-monospace-fonts ()
"Display a list of all monospace font faces. Tested on MS Windows 10."
(interactive)
(pop-to-buffer "*Monospace Fonts*")
(erase-buffer)
; https://codereview.stackexchange.com/questions/215682/occurrences-frequency-count-exercise-3-ch-3-in-ansi-common-lisp/215711?noredirect=1#comment417480_215711
(defun occurrences (list)
(let ((ht (make-hash-table)))
(let ((holder nil))
(dolist (x list)
(if (not (member x holder :test #'eq))
(progn
(push x holder)
msys2 vs msys vs msysgit
MinGW doesn't provide a linux-like environment, that is MSYS(2) and/or Cygwin
Cygwin is an attempt to create a complete UNIX/POSIX environment on Windows.
MinGW is a C/C++ compiler suite which allows you to create Windows executables - you only
need the normal MSVC runtimes, which are part of any normal Microsoft Windows installation.
MinGW provides headers and libraries so that GCC (a compiler suite,
not just a "unix/linux compiler") can be built and used against the Windows C runtime.
@coetry
coetry / prompt-read.lisp
Last active August 20, 2019 12:48
prompt-read
(defun prompt-read (prompt)
(format *query-io* "~a: " prompt)
read-line *query-io*))
@jlevon
jlevon / newboot-flagday.md
Last active June 18, 2020 15:51
Flag day: OS-7260 SmartOS should support booting with loader
@priyadarshan
priyadarshan / plex-on-omnios-r151028-lx-zone.md
Last active May 17, 2022 17:48
Install Plex on OmniOS r151028 via lx zone