Skip to content

Instantly share code, notes, and snippets.

@ryukinix
ryukinix / find-executable.lisp
Last active January 3, 2023 00:26
find-executable in Common Lisp
(defun executables ()
(loop with path = (uiop:getenv "PATH")
for p in (uiop:split-string path :separator ":")
for dir = (probe-file p)
when (uiop:directory-exists-p dir)
append (uiop:directory-files dir)))
(defun find-executable (name)
(find name (executables)
:test #'equalp
@favadi
favadi / build-emacs.sh
Last active June 5, 2021 15:25
Compile latest emacs version (24.5) in Ubuntu 14.04
#!/bin/bash
# Build latest version of Emacs, version management with stow
# OS: Ubuntu 14.04 LTS
# version: 24.5
# Toolkit: lucid
# Warning, use updated version of this script in: https://github.com/favadi/build-emacs
set -e
@alco
alco / mergesort.clj
Created March 20, 2012 13:08
Mergesort in Clojure
(defn merge-seqs
"Merges two sorted sequences into a single sorted sequence"
([left right]
(merge-seqs (list left right)))
([[left right]]
(loop [l left, r right, result []]
(let [lhead (first l), rhead (first r)]
(cond
(nil? lhead) (concat result r)
(nil? rhead) (concat result l)