Skip to content

Instantly share code, notes, and snippets.

View death's full-sized avatar

death

View GitHub Profile
@death
death / aoc2021-day3.lisp
Last active December 3, 2021 06:58
aoc2021-day3
;;;; +----------------------------------------------------------------+
;;;; | Advent of Code 2021 |
;;;; +----------------------------------------------------------------+
(defpackage #:snippets/aoc2021/day3
(:use #:cl)
(:export
#:day3))
(in-package #:snippets/aoc2021/day3)
@death
death / aoc2021-day2.lisp
Created December 2, 2021 05:22
aoc2021-day2
;;;; +----------------------------------------------------------------+
;;;; | Advent of Code 2021 |
;;;; +----------------------------------------------------------------+
(defpackage #:snippets/aoc2021/day2
(:use #:cl)
(:export
#:day2))
(in-package #:snippets/aoc2021/day2)
@death
death / aoc2021-day1.lisp
Created December 1, 2021 05:29
aoc2021-day1
;;;; +----------------------------------------------------------------+
;;;; | Advent of Code 2021 |
;;;; +----------------------------------------------------------------+
(defpackage #:snippets/aoc2021/day1
(:use #:cl)
(:export
#:day1))
(in-package #:snippets/aoc2021/day1)
@death
death / clim-repos.lisp
Last active February 6, 2025 15:14
Update Lisp repos
;; A GUI for fetching all third party git Lisp repos.
;;
;; Kinda silly and limited, but what the hell.
(defpackage #:snippets/clim-repos
(:use #:clim-lisp #:clim)
(:shadow
#:merge)
(:import-from
#:uiop)
@death
death / template-engine.lisp
Created October 9, 2021 13:57
template-engine
;; [15:04] <_death> sure, it's not too difficult.. you could also pick an existing syntax
;; I answered binrapt after he talked about template engines.
;; I don't think I ever wrote a template engine, so why did I say that?
;; Anyway, let's write a template engine.
(defpackage #:snippets/template-engine
(:use #:cl)
(:import-from #:alexandria
#:emptyp)
(:import-from #:sb-ext
@death
death / obfuscate.lisp
Last active September 23, 2021 03:11
Late-night obfuscation
(defpackage #:snippets/obfuscate
(:use #:cl)
(:import-from #:cl-permutation)
(:export
#:*seed*
#:ob
#:unob))
(in-package #:snippets/obfuscate)
@death
death / history-class.lisp
Created March 9, 2021 17:28
history class
(defpackage #:snippets/history-class
(:use #:cl #:closer-mop)
(:shadowing-import-from
#:closer-mop
#:standard-generic-function
#:defgeneric
#:defmethod)
(:import-from
#:fset)
(:export
@death
death / define-equality-test.lisp
Last active February 27, 2021 20:45
define-equality-test
(defmacro define-equality-test (name (&rest options) &body cases)
(declare (ignore options))
`(defun ,name (object1 object2)
(cond ,@(mapcar #'make-cond-clause cases))))
(defun make-cond-clause (case)
(destructuring-bind (type comparison) case
`((and (typep object1 ',type)
(typep object2 ',type))
,(make-comparison-body comparison 'object1 'object2 'identity))))
@death
death / array.txt
Created January 25, 2021 15:13
defcstruct count/array usage
CL-USER> (test-defcstruct-array)
[third-party/cells-gtk3/gtk-ffi/gtk-core.lisp:53]
(CFFI:DEFCSTRUCT G-VALUE
(G-TYPE GTYPE)
(G-DATA (:ARRAY G-VALUE-DATA 2)))
[third-party/cffi/tests/fsbv.lisp:88]
(DEFCSTRUCT (STRUCT-WITH-ARRAY :SIZE 6) (S1 (:ARRAY :CHAR 6)))
@death
death / aoc2020-day25.lisp
Created December 25, 2020 15:00
aoc2020 day25
;;;; +----------------------------------------------------------------+
;;;; | Advent of Code 2020 |
;;;; +----------------------------------------------------------------+
(defpackage #:snippets/aoc2020/day25
(:use #:cl)
(:import-from
#:ironclad
#:expt-mod)
(:export